IT++ Logo Newcom Logo

itpp::PAM Class Reference
[Digital Modulation]

M-ary PAM modulator. More...

#include <itpp/comm/modulator.h>

Inheritance diagram for itpp::PAM:

itpp::Modulator List of all members.

Public Member Functions

 PAM (int Mary)
 Constructor.
virtual ~PAM ()
 Destructor.
void set_M (int Mary)
 Set the size of the signal constellation.
virtual double bits_per_symbol () const
 Returns number of bits per symbol.
void modulate_bits (const bvec &bits, vec &out) const
 Modulate bits into PAM symbols.
virtual void modulate_bits (const bvec &bits, cvec &out) const
 Modulate bits into PAM symbols.
virtual cvec modulate_bits (const bvec &bits) const
 Modulate bits into PAM symbols.
void demodulate_bits (const vec &signal, bvec &out) const
 Demodulation of PAM symbols to bits.
virtual void demodulate_bits (const cvec &signal, bvec &out) const
 Demodulation of PAM symbols to bits. Symbols in real part.
virtual bvec demodulate_bits (const cvec &signal) const
 Demodulation of PAM symbols to 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_approx (const cvec &rx_symbols, double N0, vec &soft_bits) const
 Approximative soft demodulator for AWGN channel.
virtual void demodulate_soft_bits (const cvec &rx_symbols, const cvec &channel, double N0, vec &soft_bits) const
 Soft demodulator for a known channel in AWGN.
virtual void demodulate_soft_bits_approx (const cvec &rx_symbols, const cvec &channel, double N0, vec &soft_bits) const
 Approximative soft demodulator for a known channel in AWGN.

Protected Attributes

int k
 Number of bits per modulation symbol.
int M
 Number of modulation symbols.
bmat bitmap
 Bit patterns for symbols in order of symbol number.
ivec bits2symbols
 Bit pattern in decimal form ordered and the corresponding symbols.
vec symbols
 A vector containing the modulation symbols.
double average_energy
 The average signal energy of the constallation.
double scaling_factor
 Scaling factor used to normalize the average energy to 1.
imat S0
 where bit k is 0/1
imat S1
 where bit k is 0/1

Detailed Description

M-ary PAM modulator.

Mary-PAM signals $ \{M-1, \ldots, 3, 1, -1, -3, \ldots, -(M-1)\}$. Symbol numbering is from right to left in increasing order. Gray encoded bitmapping is used.

The symbols are normalized so that the average energy is 1. That is, normalized with $ \sqrt{(M^2-1)/3}$.

Definition at line 421 of file modulator.h.


Constructor & Destructor Documentation

itpp::PAM::PAM int  Mary  )  [inline]
 

Constructor.

Definition at line 424 of file modulator.h.

References set_M().

virtual itpp::PAM::~PAM  )  [inline, virtual]
 

Destructor.

Definition at line 426 of file modulator.h.


Member Function Documentation

void itpp::PAM::set_M int  Mary  ) 
 

Set the size of the signal constellation.

Definition at line 688 of file modulator.cpp.

References average_energy, itpp::bin2dec(), bitmap, bits2symbols, itpp::graycode(), it_assert, itpp::log2(), M, itpp::pow2i(), itpp::round_i(), scaling_factor, itpp::sqr(), itpp::sqrt(), and symbols.

Referenced by PAM().

virtual double itpp::PAM::bits_per_symbol  )  const [inline, virtual]
 

Returns number of bits per symbol.

Implements itpp::Modulator.

Definition at line 431 of file modulator.h.

References k.

void itpp::PAM::modulate_bits const bvec bits,
vec out
const
 

Modulate bits into PAM symbols.

Definition at line 506 of file modulator.cpp.

References it_warning.

Referenced by modulate_bits().

void itpp::PAM::modulate_bits const bvec bits,
cvec out
const [virtual]
 

Modulate bits into PAM symbols.

Implements itpp::Modulator.

Definition at line 521 of file modulator.cpp.

References it_warning.

cvec itpp::PAM::modulate_bits const bvec bits  )  const [virtual]
 

Modulate bits into PAM symbols.

Implements itpp::Modulator.

Definition at line 536 of file modulator.cpp.

References modulate_bits().

void itpp::PAM::demodulate_bits const vec signal,
bvec out
const
 

Demodulation of PAM symbols to bits.

Definition at line 543 of file modulator.cpp.

References bitmap, M, itpp::round_i(), and scaling_factor.

Referenced by demodulate_bits().

void itpp::PAM::demodulate_bits const cvec signal,
bvec out
const [virtual]
 

Demodulation of PAM symbols to bits. Symbols in real part.

Implements itpp::Modulator.

Definition at line 558 of file modulator.cpp.

References bitmap, M, itpp::real(), itpp::round_i(), and scaling_factor.

bvec itpp::PAM::demodulate_bits const cvec signal  )  const [virtual]
 

Demodulation of PAM symbols to bits.

Implements itpp::Modulator.

Definition at line 574 of file modulator.cpp.

References demodulate_bits().

void itpp::PAM::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{\Pr(b_i=0|r)}{\Pr(b_i=1|r)} \right) = \log \left( \frac{ \sum_{s_i \in S_0} \exp \left( -\frac{ |r - s_i|^2 }{N_0} \right) } { \sum_{s_i \in S_1} \exp \left( -\frac{ |r - 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 is $c = 1$.

Parameters:
rx_symbols The received noisy constellation symbols, $r$ (complex, but symbols are real)
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.

Implements itpp::Modulator.

Definition at line 582 of file modulator.cpp.

References itpp::exp(), M, itpp::real(), itpp::sqr(), and symbols.

void itpp::PAM::demodulate_soft_bits_approx const cvec rx_symbols,
double  N0,
vec soft_bits
const [virtual]
 

Approximative soft demodulator for AWGN channel.

This function is faster and gives almost no performance degradation compared to the demodulate_soft_bits() function. Only include the largest term in nominator and denominator when calculating the log-likelihood function.

Implements itpp::Modulator.

Definition at line 608 of file modulator.cpp.

References M, itpp::real(), itpp::sqr(), and symbols.

void itpp::PAM::demodulate_soft_bits const cvec rx_symbols,
const cvec channel,
double  N0,
vec soft_bits
const [virtual]
 

Soft demodulator for a known channel in AWGN.

This function calculates

\[ \log \left( \frac{\Pr(b_i=0|r)}{\Pr(b_i=1|r)} \right) = \log \left( \frac{ \sum_{s_i \in S_0} \exp \left( -\frac{ |r - c s_i|^2 }{N_0} \right) } { \sum_{s_i \in S_1} \exp \left( -\frac{ |r - c 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.

Parameters:
rx_symbols The received noisy constellation symbols, $r$ (complex)
channel The channel coefficients (complex), $c$
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.

Implements itpp::Modulator.

Definition at line 634 of file modulator.cpp.

References itpp::exp(), M, itpp::real(), itpp::sqr(), and symbols.

void itpp::PAM::demodulate_soft_bits_approx const cvec rx_symbols,
const cvec channel,
double  N0,
vec soft_bits
const [virtual]
 

Approximative soft demodulator for a known channel in AWGN.

This function is faster and gives almost no performance degradation compared to the demodulate_soft_bits() function. Only include the largest term in nominator and denominator when calculating the log-likelihood function.

Implements itpp::Modulator.

Definition at line 661 of file modulator.cpp.

References M, itpp::real(), itpp::sqr(), and symbols.


Member Data Documentation

int itpp::PAM::k [protected]
 

Number of bits per modulation symbol.

Definition at line 527 of file modulator.h.

Referenced by bits_per_symbol().

int itpp::PAM::M [protected]
 

Number of modulation symbols.

Definition at line 529 of file modulator.h.

Referenced by demodulate_bits(), demodulate_soft_bits(), demodulate_soft_bits_approx(), and set_M().

bmat itpp::PAM::bitmap [protected]
 

Bit patterns for symbols in order of symbol number.

Definition at line 531 of file modulator.h.

Referenced by demodulate_bits(), and set_M().

ivec itpp::PAM::bits2symbols [protected]
 

Bit pattern in decimal form ordered and the corresponding symbols.

Definition at line 533 of file modulator.h.

Referenced by set_M().

vec itpp::PAM::symbols [protected]
 

A vector containing the modulation symbols.

Definition at line 535 of file modulator.h.

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

double itpp::PAM::average_energy [protected]
 

The average signal energy of the constallation.

Definition at line 537 of file modulator.h.

Referenced by set_M().

double itpp::PAM::scaling_factor [protected]
 

Scaling factor used to normalize the average energy to 1.

Definition at line 539 of file modulator.h.

Referenced by demodulate_bits(), and set_M().

imat itpp::PAM::S0 [protected]
 

where bit k is 0/1

Definition at line 542 of file modulator.h.

imat itpp::PAM::S1 [protected]
 

where bit k is 0/1

Definition at line 545 of file modulator.h.


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

Generated on Thu Apr 19 14:20:42 2007 for IT++ by Doxygen 1.4.6