IT++ Logo
exit.h
Go to the documentation of this file.
1 
29 #ifndef EXIT_H
30 #define EXIT_H
31 
32 #include <itpp/itbase.h>
33 #include <itpp/comm/modulator.h> //BPSK class for a priori information generation
34 #include <itpp/itexports.h>
35 
36 namespace itpp
37 {
38 
55 class ITPP_EXPORT EXIT
56 {
57 public:
59 
61  double apriori_mutual_info(const double &in_sigma2A,
62  const double &lim=100
63  )
64  {
65  _gaussian_fct = Gaussian_Fct(in_sigma2A);
66  return 1.0-itpp::quad(_gaussian_fct, -lim, lim);
67  };
69 
72  itpp::vec generate_apriori_info(const itpp::bvec &bits)
73  {
74  itpp::BPSK bpsk;
75  double sigma2A = _gaussian_fct.sigma();
76  return (-sigma2A/2)*bpsk.modulate_bits(bits)+std::sqrt(sigma2A)*itpp::randn(bits.length());
77  };
79 
82  double extrinsic_mutual_info(const itpp::vec &obs,
83  const itpp::bvec &cond,
84  const int &N=100
85  );
86 private:
87  class ITPP_EXPORT Gaussian_Fct
88  {
89  double _sigma;
90  public:
91  Gaussian_Fct(): _sigma(0.0){}
92  Gaussian_Fct(double sigma): _sigma(sigma){}
93  double sigma() const {return _sigma;}
94  double operator()(double x) const;
95  };
96  Gaussian_Fct _gaussian_fct;
97 };
98 
99 }
100 #endif /* EXIT_H_ */
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:22 for IT++ by Doxygen 1.8.2