SPUC  3.0
Public Member Functions | Protected Attributes | List of all members
SPUC::max_pn Class Reference

Maximal Length Pseudorandom sequence generator. More...

#include <max_pn.h>

Public Member Functions

 max_pn (int g=0x006d, int len=63, int init=-1)
 
void reset ()
 Reset. More...
 
signed char out ()
 Get output (fast method) More...
 
bool get_bit ()
 Fast method. More...
 
signed char out1 ()
 Get output (alternative method) More...
 
int state ()
 

Protected Attributes

int lenp1
 
int gen
 
int u
 

Detailed Description

Maximal Length Pseudorandom sequence generator.

Simple implementation of a maximal length pseudorandom sequence used for spread spectrum PN generation, BER testing etc. G is the generator Len is the PN length (must be 2^N - 1) Init is an initialization seed Two methods supported out : exclusive or (XOR) shift register with Generator out1 : feedback with XOR reduction Note: G, LEN must be correct (need to get from book).

Author
Tony Kirke

Constructor & Destructor Documentation

SPUC::max_pn::max_pn ( int  g = 0x006d,
int  len = 63,
int  init = -1 
)
inline

Constructor Constructor

Member Function Documentation

bool SPUC::max_pn::get_bit ( )

Fast method.

References gen, lenp1, and u.

Referenced by SPUC::dvb_conv_encoder::get_data(), and SPUC::data_conv_encoder::get_data().

signed char SPUC::max_pn::out ( )
signed char SPUC::max_pn::out1 ( )

Get output (alternative method)

returns {0,1} instead of {-1,1}

References gen, lenp1, and u.

void SPUC::max_pn::reset ( void  )
inline
int SPUC::max_pn::state ( )
inline

Member Data Documentation

int SPUC::max_pn::gen
protected

Referenced by get_bit(), out(), and out1().

int SPUC::max_pn::lenp1
protected

Referenced by get_bit(), out(), and out1().

int SPUC::max_pn::u
protected

Referenced by get_bit(), out(), and out1().


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