Repetition Codes

The simplest form of FEC based on majority voting.

The Simplest Form of Protection

Repetition codes are the most intuitive and fundamental form of . The core idea is simple and mirrors how we communicate in everyday life: if you want to make sure someone hears you correctly in a noisy room, you repeat yourself. Repetition codes do exactly that for digital data.

The general principle is to transmit each individual bit of the original message a predetermined number of times. This introduces , which can be used by the receiver to overcome errors introduced by the channel.

How It Works: The R3 Repetition Code

The most common example is the R3 code, also known as the (3,1) repetition code. Here, every single bit of information is repeated three times.

  • To send a logical '0', the transmitter sends the sequence 000.
  • To send a logical '1', the transmitter sends the sequence 111.

Decoding by Majority Vote

At the receiving end, the decoder examines each three-bit block and makes a decision based on a simple "majority vote":

If received block contains more 0s:

000, 001, 010, 100

→ Decoded as '0'

If received block contains more 1s:

111, 110, 101, 011

→ Decoded as '1'

Error Correction Capabilities and Limitations

The power of repetition codes lies in their ability to correct errors. If a single bit in a three-bit block gets flipped by noise during transmission, the majority vote will still yield the correct original bit.

Example of successful correction:
1. Sender wants to send: 1
2. Encoded and transmitted signal: 111
3. Noise corrupts the signal. Received signal: 101
4. Decoder's majority vote (two 1s, one 0) → Decodes correctly to: 1. The error was corrected!

Example of failure:
However, if two bits are flipped, the majority vote will lead to an incorrect decision.
1. Transmitted signal: 111
2. Heavy noise corrupts the signal. Received signal: 001
3. Decoder's majority vote (one 1, two 0s) → Decodes incorrectly to: 0.

Formal Capabilities (Hamming Distance)

The error-handling capabilities of a code are determined by its . For the R3 code, the only valid codewords are 000000 and 111111, and they differ in 3 positions, so dmin=3d_{min}=3.

  • The number of errors a code can detect is d=dmin−1d = d_{min} - 1. For R3, it's 3−1=23 - 1 = 2 errors.
  • The number of errors a code can correct is t=⌊dmin−12⌋t = \lfloor \frac{d_{min} - 1}{2} \rfloor. For R3, it's ⌊3−12⌋=1\lfloor \frac{3 - 1}{2} \rfloor = 1 error.

Interactive Repetition Code (R3/R5/R7)

Enter a binary string (0/1 only)

Transmitted (Encoded)

Received (Click bits to flip)

Decoded (majority)

Stats

Blocks:
7
Bit errors before decode:
0
Blocks corrected:
0

 

Blocks failed:
0
Bits wrong after decode:
0
Decoded matches original:
✔

Advantages and (Significant) Disadvantages

Advantages

  • Simplicity: They are incredibly easy to understand, implement in hardware, and analyze.

Disadvantages

  • Extreme Inefficiency: This is their greatest weakness. The code rate, which is the ratio of information bits to total transmitted bits, is very low. For the R3 code, the rate is 13\frac{1}{3}. This means that two-thirds of the transmission is redundant overhead. Sending a 1 MB file requires transmitting 3 MB of data.
  • Low Error Correction Capability: They can only handle a small number of random errors. They are very vulnerable to burst errors, where multiple consecutive bits are corrupted.
  • Increased Delay and Bandwidth: Transmitting three times as many bits naturally triples the time needed or requires three times the bandwidth for the same effective data rate, making them unsuitable for high-speed communication.
    Repetition Codes | Teleinf Edu