fun_ofdm
1.0
802.11a Physical Layer for USRP
|
The viterbi class. More...
#include <viterbi.h>
Public Member Functions | |
void | conv_decode (unsigned char *symbols, unsigned char *data, int data_bits) |
Decodes convolutionally encoded data using the viterbi algorithm. More... | |
void | conv_encode (unsigned char *data, unsigned char *symbols, int data_bits) |
Convolutionally encodeds data. More... | |
Private Member Functions | |
COMPUTETYPE Branchtab[NUMSTATES/2 *RATE] | __attribute__ ((aligned(16))) |
void | viterbi_chainback (struct v *vp, unsigned char *data, unsigned int nbits, unsigned int endstate) |
void | FULL_SPIRAL (int nbits, unsigned char *Y, unsigned char *X, const unsigned char *syms, unsigned char *dec, unsigned char *Branchtab) |
viterbi::FULL_SPIRAL More... | |
struct v * | viterbi_alloc (int len) |
Create a new instance of a Viterbi decoder. More... | |
void | viterbi_free (struct v *vp) |
Destroy instance of a Viterbi decoder. More... | |
void | viterbi_init (struct v *vp, int starting_state) |
Initialize decoder for start of new frame. More... | |
void | viterbi_decode (struct v *vp, const COMPUTETYPE *symbols, unsigned char *data, int nbits) |
Decode one frame worth of data. More... | |
void | viterbi_update_blk_SPIRAL (struct v *vp, const COMPUTETYPE *syms, int nbits) |
set the viterbi decoder to use a specific implementation More... | |
|
private |
void fun::viterbi::conv_decode | ( | unsigned char * | symbols, |
unsigned char * | data, | ||
int | data_bits | ||
) |
Decodes convolutionally encoded data using the viterbi algorithm.
symbols | Coded symbols that need to be decoded. |
data | Output data that has been decoded. |
data_bits | Number of data bits that that should be left after decoding |
Main decode function.
Definition at line 31 of file viterbi.cpp.
References viterbi_alloc(), viterbi_decode(), viterbi_free(), and viterbi_init().
Referenced by fun::ppdu::decode_data(), and fun::ppdu::decode_header().
void fun::viterbi::conv_encode | ( | unsigned char * | data, |
unsigned char * | symbols, | ||
int | data_bits | ||
) |
Convolutionally encodeds data.
data | The data to be coded. |
symbols | The coded output symbols. |
data_bits | The number of bits in the data input. |
Definition at line 39 of file viterbi.cpp.
References K, fun::parity(), POLYS, and RATE.
Referenced by fun::ppdu::encode_data(), and fun::ppdu::encoder_header().
|
private |
nbits | |
Y | |
X | |
syms | |
dec | |
Branchtab |
Definition at line 208 of file viterbi.cpp.
Referenced by viterbi_update_blk_SPIRAL().
|
private |
Create a new instance of a Viterbi decoder.
len | = FRAMEBITS (unpadded! data bits) |
Definition at line 81 of file viterbi.cpp.
References fun::v::decisions, K, NUMSTATES, fun::parity(), POLYS, RATE, and viterbi_init().
Referenced by conv_decode().
|
private |
Definition at line 108 of file viterbi.cpp.
References ADDSHIFT, fun::v::decisions, K, NUMSTATES, SUBSHIFT, and fun::decision_t::w.
Referenced by viterbi_decode().
|
private |
Decode one frame worth of data.
vp | Pointer to v struct used to store parameters and help with decoding |
symbols | Input symbol to be decoded |
data | Output data that has been decoded |
NOTE: nbits has to match what was passed to viterbi_alloc(...) FIXME: store nbits in struct v?
vp | |
symbols | |
data | |
nbits |
Definition at line 166 of file viterbi.cpp.
References K, viterbi_chainback(), viterbi_init(), and viterbi_update_blk_SPIRAL().
Referenced by conv_decode().
|
private |
Destroy instance of a Viterbi decoder.
Delete instance of a Viterbi decoder.
vp | pointer to the v struct to free |
vp |
Definition at line 152 of file viterbi.cpp.
References fun::v::decisions.
Referenced by conv_decode().
|
private |
Initialize decoder for start of new frame.
vp | pointer to v struct to initialize for decoding. |
starting_state | Initial state for viterbi decoder |
vp | |
starting_state |
Definition at line 71 of file viterbi.cpp.
References fun::v::new_metrics, NUMSTATES, fun::v::old_metrics, and fun::metric_t::t.
Referenced by conv_decode(), viterbi_alloc(), and viterbi_decode().
|
private |
set the viterbi decoder to use a specific implementation
viterbi::viterbi_update_blk_SPIRAL
vp | |
syms | |
nbits |
Definition at line 190 of file viterbi.cpp.
References fun::v::decisions, FULL_SPIRAL(), fun::v::new_metrics, fun::v::old_metrics, fun::decision_t::t, and fun::metric_t::t.
Referenced by viterbi_decode().