Forward Error Correction Simulator: How Redundancy Defeats Noise

simulator advanced ~12 min
Loading simulation...
BER_out ≈ 4×10⁻⁶ — rate-1/2 code correcting 3 errors

A rate-1/2 block code of length 128 that corrects up to 3 errors per block reduces a 5% raw BER to approximately 4×10⁻⁶ — an improvement of over four orders of magnitude.

Formula

R = k/n  (code rate, k data bits, n total bits)
P_block ≈ Σ C(n,i)·p^i·(1-p)^(n-i)  for i > t
Coding gain = 10·log₁₀(R·d_min / 2)  dB (approximate)

Fighting Noise with Math

Every communication channel corrupts some bits. Rather than hoping for the best or demanding retransmission, forward error correction (FEC) adds carefully structured redundancy so the receiver can reconstruct the original message even when some bits flip. The key insight, proved by Shannon in 1948, is that reliable communication is possible at any rate below the channel capacity — you just need a good enough code.

From Hamming to LDPC

Richard Hamming's 1950 code could correct single-bit errors in 7-bit blocks — revolutionary for early computers. Reed-Solomon codes (1960) handle burst errors and still protect CDs and QR codes. Convolutional codes with Viterbi decoding dominated satellite and cellular systems for decades. The modern era began with turbo codes (1993) and LDPC codes (rediscovered 1996), which approach Shannon's limit to within a fraction of a decibel.

The Rate-Performance Trade-off

Every FEC code trades throughput for reliability. A rate-1/2 code sends two channel bits for every data bit, halving the raw throughput but enabling dramatic error reduction. A rate-7/8 code adds minimal redundancy and provides modest correction. The optimal rate depends on the channel: deep-space links use rate-1/6, while fiber optics use rate-0.9+ because the raw BER is already very low.

Visualizing Error Correction

This simulation shows the error correction process in action: random errors are injected into transmitted blocks at the specified raw BER, and the decoder attempts to correct them. You can see how increasing the correction capability t or decreasing the code rate R drives down the output BER, and observe the threshold effect where the decoder transitions from overwhelmed to virtually error-free.

FAQ

What is forward error correction?

Forward error correction (FEC) adds structured redundancy to data before transmission so the receiver can detect and correct errors without retransmission. Unlike ARQ (automatic repeat request), FEC works on one-way links like satellite broadcasts where retransmission is impractical or too slow.

What is coding gain?

Coding gain is the reduction in required SNR to achieve a target BER compared to uncoded transmission. A code with 6 dB coding gain means you need 6 dB less signal power — equivalent to quadrupling the effective link range for free.

What are LDPC codes?

Low-Density Parity-Check codes, invented by Robert Gallager in 1960 and rediscovered in 1996, use sparse parity-check matrices and iterative belief-propagation decoding to approach Shannon capacity within 0.1 dB. They are used in 5G NR, Wi-Fi 6, DVB-S2, and 10GBASE-T Ethernet.

What is the Shannon limit for error correction?

Shannon proved that for any channel with capacity C, there exist codes that achieve arbitrarily low error rates at any rate R < C. No code can achieve zero errors at R > C. This bound guides the design of all modern FEC systems.

Sources

Embed

<iframe src="https://homo-deus.com/lab/telecommunications/error-correction/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub