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::PAM::PAM
PAM()
Default Constructor.
Definition: modulator.h:1108
itpp::PAM_c::scaling_factor
double scaling_factor
Scaling factor used to normalize the average energy to 1.
Definition: modulator.h:1080
itpp::QAM::QAM
QAM()
Default Constructor.
Definition: modulator.h:590
itpp::PSK::PSK
PSK(int M)
Class constructor.
Definition: modulator.h:641
itpp::Modulator
General modulator for 1D or 2D signal constellations.
Definition: modulator.h:75
itpp::QAM::L
int L
The square-root of M.
Definition: modulator.h:605
itpp::Modulator::k
int k
Number of bits per modulation symbol.
Definition: modulator.h:237
itpp::QPSK
QPSK modulator.
Definition: modulator.h:677
itpp::PAM_c::PAM_c
PAM_c()
Default Constructor.
Definition: modulator.h:972
itpp::QAM::scaling_factor
double scaling_factor
Scaling factor of square QAM constellation (sqrt((M-1)*2/3))
Definition: modulator.h:607
itpp::Modulator::get_M
virtual int get_M() const
Returns number of modulation symbols.
Definition: modulator.h:95
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::bits_per_symbol
virtual int bits_per_symbol() const
Returns number of bits per symbol.
Definition: modulator.h:89
itpp::is_even
bool is_even(int x)
Return true if x is an even integer.
Definition: misc.h:122
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::PSK::~PSK
virtual ~PSK()
Destructor.
Definition: modulator.h:643
itpp::BPSK
BPSK modulator with real symbols.
Definition: modulator.h:876
itpp::Vec::set_size
void set_size(int size, bool copy=false)
Set length of vector. if copy = true then keeping the old values.
Definition: vec.h:663
it_assert
#define it_assert(t, s)
Abort if t is not true.
Definition: itassert.h:94
log_exp.h
Logarithmic and exponenential functions - header file.
itpp::Modulator::~Modulator
virtual ~Modulator()
Destructor.
Definition: modulator.h:83
min_max.h
Minimum and maximum functions on vectors and matrices.
itpp::QAM::QAM
QAM(int M)
Class Constructor.
Definition: modulator.h:592
it_assert_debug
#define it_assert_debug(t, s)
Abort if t is not true and NDEBUG is not defined.
Definition: itassert.h:107
itpp::APPROX
Approximate faster method.
Definition: modulator.h:49
itpp::Modulator::symbols
Vec< T > symbols
Corresponding modulation symbols (size: M)
Definition: modulator.h:245
itpp::Modulator::S0
imat S0
Matrix where row k contains the constellation points with '0' in bit position k.
Definition: modulator.h:248
itpp::BPSK_c
BPSK modulator with complex symbols.
Definition: modulator.h:775
itpp::PAM::~PAM
virtual ~PAM()
Destructor.
Definition: modulator.h:1112
itpp::PAM_c::~PAM_c
virtual ~PAM_c()
Destructor.
Definition: modulator.h:976
converters.h
Definitions of converters between different vector and matrix types.
itpp::min
T min(const Vec< T > &in)
Minimum value of vector.
Definition: min_max.h:125
itpp::PAM
M-ary PAM modulator with real symbols.
Definition: modulator.h:1104
itpp::QAM
M-ary QAM modulator with square lattice.
Definition: modulator.h:586
itpp::PAM::scaling_factor
double scaling_factor
Scaling factor used to normalize the average energy to 1.
Definition: modulator.h:1123
mat.h
Matrix Class Definitions.
itpp::exp
vec exp(const vec &x)
Exp of the elements of a vector x.
Definition: log_exp.h:155
itpp::max
T max(const Vec< T > &v)
Maximum value of vector.
Definition: min_max.h:45
itpp::Modulator::Modulator_2D
Modulator< std::complex< double > > Modulator_2D
Definition of 2D Modulator (with complex symbols)
Definition: modulator.h:272
itpp::Modulator::get_k
virtual int get_k() const
Returns number of bits per symbol.
Definition: modulator.h:92
itpp::trunc_log
double trunc_log(double x)
Truncated natural logarithm function.
Definition: log_exp.h:115
itpp::PSK::PSK
PSK()
Default Constructor.
Definition: modulator.h:639
itpp::PAM_c::PAM_c
PAM_c(int M)
Constructor.
Definition: modulator.h:974
itpp::PAM_c
M-ary PAM modulator with complex symbols.
Definition: modulator.h:968
itpp::QPSK::~QPSK
virtual ~QPSK()
Destructor.
Definition: modulator.h:683
itpp
itpp namespace
Definition: itmex.h:36
itpp::Modulator::Modulator
Modulator()
Default constructor.
Definition: modulator.h:280
itpp::Modulator::modulate
virtual void modulate(const ivec &symbolnumbers, Vec< T > &output) const
Modulation of symbols.
Definition: modulator.h:313
itpp::QPSK::QPSK
QPSK()
Class Constructor.
Definition: modulator.h:681
itpp::dec2bin
ITPP_EXPORT bvec dec2bin(int length, int index)
Convert a decimal int index to bvec using length bits in the representation.
itpp::Vec::size
int size() const
The size of the vector.
Definition: vec.h:271
itpp::Modulator::Modulator_1D
Modulator< double > Modulator_1D
Definition of 1D Modulator (with real symbols)
Definition: modulator.h:266
itpp::BPSK::BPSK
BPSK()
Constructor.
Definition: modulator.h:880
itpp::Modulator::modulate_bits
virtual void modulate_bits(const bvec &bits, Vec< T > &output) const
Modulation of bits.
Definition: modulator.h:362
itpp::sqr
vec sqr(const cvec &data)
Absolute square of elements.
Definition: elem_math.cpp:36
itpp::PAM::PAM
PAM(int M)
Constructor.
Definition: modulator.h:1110
itpp::Modulator::demodulate
virtual void demodulate(const Vec< T > &signal, ivec &output) const
Demodulation of symbols.
Definition: modulator.h:331
itpp::Soft_Method
Soft_Method
Soft demodulation methods.
Definition: modulator.h:47
it_warning
#define it_warning(s)
Display a warning message.
Definition: itassert.h:173
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::calculate_softbit_matrices
void calculate_softbit_matrices()
This function calculates the soft bit mapping matrices S0 and S1.
Definition: modulator.h:530
itpp::bin
Binary arithmetic (boolean) class.
Definition: binary.h:56
itpp::BPSK::~BPSK
virtual ~BPSK()
Destructor.
Definition: modulator.h:882
itpp::LOGMAP
Log-MAP full calculation.
Definition: modulator.h:48
itpp::Vec< T >
itpp::PSK
M-ary PSK modulator.
Definition: modulator.h:635
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::BPSK_c::BPSK_c
BPSK_c()
Constructor.
Definition: modulator.h:779
itpp::QAM::~QAM
virtual ~QAM()
Destructor.
Definition: modulator.h:594
itpp::abs
bin abs(const bin &inbin)
absolute value of bin
Definition: binary.h:174
itpp::BPSK_c::~BPSK_c
virtual ~BPSK_c()
Destructor.
Definition: modulator.h:781
itpp::Vec::length
int length() const
The size of the vector.
Definition: vec.h:269
itpp::Modulator::get_bits2symbols
virtual ivec get_bits2symbols() const
Get the bitmap, which maps input bits into symbols.
Definition: modulator.h:117
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::Modulator::bitmap
bmat bitmap
Bit to symbol mapping table (size: M x k)
Definition: modulator.h:241
elem_math.h
Elementary mathematical functions - header file.
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::setup_done
bool setup_done
Setup indicator.
Definition: modulator.h:235
itpp::levels2bits
int levels2bits(int n)
Calculate the number of bits needed to represent n different values (levels).
Definition: log_exp.h:92
bmat
Mat< bin > bmat
bin matrix
Definition: mat.h:508
itpp::Modulator::bits2symbols
ivec bits2symbols
Bit to symbol mapping in decimal form (size: M)
Definition: modulator.h:243

Generated on Thu Aug 20 2015 21:02:50 for IT++ by Doxygen 1.8.9.1