IT++ Logo
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Related Functions | List of all members
itpp::ND_UQAM Class Reference

Complex MIMO channel with uniform QAM per dimension. More...

#include <itpp/comm/modulator_nd.h>

Inheritance diagram for itpp::ND_UQAM:
itpp::Modulator_NCD itpp::Modulator_ND

Public Types

enum  Soft_Demod_Method { FULL_ENUM_LOGMAP, FULL_ENUM_MAXLOG, ZF_LOGMAP }
 Soft demodulation method. More...
 

Public Member Functions

 ND_UQAM (int nt=1, int Mary=4)
 Constructor.
 
virtual ~ND_UQAM ()
 Destructor.
 
void set_M (int nt=1, int Mary=4)
 Set component modulators to M-QAM with Gray mapping.
 
void set_M (int nt=1, ivec Mary="4")
 Set component modulators to M-QAM with Gray mapping, different M per component.
 
void set_constellation_points (const int nth, const cvec &inConstellation, const ivec &in_bit2symbols)
 Set the constellation points.
 
Array< cvec > get_symbols () const
 Get modulation symbols per dimension.
 
void modulate_bits (const bvec &bits, cvec &symbols) const
 Modulate bits into symbols.
 
cvec modulate_bits (const bvec &bits) const
 Modulation of bits.
 
void init_soft_demodulator (const itpp::cmat &H, const double &sigma2)
 Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation points.
 
void demodulate_soft_bits (const cvec &y, const QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori, Soft_Demod_Method method=FULL_ENUM_LOGMAP)
 Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation points.
 
void demodulate_soft_bits (const cvec &y, const cmat &H, double sigma2, const QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori, Soft_Demod_Method method=FULL_ENUM_LOGMAP)
 Soft demodulation wrapper function for various methods.
 
QLLRvec demodulate_soft_bits (const cvec &y, const cmat &H, double sigma2, const QLLRvec &LLR_apriori, Soft_Demod_Method method=FULL_ENUM_LOGMAP)
 Soft demodulation wrapper function for various methods.
 
void demodulate_soft_bits (const cvec &y, const cvec &h, double sigma2, const QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori)
 Soft MAP demodulation for parallelchannels without crosstalk.
 
void set_llrcalc (LLR_calc_unit llrcalc_in)
 Set LLR calculation unit.
 
LLR_calc_unit get_llrcalc () const
 Get LLR calculation unit.
 
int get_dim () const
 Get number of dimensions.
 
ivec get_k () const
 Get number of bits per modulation symbol per dimension.
 
ivec bits_per_symbol () const
 Get number of bits per modulation symbol per dimension.
 
ivec get_M () const
 Get number of modulation symbols per dimension.
 
Array< ivec > get_bits2symbols () const
 Get bit pattern in decimal.
 
Array< bmatget_bitmap () const
 Get Bit mapping table.
 

Protected Member Functions

void hxnormupdate (itpp::cvec &Hx, unsigned &bitstring, unsigned &ind, unsigned bit)
 
void yxnormupdate (double &yx, itpp::QLLR &lapr, unsigned &bitstring, unsigned &ind, unsigned bit)
 
QLLRvec probabilities (QLLR l)
 Convert LLR to log-probabilities.
 
Array< QLLRvec > probabilities (const QLLRvec &l)
 Convert LLR to log-probabilities, vector version.
 
void marginalize_bits (itpp::QLLRvec &llr, Soft_Demod_Method method) const
 Marginalize (sum) over the bits.
 
void demodllrbit0 (itpp::QLLR &llr) const
 Hardcoded implementation of 1:st bit demodulation.
 
void demodllrbit1 (itpp::QLLR &llr) const
 Hardcoded implementation of 2:nd bit demodulation.
 
void demodllrbit2 (itpp::QLLR &llr) const
 Hardcoded implementation of 3:rd bit demodulation.
 
void demodmaxbit0 (itpp::QLLR &maxllr) const
 Hardcoded implementation of 1:st bit demodulation.
 
void demodmaxbit1 (itpp::QLLR &maxllr) const
 Hardcoded implementation of 2:nd bit demodulation.
 
void demodmaxbit2 (itpp::QLLR &maxllr) const
 Hardcoded implementation of 3:rd bit demodulation.
 
void update_LLR (const Array< QLLRvec > &logP_apriori, const ivec &s, QLLR scaled_norm, QLLRvec &num, QLLRvec &denom)
 Update LLR (for internal use)
 
void update_LLR (const Array< QLLRvec > &logP_apriori, int s, QLLR scaled_norm, int j, QLLRvec &num, QLLRvec &denom)
 Update LLR, for scalar channel (for internal use)
 

Protected Attributes

ivec L
 the square root of M
 
Array< cvec > symbols
 Vectors of modulation symbols (along each dimension)
 
itpp::cmat H
 Complex-valued channel matrix.
 
itpp::Array< itpp::Array
< itpp::cvec > > 
hspacings
 The spacing between different constellation points multiplied by the different H columns.
 
itpp::Array< itpp::vec > yspacings
 The spacing between different constellation points scaled by different y elements.
 
int nt
 Number of dimensions.
 
int nb
 Number of bits in the symbol vector.
 
LLR_calc_unit llrcalc
 LLR calculation unit.
 
ivec k
 Number of bits per modulation symbol.
 
ivec M
 Number of modulation symbols along each dimension.
 
bool demod_initialized
 Flag indicating whether the demodulator has been initialized.
 
Array< bmatbitmap
 Bit mapping table (one table per dimension)
 
Array< ivec > bits2symbols
 Bit pattern in decimal form ordered and the corresponding symbols (one pattern per dimension)
 
double gaussnorm
 The normalization factor in the exponent (in front of the square norm) in the Gaussian distribution.
 
itpp::vec hnorms
 Norms part dependent on H.
 
itpp::QLLRvec Qnorms
 Norms part depending on both H and y.
 
itpp::QLLRvec llrapr
 A prioi information.
 
itpp::ivec bpos2cpos
 The bit to column mapping.
 
itpp::ivec bitcumsum
 The cumulative sum of bits in the symbol vector.
 
itpp::Array< itpp::Vec
< unsigned > > 
gray2dec
 The Gray to decimal mapping.
 

Related Functions

(Note that these are not member functions.)

ITPP_EXPORT std::ostream & operator<< (std::ostream &os, const Modulator_NCD &m)
 Print some properties of the MIMO modulator (mainly to aid debugging)
 

Detailed Description

Complex MIMO channel with uniform QAM per dimension.

Note
For issues relating to the accuracy of LLR computations, please see the documentation of LLR_calc_unit

Definition at line 720 of file modulator_nd.h.

Member Enumeration Documentation

Soft demodulation method.

Enumerator:
FULL_ENUM_LOGMAP 

Log-MAP demodulation by "brute-force" enumeration of all points.

FULL_ENUM_MAXLOG 

Max-Log demodulation by "brute-force" enumeration of all points.

ZF_LOGMAP 

Zero-Forcing Log-MAP approximated demodulation.

Definition at line 67 of file modulator_nd.h.

Member Function Documentation

void itpp::ND_UQAM::set_constellation_points ( const int  nth,
const cvec &  inConstellation,
const ivec &  in_bit2symbols 
)

Set the constellation points.

Parameters
[in]nth- number of antenna
[in]inConstellation- new constellation points
[in]vectorof mapping transmitted data symbols (index in the vector) to constellation points (value in the vector).

Example of use:

ND_UQAM qam(1,16); //QAM-16 with Gray mapping
//now set the new Gray mapping (a little bit different than hardcoded in it++).
qam.set_constellation_points(1, qam.get_symbols()(0), "0 1 5 4 2 3 7 6 10 11 15 14 8 9 13 12");
bvec bits = "0 1 1 0 0 0 1 1 1 1 0 0 1 0 0 1";
cvec modulated_symbols = qam.modulate_bits(bits);

Definition at line 1208 of file modulator_nd.cpp.

References itpp::Modulator_ND::bitmap, itpp::Modulator_ND::bits2symbols, itpp::dec2bin(), itpp::is_even(), it_assert, itpp::Modulator_ND::k, itpp::Modulator_ND::M, and itpp::Modulator_ND::nt.

void itpp::Modulator_NCD::init_soft_demodulator ( const itpp::cmat &  H,
const double &  sigma2 
)
inherited

Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation points.

This function computes the norms

\[\frac{|y - Hs|^2}{2\sigma^2}\]

used to compute the LLR values

\[ LLR(k) = \log \left( \frac {\sum_{s:b_k=0} \exp \left( -\frac{|y - Hs|^2}{2\sigma^2} \right) P(s)} {\sum_{s:b_k=1} \exp \left( -\frac{|y - Hs|^2}{2\sigma^2} \right) P(s)} \right) \]

without approximations. It is assumed that H is real-valued. Complex-valued channels can be handled using the Modulator_NCD class.

Definition at line 731 of file modulator_nd.cpp.

References itpp::Modulator_ND::bitcumsum, itpp::Modulator_ND::bits2symbols, itpp::Modulator_ND::bpos2cpos, itpp::cumsum(), itpp::Modulator_ND::demod_initialized, itpp::Modulator_ND::gaussnorm, itpp::Modulator_ND::gray2dec, itpp::Modulator_ND::hnorms, it_assert_debug, itpp::Modulator_ND::k, itpp::Modulator_ND::M, itpp::Modulator_ND::nb, itpp::Modulator_ND::nt, itpp::pow2i(), itpp::prod(), itpp::Modulator_ND::Qnorms, itpp::reverse(), itpp::Array< T >::set_size(), and itpp::sum().

void itpp::Modulator_NCD::demodulate_soft_bits ( const cvec &  y,
const QLLRvec &  LLR_apriori,
QLLRvec &  LLR_aposteriori,
Soft_Demod_Method  method = FULL_ENUM_LOGMAP 
)
inherited

Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation points.

This function computes the LLR values

\[ LLR(k) = \log \left( \frac {\sum_{s:b_k=0} \exp \left( -\frac{|y - Hs|^2}{2\sigma^2} \right) P(s)} {\sum_{s:b_k=1} \exp \left( -\frac{|y - Hs|^2}{2\sigma^2} \right) P(s)} \right) \]

without approximations. Currently the following two demodulation methods are supported:

  • FULL_ENUM_LOGMAP - exact demodulation, which use "brute-force" enumeration of all constellation points
  • FULL_ENUM_MAXLOG - max-log approximate demodulation, which use "brute-force" enumeration to find the constellation points that give the smallest euclidian distances
Parameters
[in]yReceived vector (typically $N_0/2$)
[in]LLR_aprioriVector of a priori LLR values per bit
[out]LLR_aposterioriVector of a posteriori LLR values
[in]methodSoft demodulation method

The function performs an exhaustive search over all possible points s in the n-dimensional constellation. This is only feasible for relatively small constellations. The Jacobian logarithm is used to compute the sum-exp expression.

void itpp::Modulator_NCD::demodulate_soft_bits ( const cvec &  y,
const cmat &  H,
double  sigma2,
const QLLRvec &  LLR_apriori,
QLLRvec &  LLR_aposteriori,
Soft_Demod_Method  method = FULL_ENUM_LOGMAP 
)
inherited

Soft demodulation wrapper function for various methods.

Soft demodulation wrapper function for various methods

Currently the following three demodulation methods are supported:

  • FULL_ENUM_LOGMAP - exact demodulation, which use "brute-force" enumeration of all constellation points
    • FULL_ENUM_MAXLOG - max-log approximate demodulation, which use "brute-force" enumeration to find the constellation points that give the smallest euclidian distances
  • ZF_LOGMAP - approximated methods with Zero-Forcing preprocessing, which sometimes tends to perform poorly, especially for poorly conditioned H
Parameters
[in]yReceived vector
[in]HChannel matrix
[in]sigma2Noise variance per complex dimension, i.e. the sum of real and imaginary parts (typically $N_0$)
[in]LLR_aprioriVector of a priori LLR values per bit
[out]LLR_aposterioriVector of a posteriori LLR values
[in]methodSoft demodulation method

Definition at line 801 of file modulator_nd.cpp.

References itpp::inv(), it_assert, itpp::Modulator_ND::k, itpp::ones_c(), itpp::real(), itpp::sqrt(), itpp::sum(), itpp::zeros_i(), and itpp::Modulator_ND::ZF_LOGMAP.

QLLRvec itpp::Modulator_NCD::demodulate_soft_bits ( const cvec &  y,
const cmat &  H,
double  sigma2,
const QLLRvec &  LLR_apriori,
Soft_Demod_Method  method = FULL_ENUM_LOGMAP 
)
inherited

Soft demodulation wrapper function for various methods.

Currently the following three demodulation methods are supported:

  • FULL_ENUM_LOGMAP - exact demodulation, which use "brute-force" enumeration of all constellation points
    • FULL_ENUM_MAXLOG - max-log approximate demodulation, which use "brute-force" enumeration to find the constellation points that give the smallest euclidian distances
  • ZF_LOGMAP - approximated methods with Zero-Forcing preprocessing, which sometimes tends to perform poorly, especially for poorly conditioned H
Parameters
[in]yReceived vector
[in]HChannel matrix
[in]sigma2Noise variance per complex dimension, i.e. the sum of real and imaginary parts (typically $N_0$)
[in]LLR_aprioriVector of a priori LLR values per bit
[in]methodSoft demodulation method
Returns
Vector of a posteriori LLR values

Definition at line 831 of file modulator_nd.cpp.

void itpp::Modulator_NCD::demodulate_soft_bits ( const cvec &  y,
const cvec &  h,
double  sigma2,
const QLLRvec &  LLR_apriori,
QLLRvec &  LLR_aposteriori 
)
inherited

Soft MAP demodulation for parallelchannels without crosstalk.

This function is a much faster equivalent to demodulate_soft_bits with $H = \mbox{diag}(h)$. Its complexity is linear in the number of subchannels.

Definition at line 842 of file modulator_nd.cpp.

References it_assert, itpp::Modulator_ND::k, itpp::length(), itpp::Modulator_ND::llrcalc, itpp::Modulator_ND::M, itpp::Modulator_ND::nt, itpp::ones_i(), itpp::Modulator_ND::probabilities(), itpp::sqr(), itpp::sum(), itpp::LLR_calc_unit::to_qllr(), and itpp::Modulator_ND::update_LLR().

void itpp::Modulator_ND::update_LLR ( const Array< QLLRvec > &  logP_apriori,
const ivec &  s,
QLLR  scaled_norm,
QLLRvec &  num,
QLLRvec &  denom 
)
protectedinherited

Update LLR (for internal use)

This function updates the numerator and denominator in the expression

\[ \log \left( \frac {\sum_{s:b_k=0} \exp(-x^2) P(s)} {\sum_{s:b_k=1} \exp(-x^2) P(s)} \right) \]

Parameters
[in]logP_aprioriVector of a priori probabilities per bit
[in]sSymbol vector
[in]scaled_normArgument of the exponents in the above equation
[out]numLogarithm of the numerator in the above expression
[out]denomLogarithm of the denominator in the above expression

Definition at line 94 of file modulator_nd.cpp.

References itpp::Modulator_ND::bitmap, itpp::LLR_calc_unit::jaclog(), itpp::Modulator_ND::k, itpp::Modulator_ND::llrcalc, and itpp::Modulator_ND::nt.

Referenced by itpp::Modulator_NRD::demodulate_soft_bits(), and itpp::Modulator_NCD::demodulate_soft_bits().

void itpp::Modulator_ND::update_LLR ( const Array< QLLRvec > &  logP_apriori,
int  s,
QLLR  scaled_norm,
int  j,
QLLRvec &  num,
QLLRvec &  denom 
)
protectedinherited

Update LLR, for scalar channel (for internal use)

This function updates the numerator and denominator in the expression

\[ \log \left( \frac {\sum_{s:b_k=0} \exp (-x^2) P(s)} {\sum_{s:b_k=1} \exp (-x^2) P(s)} \right) \]

Parameters
[in]logP_aprioriVector of a priori probabilities per bit
[in]sSymbol
[in]scaled_normArgument of the exponents in the above equation
[in]jChannel index (dimension)
[out]numLogarithm of the numerator in the above expression
[out]denomLogarithm of the denominator in the above expression

Definition at line 68 of file modulator_nd.cpp.

References itpp::Modulator_ND::bitmap, itpp::LLR_calc_unit::jaclog(), itpp::Modulator_ND::k, and itpp::Modulator_ND::llrcalc.


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

Generated on Sat Jul 6 2013 10:54:33 for IT++ by Doxygen 1.8.2