itpp::Rec_Syst_Conv_Code Class Reference
Communications Module » Forward Error Correcting Codes

A Recursive Systematic Convolutional Encoder/Decoder class. More...

`#include <itpp/comm/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. More...
void | set_awgn_channel_parameters (double Ec, double N0)
| Sets the channel parameters needed for MAP-decoding. More...
void | set_scaling_factor (double in_Lc)
| Set scaling factor for the decoder. More...
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. More...
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. More...
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. More...
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. More...
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). More...
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). More...
Rec_Syst_Conv_Code & | operator= (const Rec_Syst_Conv_Code &)
| Dummy assignment operator - MSVC++ warning C4512.

## Detailed Description

A Recursive Systematic Convolutional Encoder/Decoder class.

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.

## Member Function Documentation

## set_generator_polynomials()

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.

Parameters

  gen | A vector containing the generator polynomials of the RSC Code.
  constraint_length | The Constraint length of the encoder.

Definition at line 69 of file rec_syst_conv_code.cpp.

References itpp::log(), and itpp::reverse_int().

Referenced by itpp::Turbo_Codec::set_parameters().

## set_awgn_channel_parameters()

void itpp::Rec_Syst_Conv_Code::set_awgn_channel_parameters | ( | double | Ec,
|  | double | N0
| ) |  |

Sets the channel parameters needed for MAP-decoding.

Parameters

  Ec | is the energy per channel symbol
  N0 | is the single-sided power spectral density of the AWGN on the channel.

Definition at line 114 of file rec_syst_conv_code.cpp.

References itpp::sqrt().

## set_scaling_factor()

void itpp::Rec_Syst_Conv_Code::set_scaling_factor | ( | double | in_Lc | ) |

Set scaling factor for the decoder.

Parameters

  in_Lc | is the channel reliability factor (i.e. Lc = 4 x sqrt( Ec ) / N0)

Definition at line 119 of file rec_syst_conv_code.cpp.

## encode_tail()

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 124 of file rec_syst_conv_code.cpp.

References itpp::length().

Referenced by itpp::Turbo_Codec::encode_block().

## map_decode()

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

where

Lc = 4*sqrt(Ec)/N0

Parameters

  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

Note: It is recommended to use the log_decode() decoder instead, as it is much faster and more numerically stable.

Definition at line 166 of file rec_syst_conv_code.cpp.

References itpp::gamma(), itpp::trunc_exp(), itpp::trunc_log(), and itpp::zeros().

Referenced by itpp::Turbo_Codec::decode_block().

## log_decode() [1/2]

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

where

Lc = 4*sqrt(Ec)/N0

Parameters

  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"

Note: Unless LOGMAX decoding is desired, it is recommended to use the TABLE metric instead of LOGMAP as the table-based decoder is much faster and numerically stable.

Definition at line 283 of file rec_syst_conv_code.cpp.

References itpp::com_log, itpp::gamma(), 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().

## log_decode_n2() [1/2]

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.

Parameters

  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"

Note: Unless LOGMAX decoding is desired, it is recommended to use the TABLE metric instead of LOGMAP as the table-based decoder is much faster and numerically stable.

Definition at line 404 of file rec_syst_conv_code.cpp.

References itpp::com_log, itpp::gamma(), 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().

Referenced by itpp::Turbo_Codec::decode_n3().

## log_decode() [2/2]

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).

Parameters

  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 517 of file rec_syst_conv_code.cpp.

References it_assert, and itpp::LLR_calc_unit::jaclog().

## log_decode_n2() [2/2]

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).

Parameters

  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 628 of file rec_syst_conv_code.cpp.

References it_assert, itpp::LLR_calc_unit::jaclog(), and itpp::norm().

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

- itpp/comm/rec_syst_conv_code.h
- itpp/comm/rec_syst_conv_code.cpp

Generated on Sat Sep 30 2017 07:04:09 for IT++ by Doxygen 1.8.13