2010年11月23日星期二

usage of scrambler_bb in gnuradio

from this page
http://gnuradio.org/doc/doxygen/gri__lfsr_8h-source.html
I know

00029 /*!
00030  * \brief Fibonacci Linear Feedback Shift Register using specified polynomial mask
00031  * \ingroup misc
00032  *
00033  * Generates a maximal length pseudo-random sequence of length 2^degree-1
00034  * 
00035  * Constructor: gri_lfsr(int mask, int seed, int reg_len);
00036  *  
00037  *      mask - polynomial coefficients representing the locations
00038  *             of feedback taps from a shift register which are xor'ed
00039  *             together to form the new high order bit.
00040  *
00041  *             Some common masks might be:
00042  *              x^4 + x^3 + x^0 = 0x19
00043  *              x^5 + x^3 + x^0 = 0x29
00044  *              x^6 + x^5 + x^0 = 0x61
00045  *
00046  *      seed - the initialization vector placed into the register
00047  *             durring initialization.   Low order bit corresponds
00048  *             to x^0 coefficient -- the first to be shifted as output.
00049  *
00050  *   reg_len - specifies the length of the feedback shift register 
00051  *             to be used.   Durring each iteration, the register
00052  *             is rightshifted one and the new bit is placed in bit reg_len.
00053  *             reg_len should generally be at least order(mask) + 1
00054  *
00055  *
00056  * see http://en.wikipedia.org/wiki/Linear_feedback_shift_register 
00057  * for more explanation.
 
However, in this page, a different view is introduced. 
http://www.mail-archive.com/patch-gnuradio@gnu.org/msg00180.html
For Gal', one only has to use the binary representation (e.g. x^4+x^3+1 => 
2^4+2^3+1 = 0x19) and shift it one bit left ( 0x13>>1 = 0x9).
For Fib, the following has to be done: Reverse the binary representation (0x19 
= 11001 => 10011), strip the highest bit. The resulting parameters for the 
lfsr are (mask=0x3, len=(degree-1)=3). (Yes, this is somewhat contrary to the 
comments in gri_lfsr.h. IMHO, the documentation is wrong/misleading. Most 
noteworthy, the len paramater is not the register len, but the bitshift).
- Internal state of the two types differs. For self synchronizing 
applications, this is a non issue, for synchronous operation, either use the 
same type, or calculate the corresponding seed values for both types.

没有评论:

发表评论