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>
34#include <itpp/itexports.h>
35
36namespace itpp
37{
38
43//---------------------- BCH --------------------------------------
44
59class ITPP_EXPORT BCH : public Channel_Code
60{
61public:
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
130private:
131 int n, k, t;
132 GFX g;
133 const bool systematic;
134};
135
136} // namespace itpp
137
138#endif // #ifndef BCH_H
Channel Code class virtual interface.
Class for binary, narrow-sense BCH codes.
Definition: bch.h:60
virtual int get_k() const
Get cardinality of code k.
Definition: bch.h:121
virtual double get_rate() const
Get the code rate.
Definition: bch.h:116
virtual ~BCH()
Destructor.
Definition: bch.h:85
Generic Channel Code class.
Definition: channel_code.h:51
Polynomials over GF(q)[x], where q=2^m, m=1,...,16.
Definition: galois.h:176
Definitions of Galois Field algebra classes and functions.
itpp namespace
Definition: itmex.h:37
SourceForge Logo

Generated on Tue Jan 24 2023 00:00:00 for IT++ by Doxygen 1.9.5