[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch-gnuradio] (De-)scrambler based on Galois LFSR

From: Stefan Brüns
Subject: [Patch-gnuradio] (De-)scrambler based on Galois LFSR
Date: Thu, 17 Dec 2009 19:28:37 +0100
User-agent: KMail/1.9.9


I have added (de-)scramble methods to the gri_glfsr.h Galois LFSR.

- Galois type LFSRs are faster then Fibonacci type (the later uses popcount, 
which is not available on all CPUs, and the current code has it implemented 
in C).
- The Fibonacci LFSR have a delay corresponding to the register length (this 
could be changed ...). The Galois LFSR has no delay.
I think several people have been tricked by the second point when using GR for 
packet radio - one has to feed enough data to flush the register.

Both types of LFSRs can be interchanged and mixed arbitrarily, but there are 
some caveats:
- Polynom specification for both types are different.
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.

The GR blocks are more or less plain copies of the existing blocks. Might be a 
good idea to drop the (unused) len parameter.

Everything open for discussion.



 Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
phone: +49 241 53809034   mobile: +49 151 50412019

Attachment: 0003-Add-galois-lfsr-de-scrambler.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]