60 logexp_table = construct_logexp_table();
63 ivec LLR_calc_unit::construct_logexp_table()
66 for (
int i = 0; i < Dint2; i++) {
67 double x =
pow2(static_cast<double>(Dint3 - Dint1)) * i;
70 it_assert(
length(result) == Dint2,
"Ldpc_codec::construct_logexp_table()");
79 for (
int i = 0; i < n; i++) {
89 for (
int i = 0; i < n; i++) {
100 for (
int i = 0; i < m; i++) {
101 for (
int j = 0; j < n; j++) {
102 result.set(i, j,
to_qllr(l(i, j)));
113 for (
int i = 0; i < m; i++) {
114 for (
int j = 0; j < n; j++) {
125 QLLR a_abs = (a > 0 ? a : -a);
126 QLLR b_abs = (b > 0 ? b : -b);
127 QLLR minabs = (a_abs > b_abs ? b_abs : a_abs);
128 QLLR term1 = (a > 0 ? (b > 0 ? minabs : -minabs)
129 : (b > 0 ? -minabs : minabs));
148 QLLR result = term1 + term2 - term3;
164 os <<
"---------- LLR calculation unit -----------------" << std::endl;
165 os <<
"LLR_calc_unit table properties:" << std::endl;
166 os <<
"The granularity in the LLR representation is " 167 <<
pow2(static_cast<double>(-lcu.Dint1)) << std::endl;
168 os <<
"The LLR scale factor is " << (1 << lcu.Dint1) << std::endl;
169 os <<
"The largest LLR that can be represented is " 171 os <<
"The table resolution is " 172 <<
pow2(static_cast<double>(lcu.Dint3 - lcu.Dint1)) << std::endl;
173 os <<
"The number of entries in the table is " << lcu.Dint2 << std::endl;
174 os <<
"The tables truncates at the LLR value " 175 <<
pow2(static_cast<double>(lcu.Dint3 - lcu.Dint1)) * lcu.Dint2
177 os <<
"-------------------------------------------------" << std::endl;
QLLR Boxplus(QLLR a, QLLR b) const
Hagenauer's "Boxplus" operator.
LLR_calc_unit()
Constructor, using the default table resolution.
std::ostream & operator<<(std::ostream &output, const bin &inbin)
Output stream of bin.
QLLR to_qllr(double l) const
Convert a "real" LLR value to an LLR type.
#define it_assert(t, s)
Abort if t is not true.
int length(const Vec< T > &v)
Length of vector.
double to_double(QLLR l) const
Convert an LLR type to a "real" LLR.
vec log(const vec &x)
The natural logarithm of the elements.
int cols() const
The number of columns.
#define it_info_debug(s)
Print information message if NDEBUG is not defined.
ivec get_Dint()
Retrieve the table resolution values.
vec exp(const vec &x)
Exp of the elements of a vector x.
double pow2(double x)
Calculate two to the power of x (2^x)
Class for numerically efficient log-likelihood algebra.
Log-likelihood algebra calculation unit.
int rows() const
The number of rows.
void init_llr_tables(short int Dint1=12, short int Dint2=300, short int Dint3=7)
Set the quantization and table parameters.
QLLR logexp(QLLR x) const
Logexp operator.