IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bch.h
Go to the documentation of this file.
1 
29 #ifndef BCH_H
30 #define BCH_H
31 
32 #include <itpp/comm/galois.h>
33 #include <itpp/comm/channel_code.h>
34 
35 
36 namespace itpp
37 {
38 
43 //---------------------- BCH --------------------------------------
44 
59 class BCH : public Channel_Code
60 {
61 public:
69  BCH(int in_n, int in_k, int in_t, const ivec &genpolynom, bool sys = false);
70 
82  BCH(int in_n, int in_t, bool sys = false);
83 
85  virtual ~BCH() { }
86 
88  virtual void encode(const bvec &uncoded_bits, bvec &coded_bits);
90  virtual bvec encode(const bvec &uncoded_bits);
91 
93  virtual void decode(const bvec &coded_bits, bvec &decoded_bits);
95  virtual bvec decode(const bvec &coded_bits);
96 
97  // Soft-decision decoding is not implemented
98  virtual void decode(const vec &received_signal, bvec &output);
99  virtual bvec decode(const vec &received_signal);
100 
102  virtual double get_rate() const {return static_cast<double>(k) / n; }
103 
105  virtual int get_k() const {return k; }
106 
108  BCH & operator=(const BCH &) { return *this; }
109 
110 private:
111  int n, k, t;
112  GFX g;
113  const bool systematic;
114 };
115 
116 } // namespace itpp
117 
118 #endif // #ifndef BCH_H
SourceForge Logo

Generated on Fri Mar 21 2014 17:14:13 for IT++ by Doxygen 1.8.1.2