What is Reed Solomon Code?
Reed–Solomon codes are powerful error-correcting codes designed to handle burst errors by operating on symbols instead of bits. This article explains what it is and how they are used in communication systems.
Reliable communication over noisy channels is not just about detecting errors, but also about correcting them efficiently. While many error-correcting codes operate at the bit level, Reed–Solomon (RS) codes take a fundamentally different approach by working on symbols, making them especially effective against burst errors.
What is a Reed–Solomon Code?
A Reed–Solomon code is a block-based error-correcting code that operates on fixed-size symbols rather than individual bits. Each symbol typically represents multiple bits (for example, 8 bits = 1 byte).
RS codes belong to the class of maximum distance separable (MDS) codes, meaning they achieve the best possible trade-off between redundancy and error correction capability.
Why Reed–Solomon Codes Were Developed
Many real-world channels do not produce random single-bit errors. Instead, they produce burst errors, where multiple consecutive bits or symbols are corrupted together due to:
- Fading in wireless and satellite links
- Impulse noise
- Synchronization loss
- Storage media defects
Unlike bit-level codes:
- A single symbol error may involve multiple corrupted bits
- Reed–Solomon treats this as one error, regardless of how many bits inside the symbol are wrong
Bit-level codes struggle in such scenarios. Reed–Solomon codes were designed to correct entire corrupted symbols, making them extremely effective for these conditions.
RS Code Parameters: (n, k)
A Reed–Solomon code is usually described as RS(n, k):
- → Number of data symbols
- → Total symbols after encoding (data + parity)
- → Number of parity symbols
The encoder takes k data symbols and adds redundancy to form an n symbol codeword.
Please note that the data is represented as symbols instead of bits, one symbol can be 4 bits, 1 byte, 4 bytes and so on. depending on the implementation.
Error Correction Capability
A Reed–Solomon code can correct up to t symbol errors, where:
This means:
- If 4 parity symbols are added, the code can correct 2 symbol errors
- The position of errors does not need to be known in advance
How to generate RS Codes?
Parameters
RS(7,3) has the following parameters:
| Parameter | Value | Meaning |
|---|---|---|
| n | 7 | Total symbols in the codeword |
| k | 3 | Number of data symbols |
| n-k | 4 | Number of parity symbols |
| GF size | 8 | Each symbol is 3 bits (0–7) |
So there are 3 data symbols and 4 parity symbols.
Implementation
Let us understand how a data symbol with length is coded using RS codes to a Codeword symbol of length .
Let the data symbol have 3 bits each. So the data symbols can have values from 0 to 7. So for example, let’s take the data as below and has a length of 3. These are the symbols we want to transmit,
We now map the message on to a polynomial,
Let’s generate the generator polynomial,
RS(7,3) → parity symbols → generator polynomial has degree 4:
- is a primitive element of GF(2³)
- Expanded in GF(2³) will be:
Next we divide this with the generator polynomial, Divide by in GF(2³). Now the remainder is the parity polynomial.
These are the 4 parity symbols, .
It’s now time to form the final RS Codeword,
- Data symbols occupy the higher-degree positions
- Parity symbols occupy the lower-degree positions
Final transmitted codeword (symbols in order):
Real-World Applications
- QR Codes: Use RS codes to remain readable even when partially damaged
- CDs/DVDs: Correct scratches and fingerprints (up to 4000 consecutive error bits)
- Satellite communications: NASA’s Voyager missions use RS codes
- DSL/Cable modems: To correct impulse noise which causes burst errors
Why do we use polynomial representation?
RS codes use polynomial representation because polynomial division over finite fields provides a systematic way to generate parity symbols. The remainder from polynomial division naturally gives us the error-checking information we need.
Why GF(2³)?
The field size GF(2³) = 8 symbols means each symbol represents 3 bits. Larger fields allow longer codewords but require more complex arithmetic. Common choices are GF(2⁸) for byte-oriented systems.
Now we want the highest power of the message polynomial to be the same as the highest power of codeword which is 7 in our case, so we multiply the message polynomial with ,
You can try hands-on how the Reed Solomon encoder and decoder work together using the below jupyter notebook. We make use of the Python galois Library to understand Error detection and correction using RS Codes.