modulator.h
Go to the documentation of this file.
#ifndef MODULATOR_H
#define MODULATOR_H
#include <itpp/base/mat.h>
#include <itpp/base/math/elem_math.h>
#include <itpp/base/math/log_exp.h>
#include <itpp/base/converters.h>
#include <itpp/base/math/min_max.h>
#include <itpp/itexports.h>
namespace itpp
{
enum Soft_Method {
LOGMAP,
APPROX
};
template <typename T>
class Modulator
{
public:
Modulator();
Modulator(const Vec<T>& symbols, const ivec& bits2symbols);
virtual ~Modulator() {}
virtual void set(const Vec<T>& symbols, const ivec& bits2symbols);
virtual int bits_per_symbol() const { return k; }
virtual int get_k() const { return k; }
virtual int get_M() const { return M; }
virtual Vec<T> get_symbols() const { return symbols; }
virtual ivec get_bits2symbols() const { return bits2symbols; }
virtual void modulate(const ivec& symbolnumbers, Vec<T>& output) const;
virtual Vec<T> modulate(const ivec& symbolnumbers) const;
virtual void demodulate(const Vec<T>& signal, ivec& output) const;
virtual ivec demodulate(const Vec<T>& signal) const;
virtual void modulate_bits(const bvec& bits, Vec<T>& output) const;
virtual Vec<T> modulate_bits(const bvec& bits) const;
virtual void demodulate_bits(const Vec<T>& signal, bvec& bits) const;
virtual bvec demodulate_bits(const Vec<T>& signal) const;
virtual void demodulate_soft_bits(const Vec<T>& rx_symbols, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
virtual vec demodulate_soft_bits(const Vec<T>& rx_symbols, double N0,
Soft_Method method = LOGMAP) const;
virtual void demodulate_soft_bits(const Vec<T>& rx_symbols,
const Vec<T>& channel,
double N0, vec& soft_bits,
Soft_Method method = LOGMAP) const;
virtual vec demodulate_soft_bits(const Vec<T>& rx_symbols,
const Vec<T>& channel,
double N0,
Soft_Method method = LOGMAP) const;
protected:
bool setup_done;
int k;
int M;
bmat bitmap;
ivec bits2symbols;
Vec<T> symbols;
imat S0;
imat S1;
void calculate_softbit_matrices();
};
// ----------------------------------------------------------------------
// Type definitions of Modulator_1D and Modulator_2D
// ----------------------------------------------------------------------
typedef Modulator<double> Modulator_1D;
typedef Modulator<std::complex<double> > Modulator_2D;
// ----------------------------------------------------------------------
// Implementation of templated Modulator members
// ----------------------------------------------------------------------
template<typename T>
Modulator<T>::Modulator() :
setup_done(false), k(0), M(0), bitmap(""), bits2symbols(""), symbols(""),
S0(""), S1("") {}
template<typename T>
Modulator<T>::Modulator(const Vec<T> &symbols, const ivec &bits2symbols)
{
set(symbols, bits2symbols);
}
template<typename T>
void Modulator<T>::set(const Vec<T> &in_symbols, const ivec &in_bits2symbols)
{
it_assert(in_symbols.size() == in_bits2symbols.size(),
"Modulator<T>::set(): Number of symbols and bits2symbols does not match");
it_assert(is_even(in_symbols.size()) && (in_symbols.size() > 0),
"Modulator<T>::set(): Number of symbols needs to be even and non-zero");
it_assert((max(in_bits2symbols) == in_bits2symbols.size() - 1)
&& (min(in_bits2symbols) == 0), "Modulator<T>::set(): Improper bits2symbol vector");
symbols = in_symbols;
bits2symbols = in_bits2symbols;
M = bits2symbols.size();
k = levels2bits(M);
bitmap.set_size(M, k);
for (int m = 0; m < M; m++) {
bitmap.set_row(bits2symbols(m), dec2bin(k, m));
}
calculate_softbit_matrices();
setup_done = true;
}
template<typename T>
void Modulator<T>::modulate(const ivec &symbolnumbers, Vec<T>& output) const
{
it_assert_debug(setup_done, "Modulator<T>::modulate(): Modulator not ready.");
output.set_size(symbolnumbers.length());
for (int i = 0; i < symbolnumbers.length(); i++)
output(i) = symbols(symbolnumbers(i));
}
template<typename T>
Vec<T> Modulator<T>::modulate(const ivec &symbolnumbers) const
{
Vec<T> output(symbolnumbers.length());
modulate(symbolnumbers, output);
return output;
}
template<typename T>
void Modulator<T>::demodulate(const Vec<T> &signal, ivec& output) const
{
it_assert_debug(setup_done, "Modulator<T>::demodulate(): Modulator not ready.");
double dist, mindist;
int closest;
output.set_size(signal.size());
for (int i = 0; i < signal.size(); i++) {
mindist = std::abs(symbols(0) - signal(i));
closest = 0;
for (int j = 1; j < M; j++) {
dist = std::abs(symbols(j) - signal(i));
if (dist < mindist) {
mindist = dist;
closest = j;
}
}
output(i) = closest;
}
}
template<typename T>
ivec Modulator<T>::demodulate(const Vec<T>& signal) const
{
ivec output(signal.length());
demodulate(signal, output);
return output;
}
template<typename T>
void Modulator<T>::modulate_bits(const bvec &bits, Vec<T> &output) const
{
it_assert_debug(setup_done, "Modulator<T>::modulate_bits(): Modulator not ready.");
// Check if some bits have to be cut and print warning message in such
// case.
if (bits.length() % k) {
it_warning("Modulator<T>::modulate_bits(): The number of input bits is not a multiple of k (number of bits per symbol). Remainder bits are not modulated.");
}
int no_symbols = bits.length() / k;
output.set_size(no_symbols);
for (int i = 0; i < no_symbols; i++) {
output(i) = symbols(bits2symbols(bin2dec(bits.mid(i * k, k))));
}
}
template<typename T>
Vec<T> Modulator<T>::modulate_bits(const bvec &bits) const
{
Vec<T> output;
modulate_bits(bits, output);
return output;
}
template<typename T>
void Modulator<T>::demodulate_bits(const Vec<T> &signal, bvec &bits) const
{
it_assert_debug(setup_done, "Modulator<T>::demodulate_bist(): Modulator not ready.");
double dist, mindist;
int closest;
bits.set_size(k*signal.size());
for (int i = 0; i < signal.size(); i++) {
mindist = std::abs(symbols(0) - signal(i));
closest = 0;
for (int j = 1; j < M; j++) {
dist = std::abs(symbols(j) - signal(i));
if (dist < mindist) {
mindist = dist;
closest = j;
}
}
bits.replace_mid(i*k, bitmap.get_row(closest));
}
}
template<typename T>
bvec Modulator<T>::demodulate_bits(const Vec<T> &signal) const
{
bvec bits;
demodulate_bits(signal, bits);
return bits;
}
template<typename T>
void Modulator<T>::demodulate_soft_bits(const Vec<T> &rx_symbols, double N0,
vec &soft_bits,
Soft_Method method) const
{
it_assert_debug(setup_done, "Modulator<T>::demodulate_soft_bits(): Modulator not ready.");
double P0, P1, d0min, d1min, temp;
vec metric(M);
soft_bits.set_size(k * rx_symbols.size());
if (method == LOGMAP) {
for (int l = 0; l < rx_symbols.size(); l++) {
for (int j = 0; j < M; j++) {
metric(j) = std::exp(-sqr(rx_symbols(l) - symbols(j)) / N0);
}
for (int i = 0; i < k; i++) {
P0 = P1 = 0;
for (int j = 0; j < (M >> 1); j++) {
P0 += metric(S0(i, j));
P1 += metric(S1(i, j));
}
soft_bits(l*k + i) = trunc_log(P0) - trunc_log(P1);
}
}
}
else { // method == APPROX
for (int l = 0; l < rx_symbols.size(); l++) {
for (int j = 0; j < M; j++) {
metric(j) = sqr(rx_symbols(l) - symbols(j));
}
for (int i = 0; i < k; i++) {
d0min = d1min = std::numeric_limits<double>::max();
for (int j = 0; j < (M >> 1); j++) {
temp = metric(S0(i, j));
if (temp < d0min) { d0min = temp; }
temp = metric(S1(i, j));
if (temp < d1min) { d1min = temp; }
}
soft_bits(l*k + i) = (-d0min + d1min) / N0;
}
}
}
}
template<typename T>
vec Modulator<T>::demodulate_soft_bits(const Vec<T> &rx_symbols,
double N0,
Soft_Method method) const
{
vec output;
demodulate_soft_bits(rx_symbols, N0, output, method);
return output;
}
template<typename T>
void Modulator<T>::demodulate_soft_bits(const Vec<T> &rx_symbols,
const Vec<T> &channel, double N0,
vec &soft_bits,
Soft_Method method) const
{
it_assert_debug(setup_done, "Modulator_2D::demodulate_soft_bits(): Modulator not ready.");
double P0, P1, d0min, d1min, temp;
vec metric(M);
soft_bits.set_size(k * rx_symbols.size());
if (method == LOGMAP) {
for (int l = 0; l < rx_symbols.size(); l++) {
for (int j = 0; j < M; j++) {
metric(j) = std::exp(-sqr(rx_symbols(l) - channel(l) * symbols(j))
/ N0);
}
for (int i = 0; i < k; i++) {
P0 = P1 = 0;
for (int j = 0; j < (M >> 1); j++) {
P0 += metric(S0(i, j));
P1 += metric(S1(i, j));
}
soft_bits(l*k + i) = trunc_log(P0) - trunc_log(P1);
}
}
}
else { // method == APPROX
for (int l = 0; l < rx_symbols.size(); l++) {
for (int j = 0; j < M; j++) {
metric(j) = sqr(rx_symbols(l) - channel(l) * symbols(j));
}
for (int i = 0; i < k; i++) {
d0min = d1min = std::numeric_limits<double>::max();
for (int j = 0; j < (M >> 1); j++) {
temp = metric(S0(i, j));
if (temp < d0min) { d0min = temp; }
temp = metric(S1(i, j));
if (temp < d1min) { d1min = temp; }
}
soft_bits(l*k + i) = (-d0min + d1min) / N0;
}
}
}
}
template<typename T>
vec Modulator<T>::demodulate_soft_bits(const Vec<T> &rx_symbols,
const Vec<T> &channel,
double N0,
Soft_Method method) const
{
vec output;
demodulate_soft_bits(rx_symbols, channel, N0, output, method);
return output;
}
template<typename T>
void Modulator<T>::calculate_softbit_matrices()
{
int count0, count1;
// Allocate storage space for the result matrices:
S0.set_size(k, M >> 1, false);
S1.set_size(k, M >> 1, false);
for (int i = 0; i < k; i++) {
count0 = 0;
count1 = 0;
for (int j = 0; j < M; j++) {
if (bitmap(j, i) == bin(0)) {
S0(i, count0++) = j;
}
else {
S1(i, count1++) = j;
}
}
}
}
// ----------------------------------------------------------------------
// Instantiations
// ----------------------------------------------------------------------
ITPP_EXPORT_TEMPLATE template class ITPP_EXPORT Modulator<double>;
ITPP_EXPORT_TEMPLATE template class ITPP_EXPORT Modulator<std::complex<double> >;
// ----------------------------------------------------------------------
// QAM : Modulator_2D
// ----------------------------------------------------------------------
class ITPP_EXPORT QAM : public Modulator<std::complex<double> >
{
public:
QAM() {}
QAM(int M) { set_M(M); }
virtual ~QAM() { }
void set_M(int M);
void demodulate_bits(const cvec& signal, bvec& bits) const;
bvec demodulate_bits(const cvec& signal) const;
protected:
int L;
double scaling_factor;
};
// ----------------------------------------------------------------------
// PSK : Modulator<std::complex<double> >
// ----------------------------------------------------------------------
class ITPP_EXPORT PSK : public Modulator<std::complex<double> >
{
public:
PSK() {}
PSK(int M) { set_M(M); }
virtual ~PSK() { }
void set_M(int M);
void demodulate_bits(const cvec& signal, bvec& bits) const;
bvec demodulate_bits(const cvec& signal) const;
};
// ----------------------------------------------------------------------
// QPSK : PSK : Modulator<std::complex<double> >
// ----------------------------------------------------------------------
class ITPP_EXPORT QPSK : public PSK
{
public:
QPSK(): PSK(4) {}
virtual ~QPSK() {}
virtual void demodulate_soft_bits(const cvec& rx_symbols, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
vec demodulate_soft_bits(const cvec& rx_symbols, double N0,
Soft_Method method = LOGMAP) const;
virtual void demodulate_soft_bits(const cvec& rx_symbols,
const cvec& channel, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
vec demodulate_soft_bits(const cvec& rx_symbols, const cvec& channel,
double N0, Soft_Method method = LOGMAP) const;
};
// ----------------------------------------------------------------------
// BPSK_c : PSK : Modulator<std::complex<double> >
// ----------------------------------------------------------------------
class ITPP_EXPORT BPSK_c : public PSK
{
public:
BPSK_c(): PSK(2) {}
virtual ~BPSK_c() {}
void modulate_bits(const bvec& bits, cvec& output) const;
cvec modulate_bits(const bvec& bits) const;
void demodulate_bits(const cvec& signal, bvec& output) const;
bvec demodulate_bits(const cvec& signal) const;
virtual void demodulate_soft_bits(const cvec& rx_symbols, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
vec demodulate_soft_bits(const cvec& rx_symbols, double N0,
Soft_Method method = LOGMAP) const;
virtual void demodulate_soft_bits(const cvec& rx_symbols,
const cvec& channel, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
vec demodulate_soft_bits(const cvec& rx_symbols, const cvec& channel,
double N0, Soft_Method method = LOGMAP) const;
};
// ----------------------------------------------------------------------
// BPSK : Modulator<double>
// ----------------------------------------------------------------------
class ITPP_EXPORT BPSK : public Modulator<double>
{
public:
BPSK(): Modulator<double>("1.0 -1.0", "0 1") {}
virtual ~BPSK() {}
void modulate_bits(const bvec& bits, vec& output) const;
vec modulate_bits(const bvec& bits) const;
void demodulate_bits(const vec& signal, bvec& output) const;
bvec demodulate_bits(const vec& signal) const;
virtual void demodulate_soft_bits(const vec& rx_symbols, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
vec demodulate_soft_bits(const vec& rx_symbols, double N0,
Soft_Method method = LOGMAP) const;
virtual void demodulate_soft_bits(const vec& rx_symbols,
const vec& channel, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
vec demodulate_soft_bits(const vec& rx_symbols, const vec& channel,
double N0, Soft_Method method = LOGMAP) const;
};
// ----------------------------------------------------------------------
// PAM_c : Modulator<std::complex<double> >
// ----------------------------------------------------------------------
class ITPP_EXPORT PAM_c : public Modulator<std::complex<double> >
{
public:
PAM_c() {}
PAM_c(int M) { set_M(M); }
virtual ~PAM_c() {}
void set_M(int M);
void demodulate_bits(const cvec& signal, bvec& output) const;
bvec demodulate_bits(const cvec& signal) const;
virtual void demodulate_soft_bits(const cvec& rx_symbols, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
virtual vec demodulate_soft_bits(const cvec& rx_symbols, double N0,
Soft_Method method = LOGMAP) const;
virtual void demodulate_soft_bits(const cvec& rx_symbols,
const cvec& channel, double N0,
vec& soft_bits,
Soft_Method method = LOGMAP) const;
virtual vec demodulate_soft_bits(const cvec& rx_symbols,
const cvec& channel, double N0,
Soft_Method method = LOGMAP) const;
protected:
double scaling_factor;
};
// ----------------------------------------------------------------------
// PAM : Modulator<double>
// ----------------------------------------------------------------------
class ITPP_EXPORT PAM : public Modulator<double>
{
public:
PAM() {}
PAM(int M) { set_M(M); }
virtual ~PAM() {}
void set_M(int M);
void demodulate_bits(const vec& signal, bvec& output) const;
bvec demodulate_bits(const vec& signal) const;
protected:
double scaling_factor;
};
} // namespace itpp
#endif // #ifndef MODULATOR_H
itpp::Array
General array class.
Definition array.h:105
itpp::Array::mid
Array< T > mid(int pos, int n) const
Get n elements of the array starting from pos.
Definition array.h:377
itpp::Array::size
int size() const
Returns the number of data elements in the array object.
Definition array.h:155
itpp::Array::set_size
void set_size(int n, bool copy=false)
Resizing an Array<T>.
Definition array.h:257
itpp::Array::length
int length() const
Returns the number of data elements in the array object.
Definition array.h:157
itpp::BPSK_c
BPSK modulator with complex symbols.
Definition modulator.h:776
itpp::BPSK_c::~BPSK_c
virtual ~BPSK_c()
Destructor.
Definition modulator.h:781
itpp::BPSK_c::BPSK_c
BPSK_c()
Constructor.
Definition modulator.h:779
itpp::BPSK
BPSK modulator with real symbols.
Definition modulator.h:877
itpp::BPSK::~BPSK
virtual ~BPSK()
Destructor.
Definition modulator.h:882
itpp::BPSK::BPSK
BPSK()
Constructor.
Definition modulator.h:880
itpp::Modulator
General modulator for 1D or 2D signal constellations.
Definition modulator.h:76
itpp::Modulator::Modulator
Modulator(const Vec< T > &symbols, const ivec &bits2symbols)
Constructor.
Definition modulator.h:285
itpp::Modulator::demodulate_soft_bits
virtual vec demodulate_soft_bits(const Vec< T > &rx_symbols, const Vec< T > &channel, double N0, Soft_Method method=LOGMAP) const
Soft demodulator for fading channels.
Definition modulator.h:519
itpp::Modulator::get_bits2symbols
virtual ivec get_bits2symbols() const
Get the bitmap, which maps input bits into symbols.
Definition modulator.h:117
itpp::Modulator::bitmap
bmat bitmap
Bit to symbol mapping table (size: M x k)
Definition modulator.h:241
itpp::Modulator::symbols
Vec< T > symbols
Corresponding modulation symbols (size: M)
Definition modulator.h:245
itpp::Modulator::get_k
virtual int get_k() const
Returns number of bits per symbol.
Definition modulator.h:92
itpp::Modulator::k
int k
Number of bits per modulation symbol.
Definition modulator.h:237
itpp::Modulator::bits_per_symbol
virtual int bits_per_symbol() const
Returns number of bits per symbol.
Definition modulator.h:89
itpp::Modulator::bits2symbols
ivec bits2symbols
Bit to symbol mapping in decimal form (size: M)
Definition modulator.h:243
itpp::Modulator::demodulate_soft_bits
virtual void demodulate_soft_bits(const Vec< T > &rx_symbols, double N0, vec &soft_bits, Soft_Method method=LOGMAP) const
Soft demodulator for AWGN channels.
Definition modulator.h:417
itpp::Modulator::modulate
virtual Vec< T > modulate(const ivec &symbolnumbers) const
Modulation of symbols.
Definition modulator.h:322
itpp::Modulator::demodulate
virtual void demodulate(const Vec< T > &signal, ivec &output) const
Demodulation of symbols.
Definition modulator.h:331
itpp::Modulator::setup_done
bool setup_done
Setup indicator.
Definition modulator.h:235
itpp::Modulator::get_M
virtual int get_M() const
Returns number of modulation symbols.
Definition modulator.h:95
itpp::Modulator::demodulate
virtual ivec demodulate(const Vec< T > &signal) const
Demodulation of symbols.
Definition modulator.h:353
itpp::Modulator::modulate_bits
virtual void modulate_bits(const bvec &bits, Vec< T > &output) const
Modulation of bits.
Definition modulator.h:362
itpp::Modulator::modulate_bits
virtual Vec< T > modulate_bits(const bvec &bits) const
Modulation of bits.
Definition modulator.h:378
itpp::Modulator::demodulate_bits
virtual bvec demodulate_bits(const Vec< T > &signal) const
Hard demodulation of bits.
Definition modulator.h:408
itpp::Modulator::demodulate_bits
virtual void demodulate_bits(const Vec< T > &signal, bvec &bits) const
Hard demodulation of bits.
Definition modulator.h:386
itpp::Modulator::Modulator_2D
Modulator< std::complex< double > > Modulator_2D
Definition of 2D Modulator (with complex symbols)
Definition modulator.h:272
itpp::Modulator::S1
imat S1
Matrix where row k contains the constellation points with '1' in bit position k.
Definition modulator.h:251
itpp::Modulator::Modulator
Modulator()
Default constructor.
Definition modulator.h:280
itpp::Modulator::M
int M
Number of modulation symbols.
Definition modulator.h:239
itpp::Modulator::get_symbols
virtual Vec< T > get_symbols() const
Get the symbol values used in the modulator.
Definition modulator.h:98
itpp::Modulator::demodulate_soft_bits
virtual void demodulate_soft_bits(const Vec< T > &rx_symbols, const Vec< T > &channel, double N0, vec &soft_bits, Soft_Method method=LOGMAP) const
Soft demodulator for fading channels.
Definition modulator.h:472
itpp::Modulator::demodulate_soft_bits
virtual vec demodulate_soft_bits(const Vec< T > &rx_symbols, double N0, Soft_Method method=LOGMAP) const
Soft demodulator for AWGN channels.
Definition modulator.h:462
itpp::Modulator::set
virtual void set(const Vec< T > &symbols, const ivec &bits2symbols)
Set the constellation to use in the modulator.
Definition modulator.h:291
itpp::Modulator::calculate_softbit_matrices
void calculate_softbit_matrices()
This function calculates the soft bit mapping matrices S0 and S1.
Definition modulator.h:530
itpp::Modulator::modulate
virtual void modulate(const ivec &symbolnumbers, Vec< T > &output) const
Modulation of symbols.
Definition modulator.h:313
itpp::Modulator::S0
imat S0
Matrix where row k contains the constellation points with '0' in bit position k.
Definition modulator.h:248
itpp::Modulator::~Modulator
virtual ~Modulator()
Destructor.
Definition modulator.h:83
itpp::Modulator::Modulator_1D
Modulator< double > Modulator_1D
Definition of 1D Modulator (with real symbols)
Definition modulator.h:266
itpp::PAM_c
M-ary PAM modulator with complex symbols.
Definition modulator.h:969
itpp::PAM_c::PAM_c
PAM_c()
Default Constructor.
Definition modulator.h:972
itpp::PAM_c::scaling_factor
double scaling_factor
Scaling factor used to normalize the average energy to 1.
Definition modulator.h:1080
itpp::PAM_c::PAM_c
PAM_c(int M)
Constructor.
Definition modulator.h:974
itpp::PAM_c::~PAM_c
virtual ~PAM_c()
Destructor.
Definition modulator.h:976
itpp::PAM
M-ary PAM modulator with real symbols.
Definition modulator.h:1105
itpp::PAM::scaling_factor
double scaling_factor
Scaling factor used to normalize the average energy to 1.
Definition modulator.h:1123
itpp::PAM::PAM
PAM(int M)
Constructor.
Definition modulator.h:1110
itpp::PAM::PAM
PAM()
Default Constructor.
Definition modulator.h:1108
itpp::PAM::~PAM
virtual ~PAM()
Destructor.
Definition modulator.h:1112
itpp::PSK
M-ary PSK modulator.
Definition modulator.h:636
itpp::PSK::PSK
PSK()
Default Constructor.
Definition modulator.h:639
itpp::PSK::PSK
PSK(int M)
Class constructor.
Definition modulator.h:641
itpp::PSK::~PSK
virtual ~PSK()
Destructor.
Definition modulator.h:643
itpp::QAM
M-ary QAM modulator with square lattice.
Definition modulator.h:587
itpp::QAM::scaling_factor
double scaling_factor
Scaling factor of square QAM constellation (sqrt((M-1)*2/3))
Definition modulator.h:607
itpp::QAM::~QAM
virtual ~QAM()
Destructor.
Definition modulator.h:594
itpp::QAM::QAM
QAM()
Default Constructor.
Definition modulator.h:590
itpp::QAM::QAM
QAM(int M)
Class Constructor.
Definition modulator.h:592
itpp::QAM::L
int L
The square-root of M.
Definition modulator.h:605
itpp::QPSK
QPSK modulator.
Definition modulator.h:678
itpp::QPSK::QPSK
QPSK()
Class Constructor.
Definition modulator.h:681
itpp::QPSK::~QPSK
virtual ~QPSK()
Destructor.
Definition modulator.h:683
itpp::bin
Binary arithmetic (boolean) class.
Definition binary.h:57
converters.h
Definitions of converters between different vector and matrix types.
elem_math.h
Elementary mathematical functions - header file.
it_warning
#define it_warning(s)
Display a warning message.
Definition itassert.h:173
it_assert_debug
#define it_assert_debug(t, s)
Abort if t is not true and NDEBUG is not defined.
Definition itassert.h:107
it_assert
#define it_assert(t, s)
Abort if t is not true.
Definition itassert.h:94
itpp::trunc_log
double trunc_log(double x)
Truncated natural logarithm function.
Definition log_exp.h:115
itpp::levels2bits
int levels2bits(int n)
Calculate the number of bits needed to represent n different values (levels).
Definition log_exp.h:92
itpp::min
T min(const Vec< T > &in)
Minimum value of vector.
Definition min_max.h:125
itpp::max
T max(const Vec< T > &v)
Maximum value of vector.
Definition min_max.h:45
itpp::is_even
bool is_even(int x)
Return true if x is an even integer.
Definition misc.h:122
itpp::sqr
vec sqr(const cvec &data)
Absolute square of elements.
Definition elem_math.cpp:36
itpp::Soft_Method
Soft_Method
Soft demodulation methods.
Definition modulator.h:47
itpp::LOGMAP
@ LOGMAP
Log-MAP full calculation.
Definition modulator.h:48
itpp::APPROX
@ APPROX
Approximate faster method.
Definition modulator.h:49
log_exp.h
Logarithmic and exponenential functions - header file.
mat.h
Matrix Class Definitions.
bmat
Mat< bin > bmat
bin matrix
Definition mat.h:508
min_max.h
Minimum and maximum functions on vectors and matrices.
itpp
itpp namespace
Definition itmex.h:37
itpp::bin2dec
ITPP_EXPORT int bin2dec(const bvec &inbvec, bool msb_first=true)
Convert a bvec to decimal int with the first bit as MSB if msb_first == true.
itpp::dec2bin
ITPP_EXPORT bvec dec2bin(int length, int index)
Convert a decimal int index to bvec using length bits in the representation.

Generated on Mon Jun 10 2024 11:49:21 for IT++ by Doxygen 1.9.8