How can implement descrambler operation ?

조회 수: 1 (최근 30일)
murat alboga
murat alboga 2018년 9월 9일
편집: Phung Dao 2020년 9월 18일
Hello,
I am trying to channel modelling in Matlab. I should complete descrambler processing in Receiver in order to recover original signal. I completed Scrambler part with XOR operation but I stuck about descrabler process. I shared below my scrambler process codes.
length = 1200;
binaryalph = [0,1];
randomData = randsrc(1,length,binaryalph);
seed = [[0,0,1,1, 1,1,1,1, 1,1,1,1, 1,1,1]
[0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1]
[1,0,1,1, 1,1,1,1, 1,1,1,1, 1,1,1]
[1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1]];
initialState = seed(1);
% Generator polynomial for LFSR ( 1 + x^(-14) + x^(-15) )
generatorPolynomial = [1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,1];
% Mask represents the value to tap from LFSR as output
mask = [1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0];
% Create PN Sequence object having the recommended generator polynomial and
% given initialState
% scr = comm.Scrambler(length(generatorPolynomial),'1 + x^(-14) + x^(-15)',
h = commsrc.pn('GenPoly',generatorPolynomial, ...
'InitialStates',initialState, ...
'CurrentStates',initialState, ...
'Mask',mask, ...
'NumBitsOut',1);
% Number of bits to generate for scrambling must be equal to the number of
% bits in the input
set(h,'NumBitsOut',numel(randomData));
% Do bitwise xor between input bits and generated pseudo-random bits to get
% the scrambled output bits
scrambledBitVector = bitxor(randomData,reshape(generate(h),1,[]));
If someone show the way how can I descrambler operation or share the descrambler codes reallay appreciate that.
Thanks in advance?
PALES

답변 (1개)

Phung Dao
Phung Dao 2020년 9월 18일
편집: Phung Dao 2020년 9월 18일
Are you sure your scambler function works?

카테고리

Help CenterFile Exchange에서 Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by