Skip to content

Error Detection and Correction

A digital channel may change transmitted bits because of thermal noise, impulse noise, interference, fading, attenuation, timing error or intersymbol interference. A channel encoder maps kk information bits to an nn-bit codeword; the added n−kn-k bits are redundancy used to identify or repair invalid received patterns.

Error-control taxonomy: detection identifies corruption, FEC adds redundancy for local correction, and ARQ uses feedback and retransmission.

Error-control taxonomy: detection identifies corruption, FEC adds redundancy for local correction, and ARQ uses feedback and retransmission.

Error detection decides only that the received word is invalid, so the receiver discards, flags or requests retransmission. Error correction locates the most likely error pattern and rebuilds a valid codeword locally. No finite code corrects an unlimited number of arbitrary errors.

A single-bit error flips exactly one bit, e.g. 10110110→1010011010110110\to10100110. Multiple random errors corrupt several separated positions. A burst error spans from the first to the last corrupted bit; its burst length counts any correct bits in between:

110101001011⏟sent → 110011111011⏟received,burst length=5.\underbrace{110101001011}_{\text{sent}}\ \to\ \underbrace{110011111011}_{\text{received}},\qquad \text{burst length}=5.

Burst errors dominate on channels with impulse noise, deep fades and sync loss; CRC and interleaved block codes defend against them.

A lower code rate means more redundancy and potentially stronger protection, but more bandwidth or lower net information rate. The receiver exploits the algebraic structure of valid codewords to decide plausibility and, for a correcting code, the nearest valid word.

At the receiver the XOR of all bits is the parity syndrome.

Data is arranged in rows and columns; a parity bit is added to each row and a parity row across columns (the column set is the Longitudinal Redundancy Check, LRC). A single flipped data bit fails exactly one row and one column, and their intersection locates — hence corrects — the bit.

C1C_1C2C_2C3C_3C4C_4Row parity
R1R_1
R2R_2
R3R_3
Col. parity

Two-dimensional (row/column) even parity; the LRC is the bottom row.

Some rectangular patterns with an even number of changes in every affected row and column remain undetected.

A checksum treats data as fixed-width words. Internet-style checksums use one’s-complement arithmetic with end-around carry.

Checksums are simple to implement in software and detect many common error patterns, but a well-designed CRC provides stronger guaranteed burst-error detection.

CRC interprets a bit string as a polynomial over GF(2)GF(2), where addition and subtraction are both XOR. Let D(x)D(x) be the data, G(x)G(x) the agreed generator of degree rr, R(x)R(x) the remainder (deg⁡R<r\deg R<r) and T(x)T(x) the codeword.

Because subtraction equals addition in GF(2)GF(2), T(x)T(x) is exactly divisible by G(x)G(x).

CRC flow: the message is shifted by x^(r), divided mod-2 by the generator g(x), and the remainder is appended as the frame-check sequence; the receiver re-divides and a zero remainder indicates no detected error.

CRC flow: the message is shifted by xrx^{r}, divided mod-2 by the generator g(x)g(x), and the remainder is appended as the frame-check sequence; the receiver re-divides and a zero remainder indicates no detected error.

The Hamming distance between equal-length words is the number of positions in which they differ (the weight of their XOR); e.g. d(101100,100110)=2d(101100,100110)=2. The minimum distance dmin⁡d_{\min} is the smallest distance between any two distinct codewords.

Turning one valid codeword into another needs ≥dmin⁡\ge d_{\min} changes; for correction the radius-tt decoding spheres must not overlap. Hamming (7,4)(7,4) has dmin⁡=3d_{\min}=3, so it corrects one error (or detects up to two if used only for detection). Reliable simultaneous double-error detection needs an added overall parity bit (SECDED).

Hamming code is a linear block code for single-error correction.

An rr-bit syndrome has 2r2^r possible values. The all-zero value represents the no-error state, and a distinct nonzero value must identify each of the m+rm+r possible single-bit error positions. Thus at least m+r+1m+r+1 syndrome states are required.

For m=4m=4, r=3r=3 suffices since 23=8≥4+3+12^{3}=8\ge 4+3+1. Parity bits occupy power-of-two positions 1,2,41,2,4; data occupy 3,5,6,73,5,6,7.

Hamming (7, 4) bit layout: parity P₁, P₂, P₄ at power-of-two positions 1, 2, 4; data D₁ – D₄ at 3, 5, 6, 7. Each parity bit covers the positions whose binary index includes its weight.

Hamming (7,4)(7,4) bit layout: parity P1,P2,P4P_1,P_2,P_4 at power-of-two positions 1,2,41,2,4; data D1D_1 – D4D_4 at 3,5,6,73,5,6,7. Each parity bit covers the positions whose binary index includes its weight.

Adding one overall parity bit yields SECDED (Single-Error Correction, Double-Error Detection): the ordinary syndrome locates a single error while the overall parity separates single from double errors.

The transmitter sends structured redundancy so the receiver corrects errors without asking for a resend. Examples: Hamming/BCH block codes, Reed–Solomon, convolutional, turbo and LDPC codes. FEC suits large round-trip delay, absent feedback and continuous real-time delivery (satellite, broadcast, deep-space).

ARQ combines error detection (usually CRC) with feedback, sequence numbers, ACK/NAK and timeout; damaged or missing frames are retransmitted.

MethodOperationTrade-off
Stop-and-WaitSend one frame, wait for ACK; timeout/NAK resends itSimple; link idle each round trip
Go-Back-NPipeline a window; on error resend the failed frame and all later unacked framesSimple receiver; repeats correct frames
Selective RepeatBuffer a window; resend only missing/damaged framesHighest efficiency; more buffering/control

The three classic ARQ schemes.

with TfT_f the frame time and TpT_p the one-way propagation delay — which is why pipelined GBN/SR win on long-delay links.

FeatureFECARQ
FeedbackNot requiredRequired
Added redundancyUsually greater (every codeword)Detection bits ++ retransmitted frames
DelayPredictable decoding delayVariable; large after retransmission
Best channelBroadcast, real-time, high-delayReliable two-way, moderate delay
Residual errorsPossible beyond capabilityVery low after valid delivery

FEC versus ARQ. Modern systems often use Hybrid ARQ, combining FEC with selective retransmission.