I am trying to use the the Schifra Reed-Solomon error correcting code library in a project. I have no background about how Reed-Solomon code and Galois field work. I am having trouble figuring out the ideal value of the generator_polynomial_index for a 16 bit symbol(field descriptor).
My code works for the the index 0 and many others. I have tried all values of index. The code works for a lot of them (0-32724 & 32779-65485 to be precise) but
Questions
- What is the most ideal value?
- What is changing if I switch to another value of index(which also works but is not ideal)?
Rest of my discoveries:
field_descriptor = symbol size(bits/symbol)
code_length(Total number of symbols(data symbols + error-correction code symbols)) = 2^symbol_size - 1 (Library only supports this value of code length)
generator_polynomial_root_count = fec_length(redundancy or number of error-correction symbols)
Errors are measured in symbols and not bits i.e. 1 incorrect bit in a particular symbol is counted as 1 error. But even if all 16 bits are incorrect; it would count as 1 error(not 16).
The maximum number of errors and erasures which can be rectified should obey the following inequality: 2*num_errors + num_erasures < fec_length
Please correct me if I am mistaken anywhere
const std::size_t field_descriptor = 16;
const std::size_t generator_polynomial_index = index;
const std::size_t generator_polynomial_root_count = 50;
/* Reed Solomon Code Parameters */
const std::size_t code_length = 65535;
const std::size_t fec_length = 50;
const std::size_t data_length = code_length - fec_length;
/* Instantiate Finite Field and Generator Polynomials */
const schifra::galois::field field(field_descriptor,
schifra::galois::primitive_polynomial_size14, schifra::galois::primitive_polynomial14);