HI Thanasis,
first things first: That is gr::digital::scrambler_bb, which has doxygen
documentation [1].
The length is really just the length of the underlying shift register --
which ought to be at least (order of generator poly)+1, ie.
floor(log2(mask))+1
I recommend having a quick glance at its source code [2], revealing that
it's actually but a block wrapper around gr::digital::lfsr[3].
If I read lfsr's code correctly, you're right, the highest bit of the
mask will always be ignored, because it [4] will always be ANDed with a 0:
unsigned char newbit = (popCount( d_shift_register & d_mask
)%2)^(input & 1);
since d_shift_register never sees the 8th bit being set:
d_shift_register = ((d_shift_register>>1) |
(newbit<<d_shift_register_length));
So, yes, I think I agree, and length should at least be 8 here (your
polynomial has degree 7), and it's a bit uncommon to see a LFSR being
used without the x^0 coefficient.
Best regards,
Marcus
[1]
http://gnuradio.org/doc/doxygen/classgr_1_1digital_1_1scrambler__bb.html#details
[2]
https://github.com/gnuradio/gnuradio/blob/master/gr-digital/lib/scrambler_bb_impl.cc
[3] http://gnuradio.org/doc/doxygen/classgr_1_1digital_1_1lfsr.html
[4]
https://github.com/gnuradio/gnuradio/blob/master/gr-digital/include/gnuradio/digital/lfsr.h#L128
On 05/15/2015 08:24 AM, Thanasis Balafoutis wrote:
> Hi,
>
> the default values for the parameters of the scrambler block are the
> following:
> Mask: 0x8A
> Seed: 0x7F
> length:7
>
> Is this a 7-bit scrambler? If yes, why the mask corresponds to an
> 8-bit number? (0x8A = '10001010')
> What is the polynomial that corresponds to this mask?
> According to this link (which I found as reference):
> http://wiki.spench.net/wiki/GNU_Radio_Notes#GLFSR_Source
>
> the mask 0x8A is related with the polynomial x^8+x^4+x^2+1
>
> Is that correct? Do I miss something or is there an error on default
> values?
>
> Thank you!
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio