arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HammingFEC< bytecount, block_t > Class Template Reference

Hamming forware error correction. Inspired by https://github.com/nasserkessas/hamming-codes. More...

#include <HammingFEC.h>

Inheritance diagram for HammingFEC< bytecount, block_t >:
BaseStream Stream Print

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 Member Functions

bool decode (block_t input[], int len)
 
int encode (uint8_t *input, int len)
 
int encodedSize ()
 
bool getBit (block_t b, int i)
 
int getBlocks ()
 
bool getCharBit (uint8_t b, int i)
 
int inList (uint8_t **list, uint8_t *testString, int listLen)
 
block_t modifyBit (block_t n, int p, bool b)
 
uint8_t modifyCharBit (uint8_t n, int p, bool b)
 
int multipleXor (int *indicies, int len)
 
void refillReadBuffer ()
 
block_t toggleBit (block_t b, int i)
 

Protected Attributes

int _timeout = 10
 
SingleBuffer< uint8_t > encoded {encodedSize()}
 
Printp_print = nullptr
 
Streamp_stream = nullptr
 
SingleBuffer< uint8_t > raw {bytecount}
 
RingBuffer< uint8_t > tmp_in {0}
 
RingBuffer< uint8_t > tmp_out {0}
 

Detailed Description

template<int bytecount, class block_t>
class audio_tools::HammingFEC< bytecount, block_t >

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%


The documentation for this class was generated from the following file: