#include <itpp/comm/modulator.h>
Inheritance diagram for itpp::PSK:
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. |
M-ary PSK modulator with . 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
where is the complex channel gain,
is the transmitted M-PSK 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 696 of file modulator.h.
itpp::PSK::PSK | ( | int | Mary | ) | [inline] |
virtual itpp::PSK::~PSK | ( | ) | [inline, virtual] |
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
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 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.
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
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 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.
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] |
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().
Generated on Thu Apr 19 14:43:49 2007 for IT++ by Doxygen 1.5.1