#include <itpp/comm/modulator.h>
Inheritance diagram for itpp::PAM:
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 |
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. |
Mary-PAM signals . 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 .
Definition at line 421 of file modulator.h.
itpp::PAM::PAM | ( | int | Mary | ) | [inline] |
virtual itpp::PAM::~PAM | ( | ) | [inline, virtual] |
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, k, itpp::log2(), M, itpp::pow2i(), itpp::round_i(), S0, S1, 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 itpp::bin2dec(), bits2symbols, it_warning, k, and symbols.
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 itpp::bin2dec(), bits2symbols, it_warning, k, and symbols.
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, k, 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, k, 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
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 582 of file modulator.cpp.
References itpp::exp(), k, M, itpp::real(), S0, S1, itpp::sqr(), symbols, and itpp::trunc_log().
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 k, M, max, itpp::real(), S0, S1, 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
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 634 of file modulator.cpp.
References itpp::exp(), k, M, itpp::real(), S0, S1, itpp::sqr(), symbols, and itpp::trunc_log().
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 k, M, max, itpp::real(), S0, S1, itpp::sqr(), and symbols.
int itpp::PAM::k [protected] |
Number of bits per modulation symbol.
Definition at line 527 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::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 modulate_bits(), and 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(), modulate_bits(), 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] |
Matrix where row k contains the constellation symbol numbers where bit k is 0/1.
Definition at line 542 of file modulator.h.
Referenced by demodulate_soft_bits(), demodulate_soft_bits_approx(), and set_M().
imat itpp::PAM::S1 [protected] |
Matrix where row k contains the constellation symbol numbers where bit k is 0/1.
Definition at line 545 of file modulator.h.
Referenced by demodulate_soft_bits(), demodulate_soft_bits_approx(), and set_M().
Generated on Fri Jun 8 00:37:38 2007 for IT++ by Doxygen 1.5.2