35#include <itpp/itexports.h>
191 QLLR scaled_norm, QLLRvec &num, QLLRvec &denom);
213 QLLR scaled_norm,
int j, QLLRvec &num, QLLRvec &denom);
260 void modulate_bits(
const bvec &bits, vec &symbols)
const;
263 vec modulate_bits(
const bvec &bits)
const;
283 void init_soft_demodulator(
const itpp::mat& H,
const double& sigma2);
320 const QLLRvec &LLR_apriori,
321 QLLRvec &LLR_aposteriori,
346 const QLLRvec &LLR_apriori,
347 QLLRvec &LLR_aposteriori,
370 const QLLRvec &LLR_apriori,
382 const QLLRvec &LLR_apriori,
383 QLLRvec &LLR_aposteriori);
407 const mat &HtH,
const ivec &s);
410 void hxnormupdate(itpp::vec& Hx,
unsigned& bitstring,
unsigned& ind,
unsigned bit);
413 void yxnormupdate(
double& yx, itpp::QLLR& lapr,
unsigned& bitstring,
unsigned& ind,
unsigned bit);
459 void modulate_bits(
const bvec &bits, cvec &symbols)
const;
462 cvec modulate_bits(
const bvec &bits)
const;
482 void init_soft_demodulator(
const itpp::cmat& H,
const double& sigma2);
516 const QLLRvec &LLR_apriori,
517 QLLRvec &LLR_aposteriori,
544 const QLLRvec &LLR_apriori,
545 QLLRvec &LLR_aposteriori,
571 const QLLRvec &LLR_apriori,
583 const QLLRvec &LLR_apriori,
584 QLLRvec &LLR_aposteriori);
598 void hxnormupdate(itpp::cvec& Hx,
unsigned& bitstring,
unsigned& ind,
unsigned bit);
599 void yxnormupdate(
double& yx, itpp::QLLR& lapr,
unsigned& bitstring,
unsigned& ind,
unsigned bit);
663 void set_M(
int nt = 1,
int Mary = 2);
666 void set_M(
int nt = 1, ivec Mary =
"2");
691 int sphere_decoding(
const vec &y,
const mat &H,
double rmin,
double rmax,
692 double stepup, QLLRvec &detected_bits);
696 int sphere_search_SE(
const vec &y,
const mat &H,
const imat &zrange,
697 double r, ivec &zhat);
701 inline int sign_nozero_i(
int a) {
702 return (a > 0 ? 1 : -1);
704 inline int sign_nozero_i(
double a) {
705 return (a > 0.0 ? 1 : -1);
729 void set_M(
int nt = 1,
int Mary = 4);
732 void set_M(
int nt = 1, ivec Mary =
"4");
751 void set_constellation_points(
const int nth,
const cvec& inConstellation,
const ivec& in_bit2symbols);
777 void set_M(
int nt = 1,
int Mary = 4);
780 void set_M(
int nt = 1, ivec Mary =
"4");
Definition of Array class (container)
Import/Export definitions for some templates defined in base folder.
Log-likelihood algebra calculation unit.
Base class for vector (MIMO) channel modulator/demodulators with complex valued components.
friend ITPP_EXPORT std::ostream & operator<<(std::ostream &os, const Modulator_NCD &m)
Print some properties of the MIMO modulator (mainly to aid debugging)
Modulator_NCD()
Constructor.
void demodulate_soft_bits(const cvec &y, const QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori, Soft_Demod_Method method=FULL_ENUM_LOGMAP)
Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation...
itpp::Array< itpp::Array< itpp::cvec > > hspacings
The spacing between different constellation points multiplied by the different H columns.
itpp::Array< itpp::vec > yspacings
The spacing between different constellation points scaled by different y elements.
itpp::cmat H
Complex-valued channel matrix.
Array< cvec > symbols
Vectors of modulation symbols (along each dimension)
virtual ~Modulator_NCD()
Destructor.
itpp::QLLRvec Qnorms
Norms part depending on both H and y.
double gaussnorm
The normalization factor in the exponent (in front of the square norm) in the Gaussian distribution.
Array< ivec > bits2symbols
Bit pattern in decimal form ordered and the corresponding symbols (one pattern per dimension)
ivec get_k() const
Get number of bits per modulation symbol per dimension.
int nt
Number of dimensions.
void demodllrbit2(itpp::QLLR &llr) const
Hardcoded implementation of 3:rd bit demodulation.
ivec bits_per_symbol() const
Get number of bits per modulation symbol per dimension.
int get_dim() const
Get number of dimensions.
itpp::vec hnorms
Norms part dependent on H.
void demodmaxbit1(itpp::QLLR &maxllr) const
Hardcoded implementation of 2:nd bit demodulation.
ivec M
Number of modulation symbols along each dimension.
void update_LLR(const Array< QLLRvec > &logP_apriori, const ivec &s, QLLR scaled_norm, QLLRvec &num, QLLRvec &denom)
Update LLR (for internal use)
itpp::ivec bitcumsum
The cumulative sum of bits in the symbol vector.
ivec k
Number of bits per modulation symbol.
itpp::QLLRvec llrapr
A prioi information.
LLR_calc_unit get_llrcalc() const
Get LLR calculation unit.
Array< ivec > get_bits2symbols() const
Get bit pattern in decimal.
Soft_Demod_Method
Soft demodulation method.
@ FULL_ENUM_MAXLOG
Max-Log demodulation by "brute-force" enumeration of all points.
@ FULL_ENUM_LOGMAP
Log-MAP demodulation by "brute-force" enumeration of all points.
@ ZF_LOGMAP
Zero-Forcing Log-MAP approximated demodulation.
void demodllrbit1(itpp::QLLR &llr) const
Hardcoded implementation of 2:nd bit demodulation.
void marginalize_bits(itpp::QLLRvec &llr, Soft_Demod_Method method) const
Marginalize (sum) over the bits.
LLR_calc_unit llrcalc
LLR calculation unit.
itpp::Array< itpp::Vec< unsigned > > gray2dec
The Gray to decimal mapping.
int nb
Number of bits in the symbol vector.
ivec get_M() const
Get number of modulation symbols per dimension.
virtual ~Modulator_ND()
Destructor.
QLLRvec probabilities(QLLR l)
Convert LLR to log-probabilities.
Modulator_ND(LLR_calc_unit llrcalc_in=LLR_calc_unit())
Default constructor.
void demodmaxbit0(itpp::QLLR &maxllr) const
Hardcoded implementation of 1:st bit demodulation.
Array< bmat > get_bitmap() const
Get Bit mapping table.
Array< bmat > bitmap
Bit mapping table (one table per dimension)
void set_llrcalc(LLR_calc_unit llrcalc_in)
Set LLR calculation unit.
void demodllrbit0(itpp::QLLR &llr) const
Hardcoded implementation of 1:st bit demodulation.
void demodmaxbit2(itpp::QLLR &maxllr) const
Hardcoded implementation of 3:rd bit demodulation.
bool demod_initialized
Flag indicating whether the demodulator has been initialized.
itpp::ivec bpos2cpos
The bit to column mapping.
Base class for N-dimensional vector (MIMO) channel modulators/demodulators with real-valued component...
friend ITPP_EXPORT std::ostream & operator<<(std::ostream &os, const Modulator_NRD &m)
Output some properties of the MIMO modulator (mainly to aid debugging)
virtual ~Modulator_NRD()
Destructor.
void update_norm(double &norm, int k, int sold, int snew, const vec &ytH, const mat &HtH, const ivec &s)
Update residual norm (for internal use).
void demodulate_soft_bits(const vec &y, const QLLRvec &LLR_apriori, QLLRvec &LLR_aposteriori, Soft_Demod_Method method=FULL_ENUM_LOGMAP)
Soft MAP demodulation for multidimensional channel, by "brute-force" enumeration of all constellation...
void yxnormupdate(double &yx, itpp::QLLR &lapr, unsigned &bitstring, unsigned &ind, unsigned bit)
Calculation of the remaining part of the norms that depends both on H and y.
void hxnormupdate(itpp::vec &Hx, unsigned &bitstring, unsigned &ind, unsigned bit)
Calculation of the part of the norms that depends on H.
itpp::Array< itpp::vec > yspacings
The spacing between different constellation points scaled by different y elements.
itpp::mat H
Real channel matrix.
Array< vec > symbols
Vectors of modulation symbols (along each dimension)
Modulator_NRD()
Constructor.
itpp::Array< itpp::Array< itpp::vec > > hspacings
The spacing between different constellation points multiplied by the different H columns.
ND_UPAM(int nt=1, int Mary=2)
Constructor.
virtual ~ND_UPAM()
Destructor.
virtual ~ND_UPSK()
Destructor.
ND_UPSK(int nt=1, int Mary=4)
Constructor.
ivec L
the square root of M
ND_UQAM(int nt=1, int Mary=4)
Constructor.
virtual ~ND_UQAM()
Destructor.
double norm(const cvec &v)
Calculate the 2-norm: norm(v)=sqrt(sum(abs(v).^2))
Class for numerically efficient log-likelihood algebra.
std::ostream & operator<<(std::ostream &output, const bin &inbin)
Output stream of bin.
Templated Vector Class Definitions.