Home▸Articles▸Computer Science

Error-Correcting Codes Waterfall Lab: Repetition, Hamming(7,4) and Viterbi Convolutional Decoding vs the Shannon Limit

Explore the intricacies of error correction in digital communications through a hands-on simulation.

mysimulator teamUpdated June 2026≈ 3 min read▶ Open the simulation

What Error-Correcting Codes Are

Error-correcting codes are essential in digital communication systems for ensuring data integrity. These codes add redundancy to the original message, allowing the receiver to detect and correct errors that may occur during transmission over a noisy channel.

The most common types of error-correcting codes include repetition codes, Hamming codes, and convolutional codes. Each type offers different levels of protection against errors and is suited for various applications.

How Error-Correcting Codes Work

Repetition codes work by sending the same bit multiple times. For example, a repetition code with a length of 3 would send '1' as '111'. If one or two bits are flipped during transmission, the receiver can still correctly identify the original bit.

Hamming(7,4) is a linear block code that adds three parity bits to four data bits. The resulting seven-bit codeword allows for the detection and correction of single-bit errors through syndrome decoding.

live demo · related simulation● LIVE

Viterbi Convolutional Decoding

Convolutional codes are a type of error-correcting code that adds redundancy to data by encoding it with a sliding window approach. The Viterbi algorithm is used for decoding these codes, which finds the most likely sequence of transmitted bits given the received noisy signal.

The Viterbi decoder uses a trellis diagram to represent all possible state transitions and chooses the path with the highest likelihood, effectively correcting errors in the received data.

Shannon's Limit and Coding Gain

Claude Shannon's work established the theoretical limits of error correction in digital communications. The Shannon limit defines the maximum bit rate at which information can be transmitted over a noisy channel with arbitrarily low probability of error.

Coding gain refers to the improvement in signal-to-noise ratio (SNR) that is achieved by using error-correcting codes compared to uncoded transmission. In practical applications, coding gain allows for more reliable communication even when the SNR is below the Shannon limit.

Frequently asked questions

What is the Shannon limit and why does it matter?

The Shannon limit represents the maximum data rate at which information can be transmitted over a noisy channel with an arbitrarily low probability of error. It matters because it sets the theoretical upper bound for reliable communication, guiding the design of practical coding schemes.

How does repetition coding compare to Hamming(7,4) in terms of performance?

Repetition codes are simpler and more robust against random errors but have a high overhead. In contrast, Hamming(7,4) provides better error correction with less overhead, making it more efficient for practical applications.

Why is the Viterbi algorithm used in convolutional decoding?

The Viterbi algorithm efficiently finds the most likely sequence of transmitted bits given the received noisy signal by using a trellis diagram to represent all possible state transitions and choosing the path with the highest likelihood.

Can error-correcting codes completely eliminate errors?

While error-correcting codes can significantly reduce errors, they cannot guarantee complete elimination. The effectiveness of these codes depends on the channel conditions and the specific coding scheme used.

Try it live

Everything above runs in your browser — open Error-Correcting Codes Waterfall Lab: Repetition, Hamming(7,4) and Viterbi Convolutional Decoding vs the Shannon Limit and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Error-Correcting Codes Waterfall Lab: Repetition, Hamming(7,4) and Viterbi Convolutional Decoding vs the Shannon Limit simulation

What did you find?

Add reproduction steps (optional)