#include #include #include #include // (7,4) Hamming Code example from chapter 3 class Hamming_coder { public: static const size_t BLOCK_SIZE = 7; static const size_t INFO_SIZE = 4; Hamming_coder() { init_syndrome_table(); } ~Hamming_coder(){} // input size must be 4, output size must be 7 void encode(uint8_t *input, uint8_t *output) { for (size_t generator_col=0; generator_col>(Hamming_coder::INFO_SIZE-i-1)) & 1; } // encode the codeword uint8_t encoded_input[Hamming_coder::BLOCK_SIZE]; hamming_coder.encode(input_bits, encoded_input); // introduce all possible errors for (size_t j=0; j