How can implement descrambler operation ?

1 次查看(过去 30 天)
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