|
GNU Radio's DVBS2RX Package
|
BCH coder/decoder. More...
#include <bch.h>
Public Member Functions | |
| bch_codec (const galois_field< T > *const gf, uint8_t t, uint32_t n=0) | |
| Construct a new BCH coder/decoder object. More... | |
| T | encode (const T &msg) const |
| Encode an input message. More... | |
| void | encode (u8_cptr_t msg, u8_ptr_t codeword) const |
| std::vector< T > | syndrome (const T &codeword) const |
| Compute the syndrome of a received codeword. More... | |
| std::vector< T > | syndrome (u8_cptr_t codeword) const |
| gf2m_poly< T > | err_loc_polynomial (const std::vector< T > &syndrome) const |
| Compute the error-location polynomial. More... | |
| std::vector< T > | err_loc_numbers (const gf2m_poly< T > &sigma) const |
| Compute the error-location numbers. More... | |
| T | decode (T codeword) const |
| Decode an input codeword. More... | |
| int | decode (u8_cptr_t codeword, u8_ptr_t decoded_msg) const |
| const gf2_poly< P > & | get_gen_poly () const |
| Get the generator polynomial object. More... | |
| uint16_t | get_n () const |
| Get the codeword length n. More... | |
| uint16_t | get_k () const |
| Get the message length k. More... | |
BCH coder/decoder.
| T | Base type for the Galois Field elements. |
| P | Base type for the GF(2) generator polynomial. |
| gr::dvbs2rx::bch_codec< T, P >::bch_codec | ( | const galois_field< T > *const | gf, |
| uint8_t | t, | ||
| uint32_t | n = 0 |
||
| ) |
Construct a new BCH coder/decoder object.
| gf | Reference Galois field. |
| t | Target error correction capability. |
| n | Target codeword length in bits. |
| T gr::dvbs2rx::bch_codec< T, P >::decode | ( | T | codeword | ) | const |
Decode an input codeword.
| codeword | n-bit input codeword. |
| int gr::dvbs2rx::bch_codec< T, P >::decode | ( | u8_cptr_t | codeword, |
| u8_ptr_t | decoded_msg | ||
| ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| codeword | Pointer to the received codeword with n/8 bytes. |
| decoded_msg | Pointer to the decoded message buffer with space for k/8 bytes. |
| T gr::dvbs2rx::bch_codec< T, P >::encode | ( | const T & | msg | ) | const |
Encode an input message.
| msg | k-bit input message. |
| void gr::dvbs2rx::bch_codec< T, P >::encode | ( | u8_cptr_t | msg, |
| u8_ptr_t | codeword | ||
| ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| msg | Pointer to the input message with k/8 bytes. |
| codeword | Pointer to the codeword buffer with space for n/8 bytes. |
| std::vector< T > gr::dvbs2rx::bch_codec< T, P >::err_loc_numbers | ( | const gf2m_poly< T > & | sigma | ) | const |
Compute the error-location numbers.
The error-location numbers are the numbers from GF(2^m) corresponding to the reciprocal of the roots of the error-location polynomial. An error-location number alpha^j indicates there is an error in the j-th bit of the received codeword.
| sigma | Error location polynomial. |
| gf2m_poly< T > gr::dvbs2rx::bch_codec< T, P >::err_loc_polynomial | ( | const std::vector< T > & | syndrome | ) | const |
Compute the error-location polynomial.
The error-location polynomial is a polynomial over GF(2^m) whose roots indicate the location of bit errors. The implementation for finding this polynomial is based on the simplified Berlekamp's iterative algorithm, which works for binary BCH codes.
| syndrome | Syndrome vector with 2t elements. |
|
inline |
|
inline |
Get the message length k.
|
inline |
Get the codeword length n.
| std::vector< T > gr::dvbs2rx::bch_codec< T, P >::syndrome | ( | const T & | codeword | ) | const |
Compute the syndrome of a received codeword.
| codeword | Received codeword. |
| std::vector< T > gr::dvbs2rx::bch_codec< T, P >::syndrome | ( | u8_cptr_t | codeword | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| codeword | Pointer to u8 array with the received codeword. |