#include <bch.h>
Public Member Functions | |
BCH (int in_n, int in_k, int in_t, const ivec &genpolynom, bool sys=false) | |
Initialize a (n,k)-code that can correct t errors. | |
BCH (int in_n, int in_t, bool sys=false) | |
Initialize a (n,k)-code that can correct t errors. | |
virtual | ~BCH () |
Destructor. | |
virtual void | encode (const bvec &uncoded_bits, bvec &coded_bits) |
Encode a bvec of indata. | |
virtual bvec | encode (const bvec &uncoded_bits) |
Encode a bvec of indata. | |
virtual void | decode (const bvec &coded_bits, bvec &decoded_bits) |
Decode a bvec of coded data. | |
virtual bvec | decode (const bvec &coded_bits) |
Decode a bvec of coded data. | |
virtual void | decode (const vec &received_signal, bvec &output) |
Decode a vec of received data. | |
virtual bvec | decode (const vec &received_signal) |
Decode a vec of received data. | |
virtual double | get_rate () const |
Get the code rate. | |
virtual int | get_k () const |
Get cardinality of code k. | |
BCH & | operator= (const BCH &) |
Dummy assignment operator - MSVC++ warning C4512. |
The notation used is found in S. B. Wicker, "Error control systems for digital communication and storage", Appendix E, Prentice-Hall, 1995.
Example:
BCH bch(31,21,2,ivec("3 5 5 1"))
itpp::BCH::BCH | ( | int | in_n, | |
int | in_k, | |||
int | in_t, | |||
const ivec & | genpolynom, | |||
bool | sys = false | |||
) |
Initialize a (n,k)-code that can correct t errors.
References itpp::oct2bin(), itpp::GFX::set(), and itpp::zeros_i().
itpp::BCH::BCH | ( | int | in_n, | |
int | in_t, | |||
bool | sys = false | |||
) |
Initialize a (n,k)-code that can correct t errors.
The generator polynomial is automatically generated from the (n, t) parameters of the BCH code. The constructor generates the generator polynomial (and determines k) according to the method described in:
[Wic95] S. B. Wicker, "Error control systems for digital communication and storage", Prentice-Hall, 1995
References itpp::GFX::get_true_degree(), itpp::int2bits(), it_assert, itpp::Array< T >::length(), itpp::length(), itpp::GFX::set(), itpp::Array< T >::set_size(), and itpp::zeros_i().