IT++ Logo Newcom Logo

itpp::Modulator_2d Class Reference
[Digital Modulation]

General modulator for two-dimensional (2D) signal constellations. More...

#include <itpp/comm/modulator.h>

List of all members.

Public Member Functions

 Modulator_2d (const cvec &symbols="1+0i -1+0i", const ivec &bitmap="0 1")
 Constructor.
virtual ~Modulator_2d ()
 Destructor.
void set (const cvec &symbols, const ivec &bitmap)
 Set the symbol values to use in the modulator.
virtual double bits_per_symbol () const
 Returns number of bits per symbol for the modulator. Can be noninteger.
cvec get_symbols () const
 Get the symbol values used in the modulator.
ivec get_bitmap () const
 Get the bitmap.
virtual cvec modulate (const ivec &symbolnumbers) const
 Modulation of symbols.
virtual ivec demodulate (const cvec &signal) const
 Demodulation of symbols.
virtual void modulate_bits (const bvec &bits, cvec &out) const
 Modulation of bits.
virtual cvec modulate_bits (const bvec &bits) const
 Modulation of bits.
virtual void demodulate_bits (const cvec &signal, bvec &bits) const
 Demodulation of bits.
virtual bvec demodulate_bits (const cvec &signal) const
 Demodulation of bits.
virtual void demodulate_soft_bits (const cvec &rx_symbols, double N0, vec &soft_bits) const
 Soft demodulator for AWGN channels.
virtual void demodulate_soft_bits (const cvec &rx_symbols, const cvec &chan, double N0, vec &soft_bits) const
 Soft demodulator for fading channels.
virtual void demodulate_soft_bits_approx (const cvec &rx_symbols, double N0, vec &soft_bits) const
 Approximative soft demodulator for AWGN channels.
virtual void demodulate_soft_bits_approx (const cvec &rx_symbols, const cvec &chan, double N0, vec &soft_bits) const
 Approximative soft demodulator for fading channels.

Protected Member Functions

void calculate_softbit_matricies (const ivec &inbitmap)
 This function calculates the soft bit mapping matrices S0 and S1.

Protected Attributes

int k
 Number of bits per modulation symbol.
int M
 Number of modulation symbols.
ivec bitmap
 Bit mapping table.
cvec symbols
 Vector of modulation symbols.
imat S0
 Used by the soft demodulator functions: Matrix where row k contains the constellation points with a zero in bit position k.
imat S1
 Used by the soft demodulator functions: Matrix where row k contains the constellation points with a one in bit position k.


Detailed Description

General modulator for two-dimensional (2D) signal constellations.

This class can also perform soft demodulation. To use the soft demodulate member functions the received symbols shall be equal to

\[ r_k = c_k \times s_k + n_k, \]

where $c_k$ is the complex channel gain, $s_k$ is the transmitted constelation symbol, and $n_k$ is the AWGN of the channel (with variance $N_0/2$ in both the real and imaginary valued components).

The input samples to the soft demodulate functions shall be equal to

\[ z_k = \hat{c}_k^{*} \times r_k, \]

where $\hat{c}_k^{*}$ is the conjugate of the channel estimate. This class assumes that the channel estimates are perfect when calculating the soft bits.

When these member functions are used together with MAP-based turbo decoding algoritms then the channel reliability factor $L_c$ of the turbo decoder shall be set to 1. The output from these member functions can also be used by a Viterbi decoder using an AWGN based metric calculation function.

Definition at line 148 of file modulator.h.


Constructor & Destructor Documentation

itpp::Modulator_2d::Modulator_2d ( const cvec &  symbols = "1+0i -1+0i",
const ivec &  bitmap = "0 1" 
)

Constructor.

Definition at line 128 of file modulator.cpp.

virtual itpp::Modulator_2d::~Modulator_2d (  )  [inline, virtual]

Destructor.

Definition at line 153 of file modulator.h.


Member Function Documentation

void itpp::Modulator_2d::set ( const cvec &  symbols,
const ivec &  bitmap 
)

Set the symbol values to use in the modulator.

Definition at line 133 of file modulator.cpp.

References bitmap, calculate_softbit_matricies(), itpp::is_even(), it_assert, k, itpp::levels2bits(), M, itpp::max(), itpp::min(), and symbols.

virtual double itpp::Modulator_2d::bits_per_symbol (  )  const [inline, virtual]

Returns number of bits per symbol for the modulator. Can be noninteger.

Definition at line 159 of file modulator.h.

References k.

cvec itpp::Modulator_2d::get_symbols (  )  const [inline]

Get the symbol values used in the modulator.

Definition at line 161 of file modulator.h.

References symbols.

ivec itpp::Modulator_2d::get_bitmap (  )  const [inline]

Get the bitmap.

Definition at line 163 of file modulator.h.

References bitmap.

cvec itpp::Modulator_2d::modulate ( const ivec &  symbolnumbers  )  const [virtual]

Modulation of symbols.

Definition at line 148 of file modulator.cpp.

References symbols.

ivec itpp::Modulator_2d::demodulate ( const cvec &  signal  )  const [virtual]

Demodulation of symbols.

Definition at line 177 of file modulator.cpp.

References itpp::abs(), M, and symbols.

void itpp::Modulator_2d::modulate_bits ( const bvec &  bits,
cvec &  out 
) const [virtual]

Modulation of bits.

Definition at line 156 of file modulator.cpp.

References itpp::bin2dec(), bitmap, k, and symbols.

Referenced by modulate_bits().

cvec itpp::Modulator_2d::modulate_bits ( const bvec &  bits  )  const [virtual]

Modulation of bits.

Definition at line 170 of file modulator.cpp.

References modulate_bits().

void itpp::Modulator_2d::demodulate_bits ( const cvec &  signal,
bvec &  bits 
) const [virtual]

Demodulation of bits.

Definition at line 198 of file modulator.cpp.

References itpp::abs(), bitmap, itpp::dec2bin(), k, M, and symbols.

Referenced by demodulate_bits().

bvec itpp::Modulator_2d::demodulate_bits ( const cvec &  signal  )  const [virtual]

Demodulation of bits.

Definition at line 218 of file modulator.cpp.

References demodulate_bits().

void itpp::Modulator_2d::demodulate_soft_bits ( const cvec &  rx_symbols,
double  N0,
vec &  soft_bits 
) const [virtual]

Soft demodulator for AWGN channels.

This function calculates

\[ \log \left( \frac{\sum_{s_i \in S_0} \frac{1}{\pi N_0} \exp \left( -\frac{ |z_k - s_i|^2 }{N_0} \right)}{\sum_{s_i \in S_1} \frac{1}{\pi N_0} \exp \left( -\frac{ |z_k - s_i|^2 }{N_0} \right)} \right) \]

where $s_i \in S_0$ denotes a constellation symbol with the i-th bit equal to zero. This function can be used on channels where the channel gain $c_k = 1$.

Parameters:
rx_symbols The received noisy constellation symbols
N0 The single sided spectral density of the AWGN noise
soft_bits The soft bits calculated using the expression above
Note: For soft demodulation it is suggested to use the N-dimensional modulator (Modulator_ND) class instead, which is based on QLLR arithmetics and therefore faster and more numerically stable.

Definition at line 225 of file modulator.cpp.

References itpp::exp(), k, S0, S1, itpp::sqr(), symbols, and itpp::trunc_log().

void itpp::Modulator_2d::demodulate_soft_bits ( const cvec &  rx_symbols,
const cvec &  chan,
double  N0,
vec &  soft_bits 
) const [virtual]

Soft demodulator for fading channels.

This function calculates

\[ \log \left( \frac{\sum_{s_i \in S_0} \frac{1}{\pi N_0 |c_k|^2} \exp \left( -\frac{ |z_k - |c_k|^2 s_i|^2 }{N_0 |c_k|^2} \right)} {\sum_{s_i \in S_1} \frac{1}{\pi N_0 |c_k|^2} \exp \left( -\frac{ |z_k - |c_k|^2 s_i|^2 }{N_0 |c_k|^2} \right)} \right) \]

Parameters:
rx_symbols The received noisy constellation symbols $z_k$ (remember that $z_k = \hat{c}_k^{*} \times r_k$)
chan The complex valued channel values
N0 The single sided spectral density of the AWGN noise
soft_bits The soft bits calculated using the expression above
Note: For soft demodulation it is suggested to use the N-dimensional modulator (Modulator_ND) class instead which is based on QLLR arithmetics and therefore faster and more numerically stable.

Definition at line 262 of file modulator.cpp.

References itpp::exp(), k, S0, S1, itpp::sqr(), symbols, and itpp::trunc_log().

void itpp::Modulator_2d::demodulate_soft_bits_approx ( const cvec &  rx_symbols,
double  N0,
vec &  soft_bits 
) const [virtual]

Approximative soft demodulator for AWGN channels.

This function is faster and gives allmost no performance degradation compared to the demodulate_soft_bits(const cvec &symbols, vec &soft_bits) function. This function finds for each bit the closest constellation point that have a zero and a one in the corresponding position. Let $d_0$ denote the distance to the closest zero point and $d_1$ denote the distance to the closest one point for the corresponding bit respectively. This algorithm then computes

\[ \frac{1}{N_0} ( d_1^2 - d_0^2 ) \]

Parameters:
rx_symbols The received noisy constellation symbols
N0 The single sided spectral density of the AWGN noise
soft_bits The soft bits calculated using the expression above

Definition at line 300 of file modulator.cpp.

References itpp::abs(), k, M, S0, S1, itpp::sqr(), and symbols.

void itpp::Modulator_2d::demodulate_soft_bits_approx ( const cvec &  rx_symbols,
const cvec &  chan,
double  N0,
vec &  soft_bits 
) const [virtual]

Approximative soft demodulator for fading channels.

This function is faster and gives allmost no performance degradation compared to the demodulate_soft_bits(const cvec &symbols, const cvec &chan, vec &soft_bits) function. Let $d_0 = | z_k - |c_k|^2 s_0 |$ and $d_1 = |z_k - |c_k|^2 s_1|$, with $s_0$ and $s_0$ denoting the closest constellation points with zero and one in the corresponding bit position respectively. This algorithm then computes

\[\frac{1}{N_0 |c_k|^2} (d_1^2 - d_0^2) \]

.

Parameters:
rx_symbols The received noisy constellation symbols $z_k$ (remember that $z_k = \hat{c}_k^{*} \times r_k$)
chan The complex valued channel values
N0 The single sided spectral density of the AWGN noise
soft_bits The soft bits calculated using the expression above

Definition at line 333 of file modulator.cpp.

References itpp::abs(), k, M, S0, S1, itpp::sqr(), and symbols.

void itpp::Modulator_2d::calculate_softbit_matricies ( const ivec &  inbitmap  )  [protected]

This function calculates the soft bit mapping matrices S0 and S1.

Definition at line 368 of file modulator.cpp.

References itpp::dec2bin(), k, M, S0, and S1.

Referenced by set().


Member Data Documentation

int itpp::Modulator_2d::k [protected]

Number of bits per modulation symbol.

Definition at line 269 of file modulator.h.

Referenced by bits_per_symbol(), calculate_softbit_matricies(), demodulate_bits(), demodulate_soft_bits(), demodulate_soft_bits_approx(), modulate_bits(), and set().

int itpp::Modulator_2d::M [protected]

Number of modulation symbols.

Definition at line 271 of file modulator.h.

Referenced by calculate_softbit_matricies(), demodulate(), demodulate_bits(), demodulate_soft_bits_approx(), and set().

ivec itpp::Modulator_2d::bitmap [protected]

Bit mapping table.

Definition at line 273 of file modulator.h.

Referenced by demodulate_bits(), get_bitmap(), modulate_bits(), and set().

cvec itpp::Modulator_2d::symbols [protected]

Vector of modulation symbols.

Definition at line 275 of file modulator.h.

Referenced by demodulate(), demodulate_bits(), demodulate_soft_bits(), demodulate_soft_bits_approx(), get_symbols(), modulate(), modulate_bits(), and set().

imat itpp::Modulator_2d::S0 [protected]

Used by the soft demodulator functions: Matrix where row k contains the constellation points with a zero in bit position k.

Definition at line 281 of file modulator.h.

Referenced by calculate_softbit_matricies(), demodulate_soft_bits(), and demodulate_soft_bits_approx().

imat itpp::Modulator_2d::S1 [protected]

Used by the soft demodulator functions: Matrix where row k contains the constellation points with a one in bit position k.

Definition at line 284 of file modulator.h.

Referenced by calculate_softbit_matricies(), demodulate_soft_bits(), and demodulate_soft_bits_approx().


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

Generated on Thu Aug 30 02:47:24 2007 for IT++ by Doxygen 1.5.3