itpp::LFSR Class Reference
Communications Module » Sequences

Binary Linear Feedback Shift (LFSR). More...

`#include <itpp/comm/sequence.h>`

## Public Member Functions

| LFSR (void)
| Constructor.
| LFSR (const bvec &connections)
| Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].
| LFSR (const ivec &connections)
| Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in octal format.
void | set_connections (const bvec &connections)
| Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].
void | set_connections (const ivec &connections)
| Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in octal format.
void | set_state (const bvec &state)
| Set state (contents in the shift registers) in bvec format.
void | set_state (const ivec &state)
| Set state (contents in the shift registers) in octal format.
bin | shift (void)
| Shift one step and output binary symbol.
bvec | shift (int no_shifts)
| Shift no_shifts steps and output bvec.
int | get_length (void)
| Return length of shift register.
bvec | get_state (void)
| Returns the state of the shift register.

## Detailed Description

Binary Linear Feedback Shift (LFSR).

- The LFSR is on Fibonacci form (see p. 104 in Peterson, Ziemer and Borth, "Introduction to Spread Spctrum communications", Prentice-Hall, 1995)
- If the connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r is a primitive polynomial, a Maximum Length Sequence (m-sequence) of length N=2^r-1 is constructed. Use an arbitrary state not equal to zero, to get a phase of the m-sequence
- For a table of primtive polynomials see p. 117 in the reference above or a suitable book on coding

Definition at line 53 of file sequence.h.

## Constructor & Destructor Documentation

## LFSR() [1/3]

itpp::LFSR::LFSR | ( | void |  | ) |

inline

Constructor.

Definition at line 57 of file sequence.h.

## LFSR() [2/3]

itpp::LFSR::LFSR | ( | const bvec & | connections | ) |

Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].

Definition at line 37 of file sequence.cpp.

References set_connections().

## LFSR() [3/3]

itpp::LFSR::LFSR | ( | const ivec & | connections | ) |

Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in octal format.

Definition at line 42 of file sequence.cpp.

References set_connections().

## Member Function Documentation

## set_connections() [1/2]

void itpp::LFSR::set_connections | ( | const bvec & | connections | ) |

Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in bvec format [g0,g1,...,gr].

Definition at line 47 of file sequence.cpp.

Referenced by LFSR(), and LFSR().

## set_connections() [2/2]

void itpp::LFSR::set_connections | ( | const ivec & | connections | ) |

Input connect_polynomial=1+g1*D+g2*D^2+...+gr*D^r in octal format.

Definition at line 54 of file sequence.cpp.

References itpp::oct2bin().

## set_state() [1/2]

void itpp::LFSR::set_state | ( | const bvec & | state | ) |

Set state (contents in the shift registers) in bvec format.

Definition at line 62 of file sequence.cpp.

References it_assert.

## set_state() [2/2]

void itpp::LFSR::set_state | ( | const ivec & | state | ) |

Set state (contents in the shift registers) in octal format.

Definition at line 68 of file sequence.cpp.

References it_assert, and itpp::oct2bin().

## shift() [1/2]

bin itpp::LFSR::shift | ( | void |  | ) |

inline

Shift one step and output binary symbol.

Definition at line 125 of file sequence.h.

Referenced by shift().

## shift() [2/2]

bvec itpp::LFSR::shift | ( | int | no_shifts | ) |

Shift no_shifts steps and output bvec.

Definition at line 75 of file sequence.cpp.

References it_assert, and shift().

## get_length()

int itpp::LFSR::get_length | ( | void |  | ) |

inline

Return length of shift register.

Definition at line 126 of file sequence.h.

## get_state()

bvec itpp::LFSR::get_state | ( | void |  | ) |

inline

Returns the state of the shift register.

Definition at line 127 of file sequence.h.

The documentation for this class was generated from the following files:

- itpp/comm/sequence.h
- itpp/comm/sequence.cpp

Generated on for IT++ by Doxygen 1.15.0