IT++ Logo Newcom Logo

itpp::PSK Class Reference
[Digital Modulation]

M-ary PSK modulator. More...

#include <itpp/comm/modulator.h>

Inheritance diagram for itpp::PSK:

itpp::Modulator List of all members.

Public Member Functions

 PSK (int Mary)
 Class constructor.
virtual ~PSK ()
 Destructor.
void set_M (int Mary)
 Change the size of the signal constellation.
virtual double bits_per_symbol () const
 Returns number of bits per symbol.
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 &out) 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_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
cvec symbols
 A vector containing the modulation symbols.
double average_energy
 The average signal energy of the constallation.
imat S0
 Matrix where row k contains the constellation symbol numbers where bit k is 0.
imat S1
 Matrix where row k contains the constellation symbol numbers where bit k is 1.

Detailed Description

M-ary PSK modulator.

M-ary PSK modulator with $M = 2^k, \_ k = 1, 2, \ldots $. Symbol numbering counter clockwise starting from the real axis. The bit map is Gray encoded. The symbol energy is 1.

This class can also perform soft demodulation, calculating the log-MAP estimate of the individual bits. To use the soft demodulate member functions the received symbols shall equal

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

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

The input samples to the soft demodulate functions should be $r_k$. It is also assumed 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.

Definition at line 696 of file modulator.h.


Constructor & Destructor Documentation

itpp::PSK::PSK ( int  Mary  )  [inline]

Class constructor.

Definition at line 699 of file modulator.h.

References set_M().

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

Destructor.

Definition at line 701 of file modulator.h.


Member Function Documentation

void itpp::PSK::set_M ( int  Mary  ) 

Change the size of the signal constellation.

Definition at line 959 of file modulator.cpp.

References itpp::bin2dec(), bitmap, bits2symbols, itpp::graycode(), itpp::imag(), it_assert, k, itpp::log2(), M, itpp::pi, itpp::pow2i(), itpp::real(), itpp::round_i(), S0, S1, and symbols.

Referenced by PSK().

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

Returns number of bits per symbol.

Implements itpp::Modulator.

Definition at line 706 of file modulator.h.

References k.

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

Modulation of bits.

Implements itpp::Modulator.

Definition at line 819 of file modulator.cpp.

References itpp::bin2dec(), bits2symbols, it_warning, k, and symbols.

Referenced by modulate_bits().

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

Modulation of bits.

Implements itpp::Modulator.

Definition at line 835 of file modulator.cpp.

References modulate_bits().

void itpp::PSK::demodulate_bits ( const cvec &  signal,
bvec &  out 
) const [virtual]

Demodulation of bits.

Implements itpp::Modulator.

Definition at line 842 of file modulator.cpp.

References itpp::arg(), bitmap, k, M, itpp::pi, and itpp::round_i().

Referenced by demodulate_bits().

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

Demodulation of bits.

Implements itpp::Modulator.

Definition at line 857 of file modulator.cpp.

References demodulate_bits().

void itpp::PSK::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$
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 864 of file modulator.cpp.

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

void itpp::PSK::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 888 of file modulator.cpp.

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

void itpp::PSK::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$
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 911 of file modulator.cpp.

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

void itpp::PSK::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 935 of file modulator.cpp.

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


Member Data Documentation

int itpp::PSK::k [protected]

Number of bits per modulation symbol.

Definition at line 794 of file modulator.h.

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

int itpp::PSK::M [protected]

Number of modulation symbols.

Definition at line 796 of file modulator.h.

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

bmat itpp::PSK::bitmap [protected]

bit patterns for symbols in order of symbol number

Definition at line 798 of file modulator.h.

Referenced by demodulate_bits(), and set_M().

ivec itpp::PSK::bits2symbols [protected]

bit pattern in decimal form ordered and the corresponding symbols

Definition at line 800 of file modulator.h.

Referenced by modulate_bits(), and set_M().

cvec itpp::PSK::symbols [protected]

A vector containing the modulation symbols.

Definition at line 802 of file modulator.h.

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

double itpp::PSK::average_energy [protected]

The average signal energy of the constallation.

Definition at line 804 of file modulator.h.

imat itpp::PSK::S0 [protected]

Matrix where row k contains the constellation symbol numbers where bit k is 0.

Definition at line 807 of file modulator.h.

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

imat itpp::PSK::S1 [protected]

Matrix where row k contains the constellation symbol numbers where bit k is 1.

Definition at line 810 of file modulator.h.

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


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

Generated on Sat Aug 25 23:40:08 2007 for IT++ by Doxygen 1.5.2