Code for BCH / Reed-Solomon encoder/decoder pair.
Some (out of order) overview of Reed Solomon and BCH codes, in the context of this code:
A message
Meaning, the coefficients of
Formally, there need to be further axioms here regarding addition, but once I said it's bitwise XOR they are automatically fulfilled.
The above arithmetic is implemented ad-hoc for a field of size
Given a field
Given a polynomial
The space of codewords is then the ideal generated by
The implementation presented here aims for correctness and clarity, rather than performance. At the moment several arithmetic operations were cached into look up tables in a very simple way.
The intent is to present several methods to perform arithmetic using several algorithmic equivalents, with each method appealing to different application (so some methods will work better in, say, Verilog, but one would target latency and another would target gate count).
Other than cloning this project and setting an environment that has all the requirements (listed in requirements.txt), you would need to let python know where the files are. This can be done either by setting a system environment that has the path to the project, and which the modules are set to look for (REEDSOLOMON), or, hard coding it into the modules. I could have used PIP to package the project, but I like this way better.
Feel free to use this project under the MIT license. If you decide to reference it, please use:
@misc{reedSolomonPython,
title = "A python implementation of Reed Solomon and BCH codes",
author = "{Omer S. Sella}",
howpublished = "\url{https://github.com/Omer-Sella/reedSolomon}",\
year = 2024,
}