Learn SDR

Harvey Mudd College

Lesson 36 — Error-correcting codes: a convolutional code and the Viterbi decoder (simulation)

No video for this lesson. Lessons 24–38 were drafted in October 2026 with the help of an AI assistant (Claude) in the spirit of the lessons above, and tested on the same RTL-SDR / PlutoSDR / B210 setup. They are less polished than the video lessons; corrections and pull requests are welcome.

Every link in these lessons sent raw bits. Real links add redundancy so the receiver can correct errors: the sender transmits more bits than the data contains, chosen so that only certain patterns are valid, and the receiver picks the valid pattern nearest to what it received.

The flowgraph compares two branches at the same energy per data bit:

The BER blocks compare each branch with the original bits and show \(\log_{10}\) of the error rate. With noise_voltage = 0.5 (\(E_b/N_0\) = 3 dB) the code turns 2.3 % errors into 0.04 %, about 4 dB of coding gain. DVB-S2 (Lesson 38) and 5G use LDPC codes that get within a fraction of a dB of the Shannon limit.

Things to try

Flowgraphs

lesson36_Error_Correction.grc

lesson36_Error_Correction flowgraph

Running at Eb/N0 = 3 dB: uncoded BPSK 2.3 % bit errors, the rate-1/2 code with Viterbi decoding 0.04 %:

lesson36_Error_Correction running

All GNURadio flowgraphs are at https://github.com/gallicchio/learnSDR