On 08 Oct 2014, at 14:23, Ernest Szczepaniak <ernest_szczepan...@wp.pl> wrote:
> So... After going deep into Annex L i found that my scrambler fails. Also > MATLAB built-in scrambler gives wrong results. Could you pls check this code > fragment? > > Asumme that we have 20 data bits to scramble. Initial scrambler state is [1 > 0 1 1 1 0 1] (bit nr 7 left side). > > scrambler_register=[1 0 1 1 1 0 1]; % > scrambler seed > data_bits=randi([0 1],1,20); % > data to be scrambled > > for i=1:20 > temp=xor(scrambler_register(1),scrambler_register(4)); % x7 and x4 xor > operation > data_scrambled(i)=xor(data_bits(i),temp); % output > bit > register=circshift(scrambler_register',-1,1)'; % shift > left register > register(7)=data_scrambled(i); the scrambler is independent from the data. you want to feedback temp and not data_scrambled. Maybe you want to have a look at Figure 1 in http://www.ccs-labs.org/bib/bloessl2015scrambler/ Bastian > end > > To clarify, left side of register has index (1), right side has index (7). > > Best, > Ernest > > > > -- > View this message in context: > http://gnuradio.4.n7.nabble.com/GRC-3-6-802-11-a-g-test-signal-tp50585p50685.html > Sent from the GnuRadio mailing list archive at Nabble.com. > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > -- Dipl.-Inform. Bastian Bloessl Distributed Embedded Systems Group University of Paderborn, Germany http://www.ccs-labs.org/~bloessl/ _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio