To implement error checking in a noisy IR link I was thinking of using Hamming code in the "8,4" modality to transmit any value between 0 and 255.
Considering the data to be xmitted : D8 D7 D6 D5 D4 D3 D2 D1 the Hamming code is:
HI_PACK = X X X X D8 D7 D6 D5
LO_PACK = P4 D4 D3 D2 P3 D1 P2 P1, where Dx = data bit and Px = parity bit
For 240, the Hamming code is XXXX - 1 1 1 1 - 0 0 0 0 - 1 0 0 0, and
for 249, the Hamming code is XXXX - 1 1 1 1 - 0 1 0 0 - 0 1 0 0
240 transmited (corrupted) as XXXX - 1 1 1 1 - 0 1 0 0 - 1 0 0 0 is recovered by software as 240.
240 transmited (corrupted) as XXXX - 1 1 1 1 - 0 1 0 0 - 1 1 0 0, is recovered by software as 249.
Considering that the occurrence of two corrupted bits off twelve is likely to happen, how can I overcome the above? The capability to correct signals with one corrupted bit only, seems a poor solution, even more, dangerous.
How to distinguish from 1 to 2 corrupted bits to know if correction is to be applied or packs simply discarded?
Being new to all this I started to wonder if majority voting could then be applied AFTER the above process?
I will appreciate concrete suggestions/replies to elinghten me.