Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

SPUC::Modulator_2d Class Reference
[Digital Modulation]

General modulator for 2-dimensional signal constellations. More...

#include <modulator.h>

List of all members.

Public Member Functions

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

Protected Member Functions

void calculate_softbit_matricies (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.
bool soft_bit_mapping_matrices_calculated
 Internal protected state variable.


Detailed Description

General modulator for 2-dimensional signal constellations.

This class can also perform soft demodulation. 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 QAM 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 shall equal

\[ 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.


Constructor & Destructor Documentation

Modulator_2d::Modulator_2d const cvec &  insymbols = zeros_c(1),
const ivec &  inbitmap = "0"
 

Constructor.

virtual SPUC::Modulator_2d::~Modulator_2d  )  [inline, virtual]
 

Destructor.


Member Function Documentation

void Modulator_2d::calculate_softbit_matricies ivec  inbitmap  )  [protected]
 

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

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

Demodulation of symbols.

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

Demodulation of bits.

void Modulator_2d::demodulate_soft_bits const cvec &  rx_symbols,
const cvec &  chan,
double  N0,
vec &  soft_bits
 

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

void Modulator_2d::demodulate_soft_bits const cvec &  rx_symbols,
double  N0,
vec &  soft_bits
 

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

void Modulator_2d::demodulate_soft_bits_approx const cvec &  rx_symbols,
const cvec &  chan,
double  N0,
vec &  soft_bits
 

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

void Modulator_2d::demodulate_soft_bits_approx const cvec &  rx_symbols,
double  N0,
vec &  soft_bits
 

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

ivec Modulator_2d::get_bitmap  ) 
 

Get the bitmap used in the modulator.

cvec Modulator_2d::get_symbols  ) 
 

Get the symbol values used in the modulator.

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

Modulation of symbols.

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

Modulation of bits.

void Modulator_2d::set const cvec &  insymbols,
const ivec &  inbitmap
 

Set the symbol values to use in the modulator.


Member Data Documentation

ivec SPUC::Modulator_2d::bitmap [protected]
 

Bit mapping table.

int SPUC::Modulator_2d::k [protected]
 

Number of bits per modulation symbol.

int SPUC::Modulator_2d::M [protected]
 

Number of modulation symbols.

imat SPUC::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.

imat SPUC::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.

bool SPUC::Modulator_2d::soft_bit_mapping_matrices_calculated [protected]
 

Internal protected state variable.

cvec SPUC::Modulator_2d::symbols [protected]
 

Vector of modulation symbols.


The documentation for this class was generated from the following files:
Generated on Fri Sep 16 11:07:54 2005 for spuc by  doxygen 1.4.4