#include <itpp/comm/modulator.h>
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. |
This class can also perform soft demodulation. To use the soft demodulate member functions the received symbols shall be equal to
where is the complex channel gain,
is the transmitted constelation symbol, and
is the AWGN of the channel (with variance
in both the real and imaginary valued components).
The input samples to the soft demodulate functions shall be equal to
where 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 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.
itpp::Modulator_2d::Modulator_2d | ( | const cvec & | symbols = "1+0i -1+0i" , |
|
const ivec & | bitmap = "0 1" | |||
) |
virtual itpp::Modulator_2d::~Modulator_2d | ( | ) | [inline, virtual] |
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] |
cvec itpp::Modulator_2d::modulate | ( | const ivec & | symbolnumbers | ) | const [virtual] |
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] |
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] |
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
where denotes a constellation symbol with the i-th bit equal to zero. This function can be used on channels where the channel gain
.
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 |
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
rx_symbols | The received noisy constellation symbols ![]() ![]() | |
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 |
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 denote the distance to the closest zero point and
denote the distance to the closest one point for the corresponding bit respectively. This algorithm then computes
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 and
, with
and
denoting the closest constellation points with zero and one in the corresponding bit position respectively. This algorithm then computes
.
rx_symbols | The received noisy constellation symbols ![]() ![]() | |
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().
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().
Generated on Wed Apr 18 11:20:04 2007 for IT++ by Doxygen 1.5.2