#include <modulator.h>
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. |
This class can also perform soft demodulation. 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 shall equal
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.
|
Constructor.
|
|
Destructor.
|
|
This function calculates the soft bit mapping matrices S0 and S1.
|
|
Demodulation of symbols.
|
|
Demodulation of bits.
|
|
Soft demodulator for fading channels. This function calculates
|
|
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 .
|
|
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
|
|
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
|
|
Get the bitmap used in the modulator.
|
|
Get the symbol values used in the modulator.
|
|
Modulation of symbols.
|
|
Modulation of bits.
|
|
Set the symbol values to use in the modulator.
|
|
Bit mapping table.
|
|
Number of bits per modulation symbol.
|
|
Number of modulation symbols.
|
|
Used by the soft demodulator functions: Matrix where row k contains the constellation points with a zero in bit position k.
|
|
Used by the soft demodulator functions: Matrix where row k contains the constellation points with a one in bit position k.
|
|
Internal protected state variable.
|
|
Vector of modulation symbols.
|