IT++ Logo
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 #include <itpp/itexports.h>
35 
36 namespace itpp
37 {
38 
43 //---------------------- BCH --------------------------------------
44 
59 class ITPP_EXPORT 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 
103  virtual bool decode(const bvec &coded_bits, bvec &decoded_message, bvec &cw_isvalid);
104 
106  virtual void decode(const bvec &coded_bits, bvec &decoded_bits);
107 
109  virtual bvec decode(const bvec &coded_bits);
110 
111  // Soft-decision decoding is not implemented
112  virtual void decode(const vec &received_signal, bvec &output);
113  virtual bvec decode(const vec &received_signal);
114 
116  virtual double get_rate() const {
117  return static_cast<double>(k) / n;
118  }
119 
121  virtual int get_k() const {
122  return k;
123  }
124 
126  BCH & operator= (const BCH &) {
127  return *this;
128  }
129 
130 private:
131  int n, k, t;
132  GFX g;
133  const bool systematic;
134 };
135 
136 } // namespace itpp
137 
138 #endif // #ifndef BCH_H
SourceForge Logo

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