aliases | author | created | modified | tags | title | |
---|---|---|---|---|---|---|
|
Maneesh Sutar |
2023-09-01 |
2024-09-28 |
Error Correction |
Redundancy (bits): Additional bits that we send with our data
Block length = Message Length + Redundancy bits length
Rate = Message Length / Block length
ECC Notation: (Message block size, data bits size, hamming distance)
Number of bit-errors which are detectable = MHD - 1
Number of bit-error which are correctable = floor ( (MHD - 1) / 2 )
Think about deep space communication where transmission time is in hours
Re-transmission is time consuming and costly
Take example of Hamming Codes (HC) which have Hamming Distance of 3.
Even though HC can detect 2 bit errors, it cannot distinguish
- a double bit error of some valid code
- a single bit error of a different valid code
It won't be sure which is the "right" codeword to convert to.
Similarly, in Extended HC, with hamming distance of 4, triple errors might get mistaken for single errors and "corrected" to the wrong value.
So your system can either choose to detect the errors, or correct the errors.
Data is repeated
e.g. say
Data | Output |
---|---|
0 | 000 |
1 | 111 |
0110 | 000 111 111 000 |
Notation:
Hamming distance =
Block length =
Message length = 1
For r = 3, repetition provides 1 bit error correcting OR 2 bit error detection
Play around with hamming codes using playground
Notation:
Here
Hamming Distance = 3
Block length =
Message length =
Hamming codes (irrespective of
- 1 bit error correcting
- 2 bit error detecting
Why MHD is 3 ?
In hamming codes, for a single bit flipped in the data part, 2 parity bits corresponding to that bit location also need to be flipped in order for the overall code to be a valid hamming code.
For a data bit going from 0 to 1, total 3 (the data bit and 2 parity bits) bits are flipped.
This is true for all hamming code schemes (7,4 or 15,11 or others), because in each case the way the parity bit works are same.
Notation
Here "r" is a natural number >= 2
Hamming Distance = 4
Block length = 2r − 1
Message length = 2r − r − 1
Extended Hamming codes always provide either
- 1 bit error correcting AND upto 2 bit guaranteed error detecting
- 3 bit error detecting
Why MHD is 4?
In the extended hamming codes, an extra parity bit is added to existing scheme (15,11 -> 16,11), which contains the parity of the entire block.
This makes hamming distance 4 (check yourself with the playground)
Notation:
Block length: 24
Message length: 12
Hamming Distance: 8
Rate = 12/24 = 0.5
Since Hamming Distance = 8, this scheme provides either
- Error Correction upto 3 bits
- Error Detection upto 7 bits
Notation:
One of the scheme is
Applications: Data Storage (CDs, DVDs), Barcodes, Space Transmission