arduino-audio-tools
|
Hamming forware error correction. Inspired by https://github.com/nasserkessas/hamming-codes. More...
#include <HammingFEC.h>
Public Member Functions | |
HammingFEC (Print &print) | |
HammingFEC (Stream &stream) | |
int | available () override |
int | availableForWrite () override |
virtual bool | begin () |
virtual void | end () |
virtual void | flush () override |
operator bool () | |
size_t | readBytes (uint8_t *data, size_t len) override |
size_t | write (const uint8_t *data, size_t len) override |
virtual size_t | write (uint8_t ch) override |
Protected Attributes | |
int | _timeout = 10 |
SingleBuffer< uint8_t > | encoded {encodedSize()} |
Print * | p_print = nullptr |
Stream * | p_stream = nullptr |
SingleBuffer< uint8_t > | raw {bytecount} |
RingBuffer< uint8_t > | tmp_in {0} |
RingBuffer< uint8_t > | tmp_out {0} |
Hamming forware error correction. Inspired by https://github.com/nasserkessas/hamming-codes.
Hamming<1024,uint16_t> hamming; // block_ts of 1k with block_tsize 16bits = 31.25% redundency
Block size (bits) Redundant bits Redundancy percentage 4 3 75% 8 4 50% 16 5 31.25% 32 6 18.75% 64 7 10.94%