Scrambler/Descrambler in MATLAB

Status
Not open for further replies.

esto1990

Newbie level 2
Joined
Oct 3, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
25
Hello,

Im trying to implement 802.11 scrambler/descrambler in matlab. Based on the standard, it should look sth like this:



My code looks like this

Code:
data=zeros(1,7); %data
register=[1 0 1 1 1 0 1]; %initial state

for i=1:7
   temp=xor(register(1),register(4)); % x7 and x4 xor 
   out(8-i,1)=xor(data(8-i,1),temp); %output bit
   register=circshift(register',-1,1)'; %shift left
   register(7)=data(8-i,1); %insert data to register
end

When im trying to descramble data, with same code and same initial state it gives wrong results.

What am i doing wrong??

Is there any way to guess or estimate initial state at the receiver side??


Best,
Ernest
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…