#include <itpp/comm/rec_syst_conv_code.h>
The main purpose of this class is to be used by the Turbo_Codec class which uses two recursive systematic convolutional encoders. It can however be used as a stand alone class. The map_decode member function implementation follows the paper "A Turbo Code Tutorial" by William E. Ryan, New Mexico State University. This paper was found on the web and is probably unpublished.
Definition at line 51 of file rec_syst_conv_code.h.
Public Member Functions | |
Rec_Syst_Conv_Code () | |
Class constructor. | |
virtual | ~Rec_Syst_Conv_Code () |
Class constructor. | |
void | set_generator_polynomials (const ivec &gen, int constraint_length) |
Set generator polynomials. | |
void | set_awgn_channel_parameters (double Ec, double N0) |
Sets the channel parameters needed for MAP-decoding. | |
void | set_scaling_factor (double in_Lc) |
Set scaling factor for the decoder. | |
void | set_llrcalc (LLR_calc_unit in_llrcalc) |
Set the lookup table for algebra with quantized LLR values (see LLR_calc_unit class). | |
void | encode_tail (const bvec &input, bvec &tail, bmat &parity_bits) |
Encode a binary vector of inputs and also adds a tail of K-1 zeros to force the encoder into the zero state. | |
void | encode (const bvec &input, bmat &parity_bits) |
Encode a binary vector of inputs starting from zero state without adding of a tail. | |
virtual void | map_decode (const vec &rec_systematic, const mat &rec_parity, const vec &extrinsic_input, vec &extrinsic_output, bool set_terminated=false) |
Maximum A Posteriori (MAP) Probability symbol-by-symbol decoder. | |
virtual void | log_decode (const vec &rec_systematic, const mat &rec_parity, const vec &extrinsic_input, vec &extrinsic_output, bool set_terminated=false, std::string metric="LOGMAX") |
Log domain implementation of the Maximum A Posteriori (MAP) Probability symbol-by-symbol decoder. | |
virtual void | log_decode_n2 (const vec &rec_systematic, const vec &rec_parity, const vec &extrinsic_input, vec &extrinsic_output, bool set_terminated=false, std::string metric="LOGMAX") |
Special Log-MAP/Log-MAX decoder implementation for n = 2. | |
virtual void | log_decode (const QLLRvec &rec_systematic, const QLLRmat &rec_parity, const QLLRvec &extrinsic_input, QLLRvec &extrinsic_output, bool set_terminated=false) |
Implementation of the log-map decoder using quantized LLR values (the QLLR type) and table-lookup (using the LLR_calc_unit class). | |
virtual void | log_decode_n2 (const QLLRvec &rec_systematic, const QLLRvec &rec_parity, const QLLRvec &extrinsic_input, QLLRvec &extrinsic_output, bool set_terminated=false) |
Implementation of the log-map decoder for the n=2 case using quantized LLR values (the QLLR type) and table-lookup (using the LLR_calc_unit class). |
void itpp::Rec_Syst_Conv_Code::set_generator_polynomials | ( | const ivec & | gen, | |
int | constraint_length | |||
) |
Set generator polynomials.
The generator polynomials are given in Proakis integer form. First generator (gen(0)) is the recursive polynomial.
gen | A vector containing the generator polynomials of the RSC Code. | |
constraint_length | The Constraint length of the encoder. |
Definition at line 68 of file rec_syst_conv_code.cpp.
References itpp::log(), and itpp::reverse_int().
Referenced by itpp::Turbo_Codec::set_parameters().
void itpp::Rec_Syst_Conv_Code::set_awgn_channel_parameters | ( | double | Ec, | |
double | N0 | |||
) |
Sets the channel parameters needed for MAP-decoding.
Ec | is the energy per channel symbol | |
N0 | is the single-sided power spectral density of the AWGN on the channel. |
Definition at line 113 of file rec_syst_conv_code.cpp.
References itpp::sqrt().
void itpp::Rec_Syst_Conv_Code::set_scaling_factor | ( | double | in_Lc | ) |
Set scaling factor for the decoder.
in_Lc | is the channel reliability factor (i.e. Lc = 4 x sqrt( Ec ) / N0) |
Definition at line 118 of file rec_syst_conv_code.cpp.
void itpp::Rec_Syst_Conv_Code::encode_tail | ( | const bvec & | input, | |
bvec & | tail, | |||
bmat & | parity_bits | |||
) |
Encode a binary vector of inputs and also adds a tail of K-1 zeros to force the encoder into the zero state.
The encoder remembers that the trellis is terminated in the zero state at the end of the input block. This is then utilized by the decoder when going through the trellis in the reverse direction. The tailbits used are returned in tail. Parity bits for both the input part and the tail part of the data are returned in the matrix parity bits.
Definition at line 123 of file rec_syst_conv_code.cpp.
References itpp::length().
Referenced by itpp::Turbo_Codec::encode_block().
void itpp::Rec_Syst_Conv_Code::map_decode | ( | const vec & | rec_systematic, | |
const mat & | rec_parity, | |||
const vec & | extrinsic_input, | |||
vec & | extrinsic_output, | |||
bool | set_terminated = false | |||
) | [virtual] |
Maximum A Posteriori (MAP) Probability symbol-by-symbol decoder.
The extrinsic_input is the a priori information on each systematic bit. If no a priori information is available, this vector should contain only zeros. The extrinsic_output term may be passed to a subsequent decoder in a Turbo scheme. The decision variable is
L = Lc*rec_systematic + extrinsic_output + extrinsic_input
Lc = 4*sqrt(Ec)/N0
rec_systematic | Including both systematic bits and tail bits (if any) | |
rec_parity | Matrix including all parity bits from all polynomials as well as parity bits from the tail (if terminated) | |
extrinsic_input | For all systematic bits | |
extrinsic_output | For all systematic bits | |
set_terminated | Equal to true if the trellis was terminated by the encoder and false otherwise |
Definition at line 164 of file rec_syst_conv_code.cpp.
References itpp::trunc_exp(), itpp::trunc_log(), and itpp::zeros().
Referenced by itpp::Turbo_Codec::decode_block().
void itpp::Rec_Syst_Conv_Code::log_decode | ( | const vec & | rec_systematic, | |
const mat & | rec_parity, | |||
const vec & | extrinsic_input, | |||
vec & | extrinsic_output, | |||
bool | set_terminated = false , |
|||
std::string | metric = "LOGMAX" | |||
) | [virtual] |
Log domain implementation of the Maximum A Posteriori (MAP) Probability symbol-by-symbol decoder.
The extrinsic_input is the a priori information on each systematic bit. If no a priori information is available, this vector should contain only zeros. The extrinsic_output term may be passed to a subsequent decoder in a Turbo scheme. The decision variable is
L = Lc*rec_systematic + extrinsic_output + extrinsic_input
Lc = 4*sqrt(Ec)/N0
rec_systematic | Including both systematic bits and tail bits (if any) | |
rec_parity | Matrix including all parity bits from all polynomials as well as parity bits from the tail (if terminated) | |
extrinsic_input | For all systematic bits | |
extrinsic_output | For all systematic bits | |
set_terminated | Equal to true if the trellis was terminated by the encoder and false otherwise | |
metric | May be "LOGMAP", "LOGMAX" (default), or "TABLE" |
Definition at line 278 of file rec_syst_conv_code.cpp.
References it_assert, it_error, itpp::length(), itpp::log_add(), itpp::max(), itpp::LLR_calc_unit::to_double(), and itpp::LLR_calc_unit::to_qllr().
Referenced by itpp::Turbo_Codec::decode_block().
void itpp::Rec_Syst_Conv_Code::log_decode_n2 | ( | const vec & | rec_systematic, | |
const vec & | rec_parity, | |||
const vec & | extrinsic_input, | |||
vec & | extrinsic_output, | |||
bool | set_terminated = false , |
|||
std::string | metric = "LOGMAX" | |||
) | [virtual] |
Special Log-MAP/Log-MAX decoder implementation for n = 2.
rec_systematic | Including both systematic bits and tail bits (if any) | |
rec_parity | Matrix including all parity bits from all polynomials as well as parity bits from the tail (if terminated) | |
extrinsic_input | For all systematic bits | |
extrinsic_output | For all systematic bits | |
set_terminated | Equal to true if the trellis was terminated by the encoder and false otherwise | |
metric | May be "LOGMAP", "LOGMAX" (default), or "TABLE" |
Definition at line 394 of file rec_syst_conv_code.cpp.
References it_assert, it_error, itpp::length(), itpp::log_add(), itpp::max(), itpp::norm(), itpp::LLR_calc_unit::to_double(), and itpp::LLR_calc_unit::to_qllr().
void itpp::Rec_Syst_Conv_Code::log_decode | ( | const QLLRvec & | rec_systematic, | |
const QLLRmat & | rec_parity, | |||
const QLLRvec & | extrinsic_input, | |||
QLLRvec & | extrinsic_output, | |||
bool | set_terminated = false | |||
) | [virtual] |
Implementation of the log-map decoder using quantized LLR values (the QLLR
type) and table-lookup (using the LLR_calc_unit
class).
rec_systematic | Including both systematic bits and tail bits (if any) | |
rec_parity | Matrix including all parity bits from all polynomials as well as parity bits from the tail (if terminated) | |
extrinsic_input | For all systematic bits | |
extrinsic_output | For all systematic bits | |
set_terminated | Equal to true if the trellis was terminated by the encoder and false otherwise |
Definition at line 501 of file rec_syst_conv_code.cpp.
References it_assert, and itpp::LLR_calc_unit::jaclog().
void itpp::Rec_Syst_Conv_Code::log_decode_n2 | ( | const QLLRvec & | rec_systematic, | |
const QLLRvec & | rec_parity, | |||
const QLLRvec & | extrinsic_input, | |||
QLLRvec & | extrinsic_output, | |||
bool | set_terminated = false | |||
) | [virtual] |
Implementation of the log-map decoder for the n=2 case using quantized LLR values (the QLLR
type) and table-lookup (using the LLR_calc_unit
class).
rec_systematic | Including both systematic bits and tail bits (if any) | |
rec_parity | Matrix including all parity bits from all polynomials as well as parity bits from the tail (if terminated) | |
extrinsic_input | For all systematic bits | |
extrinsic_output | For all systematic bits | |
set_terminated | Equal to true if the trellis was terminated by the encoder and false otherwise |
Definition at line 606 of file rec_syst_conv_code.cpp.
References it_assert, itpp::LLR_calc_unit::jaclog(), and itpp::norm().
Generated on Sun Dec 9 17:26:23 2007 for IT++ by Doxygen 1.5.4