fecmagic is a header-only C++ library which implements some FEC (forward error correction) codes and some utility functions that help developing and testing such codes.
Currently, we've got the following:
- A generic block code algorithm that works with binary matrix operations, and has a generic method of syndrome-based decoding.
- A generic convolutional codec that is implemented using variadic
templates and can be configured to work with any convolutional code.
The encoder implements the classical "shift register" algorithm, and the decoder implements a hard-decision Viterbi algorithm.
And we have specialized codecs for:
- Hamming(7, 4)
- Golay(24, 12)
And for your convenience, we've also got:
- A way to work with binary matrices efficiently
- A way to print a number in binary
- A way to iterate through bit mask combinations
All the algorithms are implemented in modern C++ and should compile on a C++11 compiler.
The tests use the 0b
notation for binary numbers, so you need C++14 to compile the tests.
Since this is a header-only library, you can simply copy the necessary header files, include them and you're good to go.
This code is primarily tested using GCC on Linux x86. If you find bugs or issues on other compilers or platforms, feel free to open a bug report.
Each piece of code has a small test application. Some of these (Hamming and Golay) cover all possible inputs, and some just contain basic tests to see if stuff works. These tests will be further expanded as needed.
If you think you can improve on our code or add other features, your contribution is welcome. Feel free to send us a pull request. Thanks in advance! :)
The code is licensed to you under the terms of the MIT license.