gr::digital::lfsr
gnuradio/digital/lfsr.h
uint64_t uint64_t gr::digital::lfsr::d_shift_register d_shift_register gr::digital::lfsr::d_shift_register
uint64_t uint64_t gr::digital::lfsr::d_mask d_mask gr::digital::lfsr::d_mask
uint64_t uint64_t gr::digital::lfsr::d_seed d_seed gr::digital::lfsr::d_seed
uint8_t uint8_t gr::digital::lfsr::d_shift_register_length d_shift_register_length gr::digital::lfsr::d_shift_register_length
gr::digital::lfsr::lfsr
(uint64_t mask, uint64_t seed, uint8_t reg_len)
lfsr
gr::digital::lfsr::lfsr
uint64_t mask
uint64_t seed
uint8_t reg_len
mask
unsigned char unsigned char gr::digital::lfsr::next_bit () next_bit gr::digital::lfsr::next_bit pre_shift
unsigned char unsigned char gr::digital::lfsr::next_bit_scramble (unsigned char input) next_bit_scramble gr::digital::lfsr::next_bit_scramble unsigned char input
unsigned char unsigned char gr::digital::lfsr::next_bit_descramble (unsigned char input) next_bit_descramble gr::digital::lfsr::next_bit_descramble unsigned char input
void void gr::digital::lfsr::reset () reset gr::digital::lfsr::reset

Reset shift register to initial seed value

void void gr::digital::lfsr::pre_shift (int num) pre_shift gr::digital::lfsr::pre_shift int num

Rotate the register through x number of bits where we are just throwing away the results to get queued up correctly

next_bit
uint64_t uint64_t gr::digital::lfsr::mask () const mask gr::digital::lfsr::mask lfsr

Fibonacci Linear Feedback Shift Register using specified polynomial mask.

Generates a maximal length pseudo-random sequence of length 2^degree-1, if supplied with a primitive polynomial.

Constructor: digital::lfsr(int mask, int seed, int reg_len);

mask

- polynomial coefficients representing the locations of feedback taps from a shift register which are xor'ed together to form the new high order bit.

Some common masks might be: x^4 + x^3 + x^0 = 0x19, K=3 x^5 + x^3 + x^0 = 0x29, K=4 x^6 + x^5 + x^0 = 0x61, K=5

seed

- the initialization vector placed into the register during initialization. Low order bit corresponds to x^0 coefficient the first to be shifted as output.

reg_len

- specifies the length of the feedback shift register to be used. During each iteration, the register is rightshifted one and the new bit is placed in bit reg_len. reg_len should generally be at least order(mask) + 1

see http://en.wikipedia.org/wiki/Linear_feedback_shift_register for more explanation.

next_bit() - Standard LFSR operation Perform one cycle of the LFSR. The output bit is taken from the shift register LSB. The shift register MSB is assigned from the modulo 2 sum of the masked shift register.

next_bit_scramble(unsigned char input) - Scramble an input stream Perform one cycle of the LFSR. The output bit is taken from the shift register LSB. The shift register MSB is assigned from the modulo 2 sum of the masked shift register and the input LSB.

next_bit_descramble(unsigned char input) - Descramble an input stream Perform one cycle of the LFSR. The output bit is taken from the modulo 2 sum of the masked shift register and the input LSB. The shift register MSB is assigned from the LSB of the input.

See http://en.wikipedia.org/wiki/Scrambler for operation of these last two functions (see multiplicative scrambler.)

- gr::digital::lfsr
  d_mask
- gr::digital::lfsr
  d_seed
- gr::digital::lfsr
  d_shift_register
- gr::digital::lfsr
  d_shift_register_length
- gr::digital::lfsr
  lfsr
- gr::digital::lfsr
  mask
- gr::digital::lfsr
  next_bit
- gr::digital::lfsr
  next_bit_descramble
- gr::digital::lfsr
  next_bit_scramble
- gr::digital::lfsr
  pre_shift
- gr::digital::lfsr
  reset