RadioLib
Universal wireless communication library for Arduino
|
Class to calculate Bose–Chaudhuri–Hocquenghem (BCH) class of forward error correction codes. In theory, this should be able to calculate an arbitrary BCH(N, K) code, but so far it was only tested for BCH(31, 21). More...
#include <FEC.h>
Public Member Functions | |
RadioLibBCH () | |
Default constructor. | |
~RadioLibBCH () | |
Default destructor. | |
void | begin (uint8_t n, uint8_t k, uint32_t poly) |
Initialization method. More... | |
uint32_t | encode (uint32_t dataword) |
Encoding method - encodes one data word (without check bits) into a code word (with check bits). More... | |
Class to calculate Bose–Chaudhuri–Hocquenghem (BCH) class of forward error correction codes. In theory, this should be able to calculate an arbitrary BCH(N, K) code, but so far it was only tested for BCH(31, 21).
void RadioLibBCH::begin | ( | uint8_t | n, |
uint8_t | k, | ||
uint32_t | poly | ||
) |
Initialization method.
n | Code word length in bits, up to 32. |
k | Data portion length in bits, up to "n". |
poly | Powers of the irreducible polynomial. |
uint32_t RadioLibBCH::encode | ( | uint32_t | dataword | ) |
Encoding method - encodes one data word (without check bits) into a code word (with check bits).
dataword | Data word without check bits. The caller is responsible to make sure the data is on the correct bit positions! |