IT++ Logo Newcom Logo

itpp::ND_UPAM Class Reference

Multidimensional channel with uniform PAM along each dimension. More...

#include <itpp/comm/modulator_nd.h>

Inheritance diagram for itpp::ND_UPAM:

itpp::Modulator_NRD itpp::Modulator_ND List of all members.

Public Member Functions

 ND_UPAM (int nt_in=1, int Mary=2)
 Constructor.
 ~ND_UPAM ()
 Destructor.
void set_Gray_PAM (int nt_in=1, int Mary=2)
 Set component modulators to M-PAM with Gray mapping.
void set_Gray_PAM (int nt_in=1, ivec Mary="2")
 Set component modulators to M-PAM with Gray mapping, different M per component.
int sphere_decoding (vec &y, mat &H, double rmin, double rmax, double stepup, QLLRvec &detected_bits)
 Sphere decoding.
void ZF_demod (QLLRvec &detected_bits, double sigma2, mat &H, vec &y)
 ZF demodulation (NOT IMPLEMENTED YET).
void MMSE_demod (QLLRvec &detected_bits, double sigma2, mat &H, vec &y)
 MMSE demodulation (NOT IMPLEMENTED YET).
Vec< vec > get_symbols ()
 Get modulation symbols per dimension.
vec modulate_bits (const bvec &bits) const
 Modulation of bits.
void map_demod (QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori, double sigma2, mat &H, vec &y)
 Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation points.
void map_demod (QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori, double sigma2, vec &h, vec &y)
 Soft MAP demodulation for parallel channels without crosstalk.
int get_dim ()
 Get number of dimensions.
LLR_calc_unit get_llrcalc () const
 Get LLR calculation unit.
ivec get_k ()
 Get number of bits per modulation symbol.
ivec get_M ()
 Get number of modulation symbols per dimension.

Protected Member Functions

void update_norm (double &norm, int k, int sold, int snew, vec &ytH, mat &HtH, ivec &s)
 For internal use only.
QLLRvec probabilities (QLLR l)
 Convert LLR to log-probabilities.
Vec< QLLRvec > probabilities (QLLRvec &l)
 Convert LLR to log-probabilities, vector version.
void update_LLR (Vec< QLLRvec > &logP_apriori, QLLRvec &numerator, QLLRvec &denominator, ivec &s, QLLR x)
 Update LLR (for internal use).
void update_LLR (Vec< QLLRvec > &logP_apriori, QLLRvec &numerator, QLLRvec &denominator, int s, QLLR scaled_norm, int j)
 Update LLR, for scalar channel (for internal use).

Protected Attributes

Vec< vec > symbols
 Vector of modulation symbols (along each dimension).
int nt
 Number of dimensions.
LLR_calc_unit llrcalc
 LLR calculation unit.
ivec k
 Number of bits per modulation symbol.
ivec M
 Number of modulation symbols along each dimension.
Vec< bmatbitmap
 Bit mapping table (one table per dimension).
Vec< ivec > bits2symbols
 Bit pattern in decimal form ordered and the corresponding symbols (one pattern per dimension).

Friends

std::ostream & operator<< (std::ostream &os, const Modulator_NRD &mod)
 Print some properties of the MIMO modulator in plain text (mainly to aid debugging).

Detailed Description

Multidimensional channel with uniform PAM along each dimension.

Example: (4*3 matrix channel with 4-PAM)

  ND_UPAM chan;            // Multidimensional channel with uniform PAM 
  chan.set_Gray_PAM(3,4);  // 3-dimensional matrix channel, 4-PAM (2 bits) per dimension
  cout << chan << endl;   
  bvec b=randb(3*2);  // 3*2 bits in total    
  vec x=chan.modulate_bits(b); 
  QLLRvec llr = zeros_i(3*2);
  QLLRvec llr_ap = zeros_i(3*2);  // apriori equiprobable bits
  mat H = randn(4,3);      // 4*3 matrix channel
  double sigma2=0.01; // noise variance
  vec y= H*x + sqrt(sigma2)*randn(4); // add noise
  chan.map_demod(llr_ap, llr, sigma2, H, y);
  cout << "True bits:" << b << endl;
  cout << "LLRs:" << chan.get_llrcalc().to_double(llr) << endl;

Example: (scalar channel with 8-PAM)

  ND_UPAM chan;            
  chan.set_Gray_PAM(1,8);  // scalar channel, 8-PAM (3 bits)
  cout << chan << endl;   
  bvec b=randb(3);
  vec x=chan.modulate_bits(b);     
  QLLRvec llr = zeros_i(3);
  QLLRvec llr_ap = zeros_i(3);
  mat H = "1.0";      // scalar channel
  double sigma2=0.01; 
  vec y= H*x + sqrt(sigma2)*randn(1); // add noise
  chan.map_demod(llr_ap, llr, sigma2, H, y);
  cout << "True bits:" << b << endl;
  cout << "LLRs:" << chan.get_llrcalc().to_double(llr) << endl;    

Definition at line 336 of file modulator_nd.h.


Constructor & Destructor Documentation

itpp::ND_UPAM::ND_UPAM ( int  nt_in = 1,
int  Mary = 2 
)

Constructor.

Definition at line 405 of file modulator_nd.cpp.

References itpp::Modulator_ND::nt, and set_Gray_PAM().

itpp::ND_UPAM::~ND_UPAM (  )  [inline]

Destructor.

Definition at line 341 of file modulator_nd.h.


Member Function Documentation

void itpp::ND_UPAM::set_Gray_PAM ( int  nt_in = 1,
int  Mary = 2 
)

Set component modulators to M-PAM with Gray mapping.

Definition at line 411 of file modulator_nd.cpp.

References itpp::Modulator_ND::nt.

Referenced by ND_UPAM().

void itpp::ND_UPAM::set_Gray_PAM ( int  nt_in = 1,
ivec  Mary = "2" 
)

Set component modulators to M-PAM with Gray mapping, different M per component.

Definition at line 421 of file modulator_nd.cpp.

References itpp::bin2dec(), itpp::Modulator_ND::bitmap, itpp::Modulator_ND::bits2symbols, itpp::graycode(), it_assert, itpp::Modulator_ND::k, itpp::length(), itpp::log2(), itpp::Modulator_ND::M, itpp::Modulator_ND::nt, itpp::round_i(), itpp::Vec< Num_T >::set_size(), itpp::sqrt(), and itpp::Modulator_NRD::symbols.

int itpp::ND_UPAM::sphere_decoding ( vec &  y,
mat &  H,
double  rmin,
double  rmax,
double  stepup,
QLLRvec &  detected_bits 
)

Sphere decoding.

This function solves the integer-constrained minimization problem

\[ \mbox{min} |y-Hs| \]

with respect to $s$ using sphere the decoding algorithm and the Schnorr-Eucner search strategy (see source code for further implementation notes). The function starts with an initial search radius and increases it with a factor ("stepup") until the search succeeds.

Parameters:
y received data vector ($n_r\times 1$)
H channel matrix ($n_r\times n_t$)
rmax maximum possible sphere radius to try
rmin sphere radius in the first try
stepup factor with which the sphere radius is increased if the search fails
detected_bits result of the search (hard decisions only, QLLR for a sure "1" is set to 1000)
The function returns 0 if the search suceeds, and -1 otherwise.

Definition at line 552 of file modulator_nd.cpp.

References itpp::Modulator_ND::bitmap, it_assert, itpp::Modulator_ND::k, itpp::length(), itpp::Modulator_ND::M, itpp::Modulator_ND::nt, and itpp::sum().

void itpp::ND_UPAM::ZF_demod ( QLLRvec &  detected_bits,
double  sigma2,
mat &  H,
vec &  y 
)

ZF demodulation (NOT IMPLEMENTED YET).

void itpp::ND_UPAM::MMSE_demod ( QLLRvec &  detected_bits,
double  sigma2,
mat &  H,
vec &  y 
)

MMSE demodulation (NOT IMPLEMENTED YET).

Vec<vec> itpp::Modulator_NRD::get_symbols (  )  [inline, inherited]

Get modulation symbols per dimension.

Definition at line 154 of file modulator_nd.h.

References itpp::Modulator_NRD::symbols.

vec itpp::Modulator_NRD::modulate_bits ( const bvec &  bits  )  const [inherited]

Modulation of bits.

Returns a vector of modulated symbols.

Parameters:
bits vector of the bits to be modulated

Definition at line 338 of file modulator_nd.cpp.

References itpp::bin2dec(), itpp::Modulator_ND::bits2symbols, it_assert, itpp::Modulator_ND::k, itpp::length(), itpp::Modulator_ND::nt, itpp::sum(), and itpp::Modulator_NRD::symbols.

void itpp::Modulator_NRD::map_demod ( QLLRvec &  LLR_apriori,
QLLRvec &  LLR_aposteriori,
double  sigma2,
mat &  H,
vec &  y 
) [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. It is assumed that H, y and s are real-valued. Complex-valued channels can be handled via the Modulator_NCD class.

Parameters:
H channel matrix (m*n)
y received vector (m*1)
sigma2 noise variance, per real dimension
LLR_apriori vector of a priori LLR values per bit
LLR_aposteriori vector of a posteriori LLR values
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.

Definition at line 192 of file modulator_nd.cpp.

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

void itpp::Modulator_NRD::map_demod ( QLLRvec &  LLR_apriori,
QLLRvec &  LLR_aposteriori,
double  sigma2,
vec &  h,
vec &  y 
) [inherited]

Soft MAP demodulation for parallel channels without crosstalk.

This function is equivalent to map_demod with $H=\mbox{diag}(h)$. However, it is much faster (the complexity is linear in the number of subchannels).

Definition at line 138 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::Modulator_NRD::symbols, itpp::LLR_calc_unit::to_qllr(), and itpp::Modulator_ND::update_LLR().

void itpp::Modulator_NRD::update_norm ( double &  norm,
int  k,
int  sold,
int  snew,
vec &  ytH,
mat &  HtH,
ivec &  s 
) [protected, inherited]

For internal use only.

Update the residual norm $|y-Hs|$ when moving from one constellation point to an adjacent point

Parameters:
norm The norm to be updated
k The position where s changed
sold Old value of s[k]
snew New value of s[k]
ytH The vector y'H
HtH The Grammian matrix H'H
s The s-vector

Definition at line 111 of file modulator_nd.cpp.

References itpp::length(), itpp::sqr(), and itpp::Modulator_NRD::symbols.

Referenced by itpp::Modulator_NRD::map_demod().

int itpp::Modulator_ND::get_dim (  )  [inline, inherited]

Get number of dimensions.

Definition at line 57 of file modulator_nd.h.

References itpp::Modulator_ND::nt.

LLR_calc_unit itpp::Modulator_ND::get_llrcalc (  )  const [inline, inherited]

Get LLR calculation unit.

Definition at line 60 of file modulator_nd.h.

References itpp::Modulator_ND::llrcalc.

ivec itpp::Modulator_ND::get_k (  )  [inline, inherited]

Get number of bits per modulation symbol.

Definition at line 63 of file modulator_nd.h.

References itpp::Modulator_ND::k.

ivec itpp::Modulator_ND::get_M (  )  [inline, inherited]

Get number of modulation symbols per dimension.

Definition at line 66 of file modulator_nd.h.

References itpp::Modulator_ND::M.

QLLRvec itpp::Modulator_ND::probabilities ( QLLR  l  )  [protected, inherited]

Convert LLR to log-probabilities.

Definition at line 44 of file modulator_nd.cpp.

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

Referenced by itpp::Modulator_NCD::map_demod(), itpp::Modulator_NRD::map_demod(), and itpp::Modulator_ND::probabilities().

Vec< QLLRvec > itpp::Modulator_ND::probabilities ( QLLRvec &  l  )  [protected, inherited]

Convert LLR to log-probabilities, vector version.

Definition at line 58 of file modulator_nd.cpp.

References itpp::length(), and itpp::Modulator_ND::probabilities().

void itpp::Modulator_ND::update_LLR ( Vec< QLLRvec > &  logP_apriori,
QLLRvec &  numerator,
QLLRvec &  denominator,
ivec &  s,
QLLR  x 
) [protected, inherited]

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:
logP_apriori vector of a priori probabilities per bit
numerator the logarithm of the numerator in the above expression
denominator the logarithm of the denominator in the above expression
s the symbol vector

Definition at line 87 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_NCD::map_demod(), and itpp::Modulator_NRD::map_demod().

void itpp::Modulator_ND::update_LLR ( Vec< QLLRvec > &  logP_apriori,
QLLRvec &  numerator,
QLLRvec &  denominator,
int  s,
QLLR  scaled_norm,
int  j 
) [protected, inherited]

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:
logP_apriori vector of a priori probabilities per bit
numerator the logarithm of the numerator in the above expression
denominator the logarithm of the denominator in the above expression
s the symbol vector

Definition at line 67 of file modulator_nd.cpp.

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


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  os,
const Modulator_NRD mod 
) [friend, inherited]

Print some properties of the MIMO modulator in plain text (mainly to aid debugging).

Definition at line 374 of file modulator_nd.cpp.


Member Data Documentation

Vec<vec> itpp::Modulator_NRD::symbols [protected, inherited]

Vector of modulation symbols (along each dimension).

Definition at line 206 of file modulator_nd.h.

Referenced by itpp::Modulator_NRD::get_symbols(), itpp::Modulator_NRD::map_demod(), itpp::Modulator_NRD::modulate_bits(), set_Gray_PAM(), and itpp::Modulator_NRD::update_norm().

int itpp::Modulator_ND::nt [protected, inherited]

Number of dimensions.

Definition at line 70 of file modulator_nd.h.

Referenced by itpp::Modulator_ND::get_dim(), itpp::Modulator_NCD::map_demod(), itpp::Modulator_NRD::map_demod(), itpp::Modulator_NCD::modulate_bits(), itpp::Modulator_NRD::modulate_bits(), ND_UPAM(), itpp::ND_UPSK::ND_UPSK(), itpp::ND_UQAM::ND_UQAM(), set_Gray_PAM(), itpp::ND_UPSK::set_Gray_PSK(), itpp::ND_UQAM::set_Gray_QAM(), sphere_decoding(), and itpp::Modulator_ND::update_LLR().

LLR_calc_unit itpp::Modulator_ND::llrcalc [protected, inherited]

LLR calculation unit.

Definition at line 72 of file modulator_nd.h.

Referenced by itpp::Modulator_ND::get_llrcalc(), itpp::Modulator_NCD::map_demod(), itpp::Modulator_NRD::map_demod(), itpp::Modulator_ND::Modulator_ND(), itpp::Modulator_ND::probabilities(), and itpp::Modulator_ND::update_LLR().

ivec itpp::Modulator_ND::k [protected, inherited]

Number of bits per modulation symbol.

Definition at line 74 of file modulator_nd.h.

Referenced by itpp::Modulator_ND::get_k(), itpp::Modulator_NCD::map_demod(), itpp::Modulator_NRD::map_demod(), itpp::Modulator_NCD::modulate_bits(), itpp::Modulator_NRD::modulate_bits(), set_Gray_PAM(), itpp::ND_UPSK::set_Gray_PSK(), itpp::ND_UQAM::set_Gray_QAM(), sphere_decoding(), and itpp::Modulator_ND::update_LLR().

ivec itpp::Modulator_ND::M [protected, inherited]

Number of modulation symbols along each dimension.

Definition at line 76 of file modulator_nd.h.

Referenced by itpp::Modulator_ND::get_M(), itpp::Modulator_NCD::map_demod(), itpp::Modulator_NRD::map_demod(), set_Gray_PAM(), itpp::ND_UPSK::set_Gray_PSK(), itpp::ND_UQAM::set_Gray_QAM(), and sphere_decoding().

Vec<bmat> itpp::Modulator_ND::bitmap [protected, inherited]

Bit mapping table (one table per dimension).

Definition at line 78 of file modulator_nd.h.

Referenced by set_Gray_PAM(), itpp::ND_UPSK::set_Gray_PSK(), itpp::ND_UQAM::set_Gray_QAM(), sphere_decoding(), and itpp::Modulator_ND::update_LLR().

Vec<ivec> itpp::Modulator_ND::bits2symbols [protected, inherited]

Bit pattern in decimal form ordered and the corresponding symbols (one pattern per dimension).

Definition at line 80 of file modulator_nd.h.

Referenced by itpp::Modulator_NCD::modulate_bits(), itpp::Modulator_NRD::modulate_bits(), set_Gray_PAM(), itpp::ND_UPSK::set_Gray_PSK(), and itpp::ND_UQAM::set_Gray_QAM().


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

Generated on Fri Jun 8 00:37:38 2007 for IT++ by Doxygen 1.5.2