#include <itpp/comm/modulator.h>
Inheritance diagram for itpp::QAM:
Public Member Functions | |
QAM (int Mary) | |
Class Constructor. | |
virtual | ~QAM () |
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. | |
cvec | get_symbols () const |
Return the constellation symbols used. | |
ivec | get_bitmap () const |
Return the bit mapping used in decimal form. | |
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. | |
int | L |
The square-root of M. | |
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. | |
double | scaling_factor |
Scaling factor used to normalize the average energy to 1. | |
imat | S0 |
Matrix where row k contains the constellation symbol numbers where bit k is 0/1. | |
imat | S1 |
Matrix where row k contains the constellation symbol numbers where bit k is 0/1. |
The size of the constellation is . The symbol values in each dimension is:
Symbol numbering:
The symbols are normalized so that the average energy is 1. That is, normalized with .
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
where is the complex channel gain,
is the transmitted QAM symbols, and
is the AWGN of the channel (with variance
in both the real and the imaginary valued components).
The input samples to the soft demodulate functions should be . 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 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 849 of file modulator.h.
itpp::QAM::QAM | ( | int | Mary | ) | [inline] |
virtual itpp::QAM::~QAM | ( | ) | [inline, virtual] |
void itpp::QAM::set_M | ( | int | Mary | ) |
Change the size of the signal constellation.
Definition at line 1160 of file modulator.cpp.
References average_energy, itpp::bin2dec(), bitmap, bits2symbols, itpp::concat(), itpp::gray_code(), itpp::graycode(), itpp::is_even(), it_assert, k, L, itpp::log2(), M, itpp::pow2i(), itpp::round_i(), S0, S1, scaling_factor, itpp::sqrt(), and symbols.
Referenced by QAM().
virtual double itpp::QAM::bits_per_symbol | ( | ) | const [inline, virtual] |
Returns number of bits per symbol.
Implements itpp::Modulator.
Definition at line 859 of file modulator.h.
References k.
cvec itpp::QAM::get_symbols | ( | ) | const [inline] |
Return the constellation symbols used.
Definition at line 861 of file modulator.h.
References symbols.
ivec itpp::QAM::get_bitmap | ( | ) | const [inline] |
Return the bit mapping used in decimal form.
Definition at line 863 of file modulator.h.
References bits2symbols.
void itpp::QAM::modulate_bits | ( | const bvec & | bits, | |
cvec & | out | |||
) | const [virtual] |
Modulation of bits.
Implements itpp::Modulator.
Definition at line 1009 of file modulator.cpp.
References itpp::bin2dec(), bits2symbols, it_warning, k, and symbols.
Referenced by modulate_bits().
cvec itpp::QAM::modulate_bits | ( | const bvec & | bits | ) | const [virtual] |
Modulation of bits.
Implements itpp::Modulator.
Definition at line 1023 of file modulator.cpp.
References modulate_bits().
void itpp::QAM::demodulate_bits | ( | const cvec & | signal, | |
bvec & | out | |||
) | const [virtual] |
Demodulation of bits.
Implements itpp::Modulator.
Definition at line 1030 of file modulator.cpp.
References bitmap, itpp::imag(), k, L, itpp::real(), itpp::round_i(), and scaling_factor.
Referenced by demodulate_bits().
bvec itpp::QAM::demodulate_bits | ( | const cvec & | signal | ) | const [virtual] |
Demodulation of bits.
Implements itpp::Modulator.
Definition at line 1053 of file modulator.cpp.
References demodulate_bits().
void itpp::QAM::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 is
.
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.
Implements itpp::Modulator.
Definition at line 1060 of file modulator.cpp.
References itpp::exp(), k, M, S0, S1, itpp::sqr(), symbols, and itpp::trunc_log().
void itpp::QAM::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 1085 of file modulator.cpp.
void itpp::QAM::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
where denotes a constellation symbol with the i-th bit equal to zero.
rx_symbols | The received noisy constellation symbols, ![]() | |
channel | The channel coefficients (complex), ![]() | |
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.
Implements itpp::Modulator.
Definition at line 1109 of file modulator.cpp.
References itpp::exp(), k, M, S0, S1, itpp::sqr(), symbols, and itpp::trunc_log().
void itpp::QAM::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 1134 of file modulator.cpp.
int itpp::QAM::k [protected] |
Number of bits per modulation symbol.
Definition at line 952 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::QAM::M [protected] |
Number of modulation symbols.
Definition at line 954 of file modulator.h.
Referenced by demodulate_soft_bits(), demodulate_soft_bits_approx(), and set_M().
int itpp::QAM::L [protected] |
The square-root of M.
Definition at line 956 of file modulator.h.
Referenced by demodulate_bits(), and set_M().
bmat itpp::QAM::bitmap [protected] |
Bit patterns for symbols in order of symbol number.
Definition at line 958 of file modulator.h.
Referenced by demodulate_bits(), and set_M().
ivec itpp::QAM::bits2symbols [protected] |
Bit pattern in decimal form ordered and the corresponding symbols.
Definition at line 960 of file modulator.h.
Referenced by get_bitmap(), modulate_bits(), and set_M().
cvec itpp::QAM::symbols [protected] |
A vector containing the modulation symbols.
Definition at line 962 of file modulator.h.
Referenced by demodulate_soft_bits(), demodulate_soft_bits_approx(), get_symbols(), modulate_bits(), and set_M().
double itpp::QAM::average_energy [protected] |
The average signal energy of the constallation.
Definition at line 964 of file modulator.h.
Referenced by set_M().
double itpp::QAM::scaling_factor [protected] |
Scaling factor used to normalize the average energy to 1.
Definition at line 966 of file modulator.h.
Referenced by demodulate_bits(), and set_M().
imat itpp::QAM::S0 [protected] |
Matrix where row k contains the constellation symbol numbers where bit k is 0/1.
Definition at line 969 of file modulator.h.
Referenced by demodulate_soft_bits(), demodulate_soft_bits_approx(), and set_M().
imat itpp::QAM::S1 [protected] |
Matrix where row k contains the constellation symbol numbers where bit k is 0/1.
Definition at line 972 of file modulator.h.
Referenced by demodulate_soft_bits(), demodulate_soft_bits_approx(), and set_M().
Generated on Thu Apr 19 14:43:49 2007 for IT++ by Doxygen 1.5.1