Error correction - Pretty poor solution

Discussion in 'Programmer's Corner' started by atferrari, Oct 15, 2005.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,647
    759
    To implement error checking in an 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 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.
     
  2. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    If you have two bytes available to transmit the data, you can use a full 8:4 encoding scheme split the input byte to two nibbles.
    The code you are using looks more like 12:8?

    This site gives details of 8:4 encoding and a lookup-table based 8:4 decoder that corrects any single-bit error and flags two bit errors.

    http://pdc.ro.nu/hamming.html

    Hope this is some help.
     
  3. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,647
    759
    Hola Robert,

    Yes, it IS "12,8" in fact. My mistake when giving the name.

    After some testing in the simulator for my PICs found quite convenient to add message parity for the 12 bits what eliminates my doubt (1 or 2 errors?).

    Had to stop for a while but in a week I will be doing my hardware test. I couldn't find a reliable way to produce "wrong" code for testing, other than under pure software control which I would like to avoid (boring coding, to be honest).

    Any idea, Robert? My link is a short distance, one way IR link using the SIRC (Sony) protocol as a base.

    Thanks for replying.
     
Loading...