IT++ Logo
bch.h
Go to the documentation of this file.
00001 
00029 #ifndef BCH_H
00030 #define BCH_H
00031 
00032 #include <itpp/comm/galois.h>
00033 #include <itpp/comm/channel_code.h>
00034 
00035 
00036 namespace itpp
00037 {
00038 
00043 //---------------------- BCH --------------------------------------
00044 
00059 class BCH : public Channel_Code
00060 {
00061 public:
00069   BCH(int in_n, int in_k, int in_t, const ivec &genpolynom, bool sys = false);
00070 
00082   BCH(int in_n, int in_t, bool sys = false);
00083 
00085   virtual ~BCH() { }
00086 
00088   virtual void encode(const bvec &uncoded_bits, bvec &coded_bits);
00090   virtual bvec encode(const bvec &uncoded_bits);
00091 
00093   virtual void decode(const bvec &coded_bits, bvec &decoded_bits);
00095   virtual bvec decode(const bvec &coded_bits);
00096 
00097   // Soft-decision decoding is not implemented
00098   virtual void decode(const vec &received_signal, bvec &output);
00099   virtual bvec decode(const vec &received_signal);
00100 
00102   virtual double get_rate() const {return static_cast<double>(k) / n; }
00103 
00105   virtual int get_k() const {return k; }
00106 
00108   BCH & operator=(const BCH &) { return *this; }
00109 
00110 private:
00111   int n, k, t;
00112   GFX g;
00113   const bool systematic;
00114 };
00115 
00116 } // namespace itpp
00117 
00118 #endif // #ifndef BCH_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SourceForge Logo

Generated on Wed Jul 27 2011 16:27:04 for IT++ by Doxygen 1.7.4