29 #ifndef MODULATOR_ND_H
30 #define MODULATOR_ND_H
35 #include <itpp/itexports.h>
78 llrcalc(llrcalc_in), demod_initialized(false) {}
154 QLLRvec probabilities(QLLR l);
160 void demodllrbit0(itpp::QLLR& llr)
const;
162 void demodllrbit1(itpp::QLLR& llr)
const;
164 void demodllrbit2(itpp::QLLR& llr)
const;
166 void demodmaxbit0(itpp::QLLR& maxllr)
const;
168 void demodmaxbit1(itpp::QLLR& maxllr)
const;
170 void demodmaxbit2(itpp::QLLR& maxllr)
const;
190 void update_LLR(
const Array<QLLRvec> &logP_apriori,
const ivec &s,
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);
319 void demodulate_soft_bits(
const vec &y,
320 const QLLRvec &LLR_apriori,
321 QLLRvec &LLR_aposteriori,
322 Soft_Demod_Method method = FULL_ENUM_LOGMAP);
345 void demodulate_soft_bits(
const vec &y,
const mat &H,
double sigma2,
346 const QLLRvec &LLR_apriori,
347 QLLRvec &LLR_aposteriori,
348 Soft_Demod_Method method = FULL_ENUM_LOGMAP);
369 QLLRvec demodulate_soft_bits(
const vec &y,
const mat &H,
double sigma2,
370 const QLLRvec &LLR_apriori,
371 Soft_Demod_Method method = FULL_ENUM_LOGMAP);
381 void demodulate_soft_bits(
const vec &y,
const vec &h,
double sigma2,
382 const QLLRvec &LLR_apriori,
383 QLLRvec &LLR_aposteriori);
406 void update_norm(
double &
norm,
int k,
int sold,
int snew,
const vec &ytH,
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);
515 void demodulate_soft_bits(
const cvec &y,
516 const QLLRvec &LLR_apriori,
517 QLLRvec &LLR_aposteriori,
518 Soft_Demod_Method method = FULL_ENUM_LOGMAP);
543 void demodulate_soft_bits(
const cvec &y,
const cmat &H,
double sigma2,
544 const QLLRvec &LLR_apriori,
545 QLLRvec &LLR_aposteriori,
546 Soft_Demod_Method method = FULL_ENUM_LOGMAP);
570 QLLRvec demodulate_soft_bits(
const cvec &y,
const cmat &H,
double sigma2,
571 const QLLRvec &LLR_apriori,
572 Soft_Demod_Method method = FULL_ENUM_LOGMAP);
582 void demodulate_soft_bits(
const cvec &y,
const cvec &h,
double sigma2,
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);
658 ND_UPAM(
int nt = 1,
int Mary = 2);
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);
724 ND_UQAM(
int nt = 1,
int Mary = 4);
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);
772 ND_UPSK(
int nt = 1,
int Mary = 4);
777 void set_M(
int nt = 1,
int Mary = 4);
780 void set_M(
int nt = 1, ivec Mary =
"4");
786 #endif // #ifndef MODULATOR_ND_H