itpp::LLR_calc_unit Class Reference

Log-likelihood algebra calculation unit. More...

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

## Public Member Functions

| LLR_calc_unit ()
| Constructor, using the default table resolution.
| LLR_calc_unit (short int Dint1, short int Dint2, short int Dint3)
| Constructor, using a specific table resolution.
void | init_llr_tables (short int Dint1=12, short int Dint2=300, short int Dint3=7)
| Set the quantization and table parameters.
QLLR | to_qllr (double l) const
| Convert a "real" LLR value to an LLR type.
QLLRvec | to_qllr (const vec &l) const
| Convert a vector of "real" LLR values to an LLR type.
QLLRmat | to_qllr (const mat &l) const
| Convert a matrix of "real" LLR values to an LLR type.
double | to_double (QLLR l) const
| Convert an LLR type to a "real" LLR.
vec | to_double (const QLLRvec &l) const
| Convert a vector of LLR types to a "real" LLR.
mat | to_double (const QLLRmat &l) const
| Convert a matrix of LLR types to a "real" LLR.
QLLR | jaclog (QLLR a, QLLR b) const
| Jacobian logarithm.
QLLR | Boxplus (QLLR a, QLLR b) const
| Hagenauer's "Boxplus" operator.
QLLR | logexp (QLLR x) const
| Logexp operator.
ivec | get_Dint ()
| Retrieve the table resolution values.

## Friends

ITPP_EXPORT std::ostream & | operator<< (std::ostream &os, const LLR_calc_unit &l)
| Print some properties of the LLR calculation unit in plain text.

## Related Symbols

(Note that these are not member symbols.)
typedef signed int | QLLR
typedef Vec< QLLR > | QLLRvec
typedef Mat< QLLR > | QLLRmat
const QLLR | QLLR_MAX = (std::numeric_limits<QLLR>::max() >> 4)
ITPP_EXPORT std::ostream & | operator<< (std::ostream &os, const LLR_calc_unit &lcu)
| Print some properties of the LLR calculation unit in plain text.

## Detailed Description

Log-likelihood algebra calculation unit.

This class contains functions for algebra with log-likelihood ratios (LLRs). The class is mainly useful for modules that rely on certain nonlinear operations on LLRs (e.g. boxplus for LDPC and turbo decoding and Jacobian logarithm for soft demodulation). The routines provided are numerically efficient and use only integer arithmetics. Additionally, they allow for arbitrary quantization of LLRs in order to study effects of limited precision (fixed point number representations). As a consequence, computations are approximate. With the standard settings, the numerical precision should be sufficient (and practically equivalent to floating point precision) for all practical applications. However, one can construct cases where small numerical artifacts due to quantization effects (e.g., soft demodulation with very high or very low SNR) can be observed.

An LLR for an information bit b is defined according to

and it is in general a real number. LLR values are represented via the special type, "quantized LLR" (QLLR). The relation between the quantized representation and the real (floating-point) LLR value is

The user parameter Dint1 determines the granularity of the quantization, and it can be set arbitrarily. The functions to_double() and to_qllr() can be used to perform conversions between the two representations (QLLR to floating-point, and vice versa).

The class provides functions for the computation of the Jacobian logarithm and Hagenauer's "boxplus" operator. These functions are based on a table-lookup. The resolution of the table is determined by the parameters Dint2 and Dint3. See the class constructor for more detail. When an object of LLR_calc_unit is created, corresponding lookup-tables are also generated. The resolution of these tables can be adjusted by providing parameters to the constructor.

The variable table resolution allows one to study complexity versus accuracy (i.e., how different table resolutions would degrade performance) to some extent. Yet the main purpose of the QLLR representation is to provide a tool for writing efficient simulation code, rather than to provide for bit-level (fixed-point) simulations. For bit-level simulations, a true fixed point representation of LLRs would be preferred/required. With the default setting of the table parameters, using the QLLR type is practically as accurate (but much faster) as using "double" to represent LLRs. Decoder implementations may then provide functions using QLLR, fixed-point, or double (for compatibility reasons) representations of LLR values.

Note: the QLLR type does not check that the correct quantization level is used. I.e., in theory it would be possible to add two QLLR types with different quantization (Dint) parameters. This is intentionally implemented this way to achieve maximum runtime efficiency.

Definition at line 124 of file llr.h.

## Constructor & Destructor Documentation

## LLR_calc_unit() [1/2]

itpp::LLR_calc_unit::LLR_calc_unit | ( |  | ) |

Constructor, using the default table resolution.

Definition at line 36 of file llr.cpp.

References init_llr_tables().

## LLR_calc_unit() [2/2]

itpp::LLR_calc_unit::LLR_calc_unit | ( | short int | Dint1,
|  | short int | Dint2,
|  | short int | Dint3
| ) |  |

Constructor, using a specific table resolution.

See init_llr_tables() for more details on the parameters.

Definition at line 41 of file llr.cpp.

References init_llr_tables().

## Member Function Documentation

## init_llr_tables()

void itpp::LLR_calc_unit::init_llr_tables | ( | short int | Dint1 = `12`,
|  | short int | Dint2 = `300`,
|  | short int | Dint3 = `7`
| ) |  |

Set the quantization and table parameters.

Parameters

  Dint1 | Determines the relation between LLR represented as real number and as integer. The relation is
  Dint2 | Number of entries in the table. If this is zero, then logmap becomes logmax.
  Dint3 | Determines the table resolution. The spacing between each entry is

The default parameter values are chosen to give a performance practically indistinguishable from that of using floating point calculations.

Example: (recommended settings with "exact" computation via high resolution lookup table)

LLR_calc_unit lcalc(12, 300, 7);
itpp::Array
General array class.
Definition array.h:105
itpp::LLR_calc_unit
Log-likelihood algebra calculation unit.
Definition llr.h:125

Example: (recommended settings with logmax, i.e. no table lookup)

LLR_calc_unit lcalc(12, 0, 7);

Definition at line 55 of file llr.cpp.

Referenced by LLR_calc_unit(), and LLR_calc_unit().

## to_qllr() [1/3]

QLLR itpp::LLR_calc_unit::to_qllr | ( | double | l | ) | const

inline

Convert a "real" LLR value to an LLR type.

Definition at line 245 of file llr.h.

References it_info_debug, QLLR_MAX, and to_double().

Referenced by itpp::LDPC_Code::decode(), itpp::LDPC_Code::decode_soft_out(), itpp::Modulator_NCD::demodulate_soft_bits(), itpp::Modulator_NRD::demodulate_soft_bits(), itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), to_qllr(), to_qllr(), and itpp::Modulator_NRD::yxnormupdate().

## to_qllr() [2/3]

QLLRvec itpp::LLR_calc_unit::to_qllr | ( | const vec & | l | ) | const

Convert a vector of "real" LLR values to an LLR type.

Definition at line 75 of file llr.cpp.

References itpp::length(), and to_qllr().

## to_qllr() [3/3]

QLLRmat itpp::LLR_calc_unit::to_qllr | ( | const mat & | l | ) | const

Convert a matrix of "real" LLR values to an LLR type.

Definition at line 95 of file llr.cpp.

References itpp::Mat< Num_T >::rows(), and to_qllr().

## to_double() [1/3]

double itpp::LLR_calc_unit::to_double | ( | QLLR | l | ) | const

inline

Convert an LLR type to a "real" LLR.

Definition at line 240 of file llr.h.

Referenced by itpp::LDPC_Code::decode_soft_out(), itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), to_double(), to_double(), and to_qllr().

## to_double() [2/3]

vec itpp::LLR_calc_unit::to_double | ( | const QLLRvec & | l | ) | const

Convert a vector of LLR types to a "real" LLR.

Definition at line 85 of file llr.cpp.

References itpp::length(), and to_double().

## to_double() [3/3]

mat itpp::LLR_calc_unit::to_double | ( | const QLLRmat & | l | ) | const

Convert a matrix of LLR types to a "real" LLR.

Definition at line 108 of file llr.cpp.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::rows(), and to_double().

## jaclog()

QLLR itpp::LLR_calc_unit::jaclog | ( | QLLR | a,
|  | QLLR | b
| ) |  | const

inline

Jacobian logarithm.

This function computes

Definition at line 280 of file llr.h.

References logexp(), and QLLR_MAX.

Referenced by itpp::Modulator_ND::demodllrbit0(), itpp::Modulator_ND::demodllrbit1(), itpp::Modulator_ND::demodllrbit2(), itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), itpp::Modulator_ND::marginalize_bits(), itpp::Modulator_ND::probabilities(), itpp::Modulator_ND::update_LLR(), and itpp::Modulator_ND::update_LLR().

## Boxplus()

QLLR itpp::LLR_calc_unit::Boxplus | ( | QLLR | a,
|  | QLLR | b
| ) |  | const

Hagenauer's "Boxplus" operator.

This function computes:

where

Definition at line 123 of file llr.cpp.

References it_info_debug, logexp(), and QLLR_MAX.

Referenced by itpp::LDPC_Code::bp_decode(), and itpp::LDPC_Code::soft_syndrome_check().

## logexp()

QLLR itpp::LLR_calc_unit::logexp | ( | QLLR | x | ) | const

inline

Logexp operator.

This function computes

Definition at line 261 of file llr.h.

References it_assert_debug.

Referenced by Boxplus(), and jaclog().

## get_Dint()

ivec itpp::LLR_calc_unit::get_Dint | ( |  | ) |

Retrieve the table resolution values.

Definition at line 46 of file llr.cpp.

## Friends And Related Symbol Documentation

## QLLR

typedef signed int QLLR

related

The quantized log-likelihood ratio (QLLR) representation, scalar form. See `LLR_calc_unit`.

Definition at line 46 of file llr.h.

## QLLRvec

typedef Vec<QLLR> QLLRvec

related

The quantized log-likelihood ratio (QLLR) representation, vector form. See `LLR_calc_unit`.

Definition at line 51 of file llr.h.

## QLLRmat

typedef Mat<QLLR> QLLRmat

related

The quantized log-likelihood ratio (QLLR) representation, matrix form. See `LLR_calc_unit`.

Definition at line 56 of file llr.h.

## QLLR_MAX

const QLLR QLLR_MAX = (std::numeric_limits<QLLR>::max() >> 4)

related

The largest possible QLLR value

Definition at line 61 of file llr.h.

Referenced by Boxplus(), jaclog(), and to_qllr().

## operator<< [1/2]

ITPP_EXPORT std::ostream & operator<< | ( | std::ostream & | os,
|  | const LLR_calc_unit & | l
| ) |  |

friend

Print some properties of the LLR calculation unit in plain text.

Definition at line 162 of file llr.cpp.

## operator<<() [2/2]

ITPP_EXPORT std::ostream & operator<< | ( | std::ostream & | os,
|  | const LLR_calc_unit & | lcu
| ) |  |

related

Print some properties of the LLR calculation unit in plain text.

Definition at line 162 of file llr.cpp.

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

- itpp/comm/llr.h
- itpp/comm/llr.cpp

Generated on Mon Jun 10 2024 11:49:37 for IT++ by Doxygen 1.9.8