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 Center および File ExchangeSignal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by