Scrambler/Descrambler in 802.11 standard
Hello,
Im trying to implement 802.11 scrambler/descrambler in matlab. Based on the standard, it should look sth like this:
<</matlabcentral/answers/uploaded_files/18967/Bez%C2%A0tytu%C5%82u.png>>
My code looks like this:
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??
It is correct to sim this using comm. toolbox?
scr = comm.Scrambler(2, [0 -4 -7],…
[1 0 1 1 1 0 1]);
Best,
ErnestHello,
Im trying to implement 802.11 scrambler/descrambler in matlab. Based on the standard, it should look sth like this:
<</matlabcentral/answers/uploaded_files/18967/Bez%C2%A0tytu%C5%82u.png>>
My code looks like this:
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??
It is correct to sim this using comm. toolbox?
scr = comm.Scrambler(2, [0 -4 -7],…
[1 0 1 1 1 0 1]);
Best,
Ernest Hello,
Im trying to implement 802.11 scrambler/descrambler in matlab. Based on the standard, it should look sth like this:
<</matlabcentral/answers/uploaded_files/18967/Bez%C2%A0tytu%C5%82u.png>>
My code looks like this:
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??
It is correct to sim this using comm. toolbox?
scr = comm.Scrambler(2, [0 -4 -7],…
[1 0 1 1 1 0 1]);
Best,
Ernest scrambler, descrambler, wlan, 802.11, wifi, code MATLAB Answers — New Questions