How can implement descrambler operation ?

1 view (last 30 days)
murat alboga
murat alboga on 9 Sep 2018
Edited: Phung Dao on 18 Sep 2020
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

Answers (1)

Phung Dao
Phung Dao on 18 Sep 2020
Edited: Phung Dao on 18 Sep 2020
Are you sure your scambler function works?

Categories

Find more on Signal Processing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!