#jsDisabledContent { display:none; } My Account | Register | Help

# Reed-Solomon

Article Id: WHEBN0006793694
Reproduction Date:

 Title: Reed-Solomon Author: World Heritage Encyclopedia Language: English Subject: Collection: Publisher: World Heritage Encyclopedia Publication Date:

### Reed-Solomon

Template:Infobox code

In coding theory, Reed–Solomon (RS) codes are non-binary[1] cyclic error-correcting codes invented by Irving S. Reed and Gustave Solomon. They described a systematic way of building codes that could detect and correct multiple random symbol errors. By adding t check symbols to the data, an RS code can detect any combination of up to t erroneous symbols, or correct up to ⌊t/2⌋ symbols. As an erasure code, it can correct up to t known erasures, or it can detect and correct combinations of errors and erasures. Furthermore, RS codes are suitable as multiple-burst bit-error correcting codes, since a sequence of b + 1 consecutive bit errors can affect at most two symbols of size b.[2] The choice of t is up to the designer of the code, and may be selected within wide limits.

In Reed–Solomon coding, source symbols are viewed as coefficients of a polynomial p(x) over a finite field. The original idea was to create n code symbols from k source symbols by oversampling p(x) at n > k distinct points, transmit the sampled points, and use interpolation techniques at the receiver to recover the original message. That is not how RS codes are used today. Instead, RS codes are viewed as cyclic BCH codes, where encoding symbols are derived from the coefficients of a polynomial constructed by multiplying p(x) with a cyclic generator polynomial. This gives rise to efficient decoding algorithms (described below).

Reed–Solomon codes have since found important applications from deep-space communication to consumer electronics. They are prominently used in consumer electronics such as CDs, DVDs, Blu-ray Discs, in data transmission technologies such as DSL and WiMAX, in broadcast systems such as DVB and ATSC, and in computer applications such as RAID 6 systems.

## History

Reed–Solomon codes were developed in 1960 by Irving S. Reed and Gustave Solomon, who were then staff members of MIT Lincoln Laboratory. Their seminal article was entitled "Polynomial Codes over Certain Finite Fields." (Reed & Solomon 1960). When the article was written, an efficient decoding algorithm was not known. A solution for the latter was found in 1969 by Elwyn Berlekamp and James Massey, and is since known as the Berlekamp–Massey decoding algorithm. In 1977, RS codes were notably implemented in the Voyager program in the form of concatenated codes. The first commercial application in mass-produced consumer products appeared in 1982 with the compact disc, where two interleaved RS codes are used. Today, RS codes are widely implemented in digital storage devices and digital communication standards, though they are being slowly replaced by more modern low-density parity-check (LDPC) codes or turbo codes. For example, RS codes are used in the digital video broadcasting (DVB) standard DVB-S, but LDPC codes are used in its successor DVB-S2.

## Applications

### Data storage

Reed–Solomon coding is very widely used in mass storage systems to correct the burst errors associated with media defects.

Reed–Solomon coding is a key component of the compact disc. It was the first use of strong error correction coding in a mass-produced consumer product, and DAT and DVD use similar schemes. In the CD, two layers of Reed–Solomon coding separated by a 28-way convolutional interleaver yields a scheme called Cross-Interleaved Reed Solomon Coding (CIRC). The first element of a CIRC decoder is a relatively weak inner (32,28) Reed–Solomon code, shortened from a (255,251) code with 8-bit symbols. This code can correct up to 2 byte errors per 32-byte block. More importantly, it flags as erasures any uncorrectable blocks, i.e., blocks with more than 2 byte errors. The decoded 28-byte blocks, with erasure indications, are then spread by the deinterleaver to different blocks of the (28,24) outer code. Thanks to the deinterleaving, an erased 28-byte block from the inner code becomes a single erased byte in each of 28 outer code blocks. The outer code easily corrects this, since it can handle up to 4 such erasures per block.

The result is a CIRC that can completely correct error bursts up to 4000 bits, or about 2.5 mm on the disc surface. This code is so strong that most CD playback errors are almost certainly caused by tracking errors that cause the laser to jump track, not by uncorrectable error bursts.[3]

DVDs uses a similar scheme, but with much larger blocks, a (208,192) inner code, and a (182,172) outer code.

Reed–Solomon error correction is also used in parchive files which are commonly posted accompanying multimedia files on USENET. The Distributed online storage service Wuala also makes use of Reed–Solomon when breaking up files.

### Bar code

Almost all two-dimensional bar codes such as PDF-417, MaxiCode, Datamatrix, QR Code, and Aztec Code use Reed–Solomon error correction to allow correct reading even if a portion of the bar code is damaged. When the bar code scanner cannot recognize a bar code symbol, it will treat it as an erasure.

Reed-Solomon coding is less common in one-dimensional bar codes, but is used by the PostBar symbology.

### Data transmission

Specialized forms of Reed–Solomon codes, specifically Cauchy-RS and Vandermonde-RS, can be used to overcome the unreliable nature of data transmission over erasure channels. The encoding process assumes a code of RS(NK) which results in N codewords of length N symbols each storing K symbols of data, being generated, that are then sent over an erasure channel.

Any combination of K codewords received at the other end is enough to reconstruct all of the N codewords. The code rate is generally set to 1/2 unless the channel's erasure likelihood can be adequately modelled and is seen to be less. In conclusion, N is usually 2K, meaning that at least half of all the codewords sent must be received in order to reconstruct all of the codewords sent.

Reed–Solomon codes are also used in xDSL systems and CCSDS's Space Communications Protocol Specifications as a form of forward error correction.

### Space transmission

One significant application of Reed–Solomon coding was to encode the digital pictures sent back by the Voyager space probe.

Voyager introduced Reed–Solomon coding concatenated with convolutional codes, a practice that has since become very widespread in deep space and satellite (e.g., direct digital broadcasting) communications.

Viterbi decoders tend to produce errors in short bursts. Correcting these burst errors is a job best done by short or simplified Reed–Solomon codes.

Modern versions of concatenated Reed–Solomon/Viterbi-decoded convolutional coding were and are used on the Mars Pathfinder, Galileo, Mars Exploration Rover and Cassini missions, where they perform within about 1–1.5 dB of the ultimate limit imposed by the Shannon capacity.

These concatenated codes are now being replaced by more powerful turbo codes where the transmitted data does not need to be decoded immediately.

## Constructions

The Reed–Solomon code is actually a family of codes: For every choice of parameters q, n, and k, there is a Reed–Solomon code that has an alphabet of size q, a block length n < q, and a message length k < n. Moreover, the alphabet is interpreted as the finite field of order q, and thus, q has to be a prime power. In the most useful parameterizations of the Reed–Solomon code, the block length is usually some constant multiple of the message length, that is, the rate $R=k/n$ is some constant, and furthermore, the block length is equal to or one less than the alphabet size, that is, $n=q$ or $n=q-1$.

### Reed & Solomon's original view: The codeword as a sequence of values

There are different encoding procedures for the Reed–Solomon code, and thus, there are different ways to describe the set of all codewords. In the original view of Reed & Solomon (1960), every codeword of the Reed–Solomon code is a sequence of function values of a low-degree polynomial. More precisely, in order to obtain a codeword of the Reed–Solomon code, the message is interpreted as the description of a polynomial p of degree less than k over the finite field F with q elements. In turn, the polynomial p is evaluated at n distinct points $a_1,\dots,a_n$ of the field F, and the sequence of values is the corresponding codeword. Formally, the set $\mathbf\left\{C\right\}$ of codewords of the Reed–Solomon code is defined as follows:



\mathbf{C}

= \Big\{\;
\big( p(a_1), p(a_2), \dots, p(a_n) \big)
\;\Big|\;
p \text{ is a polynomial over } F \text{ of degree }

Since any two different polynomials of degree less than $k$ agree in at most $k-1$ points, this means that any two codewords of the Reed–Solomon code disagree in at least $n - \left(k-1\right) = n-k+1$ positions.
Furthermore, there are two polynomials that do agree in $k-1$ points but are not equal, and thus, the distance of the Reed–Solomon code is exactly $d=n-k+1$.
Then the relative distance is $\delta = d/n = 1-k/n + 1/n \sim 1-R$, where $R=k/n$ is the rate.
This trade-off between the relative distance and the rate is asymptotically optimal since, by the Singleton bound, every code satisfies $\delta+R\leq 1$.
Being a code that achieves this optimal trade-off, the Reed–Solomon code belongs to the class of maximum distance separable codes.
While the number of different polynomials of degree less than k and the number of different messages are both equal to $q^k$, and thus every message can be uniquely mapped to such a polynomial, there are different ways of doing this encoding.
The original construction of Reed & Solomon (1960) interprets the message x as the coefficients of the polynomial p, whereas subsequent constructions interpret the message as the values of the polynomial at the first k points $a_1,\dots,a_k$ and obtain the polynomial p by interpolating these values with a polynomial of degree less than k.
The latter encoding procedure, while being slightly less efficient, has the advantage that it gives rise to a systematic code, that is, the original message is always contained as a subsequence of the codeword.
In many contexts it is convenient to choose the sequence $a_1,\dots,a_n$ of evaluation points so that they exhibit some additional structure.
In particular, it is useful to chose the sequence of successive powers of a primitive root $\alpha$ of the field $F$, that is, $\alpha$ is generator of the finite field's multiplicative group and the sequence is defined as $a_i = \alpha^i$ for all $i=1,\dots,q-1$.
This sequence contains all elements of $F$ except for $0$, so in this setting, the block length is $n=q-1$.
Then it follows that, whenever $p\left(a\right)$ is a polynomial over $F$, then the function $p\left(\alpha a\right)$ is also a polynomial of the same degree, which gives rise to a codeword that is a cyclic left-shift of the codeword derived from $p\left(a\right)$; thus, this construction of Reed–Solomon codes gives rise to a cyclic code.

Simple encoding procedure: The message as a sequence of coefficients
In the original construction of Reed & Solomon (1960), the message $x=\left(x_1,\dots,x_k\right)\in F^k$ is mapped to the polynomial $p_x$ with

$p_x\left(a\right) = \sum_\left\{i=1\right\}^k x_i a^\left\{i-1\right\} \,.$

As described above, the codeword is then obtained by evaluating $p$ at $n$ different points $a_1,\dots,a_n$ of the field $F$.
Thus the classical encoding function $C:F^k \to F^n$ for the Reed–Solomon code is defined as follows:

$C\left(x\right) = \big\left(p_x\left(a_1\right),\dots,p_x\left(a_n\right)\big\right)\,.$

This function $C$ is a linear mapping, that is, it satisfies $C\left(x\right) = x \cdot A$ for the following $\left(k\times n\right)$-matrix $A$ with elements from $F$:

$A=\begin\left\{bmatrix\right\}$

1         & \dots  & 1     \\
a_1       & \dots  & a_n   \\
a_1^2     & \dots  & a_n^2 \\
\vdots    & \ddots &\vdots \\
a_1^{k-1} & \dots  & a_n^{k-1}
\end{bmatrix}
This matrix is the transpose of a Vandermonde matrix over $F$.
In other words, the Reed–Solomon code is a linear code, and in the classical encoding procedure, its generator matrix is $A$.

Systematic encoding procedure: The message as an initial sequence of values
As mentioned above, there is an alternative way to map codewords $x$ to polynomials $p_x$.
In this alternative encoding procedure, the polynomial $p_x$ is the unique polynomial of degree less than $k$ such that

$p_x\left(a_i\right) = x_i$ holds for all $i=1,\dots,k$.

To compute this polynomial $p_x$ from $x$, one can use Lagrange interpolation.
Once it has been found, it is evaluated at the other points $a_\left\{k+1\right\},\dots,a_n$ of the field.
The alternative encoding function $C:F^k \to F^n$ for the Reed–Solomon code is then again just the sequence of values:

$C\left(x\right) = \big\left(p_x\left(a_1\right),\dots,p_x\left(a_n\right)\big\right)\,.$

This time, however, the first $k$ entries of the codeword are exactly equal to $x$, so this encoding procedure gives rise to a systematic code.
It can be checked that the alternative encoding function is a linear mapping as well.

The BCH view: The codeword as a sequence of coefficients
In this view, the sender again maps the message $x$ to a polynomial $p_x$, and for this, any of the two mappings above can be used (where the message is either interpreted as the coefficients of $p_x$ or as the initial sequence of values of $p_x$).
Once the sender has constructed the polynomial $p_x$ in some way, however, instead of sending the values of $p_x$ at all points, the sender computes some related polynomial $s$ of degree at most $n-1$ for $n=q-1$ and sends the $n$ coefficients of that polynomial.
The polynomial $s\left(a\right)$ is constructed by multiplying the message polynomial $p_x\left(a\right)$, which has degree at most $k-1$, with a generator polynomial $g\left(a\right)$ of degree $n-k$ that is known to both the sender and the receiver.[4]
The generator polynomial $g\left(x\right)$ is defined as the polynomial whose roots are exactly $\alpha,\alpha^2,\dots,\alpha^\left\{n-k\right\}$, i.e.,

$g\left(x\right) = \left(x-\alpha\right)\left(x-\alpha^2\right)\cdots\left(x-\alpha^\left\{n-k\right\}\right) = g_0 + g_1x + \cdots + g_\left\{n-k-1\right\}x^\left\{n-k-1\right\} + x^\left\{n-k\right\}\,.$

The transmitter sends the $n=q-1$ coefficients of $s\left(a\right)=p_x\left(a\right) \cdot g\left(a\right)$.
Thus, in the BCH view of Reed Solomon codes, the set $\mathbf\left\{C\text{'}\right\}$ of codewords is defined for $n=q-1$ as follows:[5]



\mathbf{C'}

= \Big\{\;
\big( s_1, s_2,\dots, s_{n} \big)
\;\Big|\;
s(a)=\sum_{i=1}^n s_i a^{i-1} \text{ is a polynomial that has at least the roots } \alpha^1,\alpha^2, \dots, \alpha^{n-k}
\;\Big\}\,.

With this definition of the codewords, it can be immediately seen that a Reed–Solomon code is a polynomial code, and in particular a BCH code. The generator polynomial $g\left(a\right)$ is the minimal polynomial with roots $\alpha,\alpha^2,\ldots,\alpha^\left\{n-k\right\}$ as defined above, and the codewords are exactly the polynomials that are divisible by $g\left(a\right)$.
Since Reed–Solomon codes are a special case of BCH codes and the Berlekamp–Massey algorithm has been designed for the decoding of such codes, it is applicable to Reed–Solomon codes:
The receiver interprets the received word as the coefficients of a polynomial $r\left(a\right)$.
If no error has occurred during the transmission, that is, if $r\left(a\right)=s\left(a\right)$, then the receiver can use polynomial division to determine the message polynomial $p_x\left(a\right) = r\left(a\right) / g\left(a\right)$.
In general, the receiver can use polynomial division to construct the unique polynomials $p\left(a\right)$ and $e\left(a\right)$, such that $e\left(a\right)$ has degree less than the degree of $g\left(a\right)$ and

$r\left(a\right) = p\left(a\right) \cdot g\left(a\right) + e\left(a\right)\,.$

If the remainder polynomial $e\left(a\right)$ is not identically zero, then an error has occurred during the transmission.
The receiver can evaluate $r\left(a\right)$ at the roots of $g\left(a\right)$ and build a system of equations that eliminates $s\left(a\right)$ and identifies which coefficients of $r\left(a\right)$ are in error, and the magnitude of each coefficient's error (Berlekamp 1984  and Massey 1969).
If the system of equations can be solved, then the receiver knows how to modify the received word $r\left(a\right)$ to get the most likely codeword $s\left(a\right)$ that was sent.

Systematic encoding procedure
The above encoding procedure for the BCH view of Reed–Solomon codes is classical, but does not give rise to a systematic encoding procedure, i.e., the codewords do not necessarily contain the message as a subsequence.
To remedy this fact, instead of sending $s\left(x\right) = p\left(x\right) g\left(x\right)$, the encoder constructs the transmitted polynomial $s\left(x\right)$ such that the coefficients of the $k$ largest monomials are equal to the corresponding coefficients of $p\left(x\right)$, and the lower-order coefficients of $s\left(x\right)$ are chosen exactly in such a way that $s\left(x\right)$ becomes evenly divisible by $g\left(x\right)$.
Then the coefficients of $p\left(x\right)$ are a subsequence of the coefficients of $s\left(x\right)$.
To get a code that is overall systematic, we construct the message polynomial $p\left(x\right)$ by interpreting the message as the sequence of its coefficients.
Formally, the construction is done by multiplying $p\left(x\right)$ by $x^t$ to make room for the $t=n-k$ check symbols, dividing that product by $g\left(x\right)$ to find the remainder, and then compensating for that remainder by subtracting it.
The $t$ check symbols are created by computing the remainder $s_r\left(x\right)$:

$s_r\left(x\right) = p\left(x\right)\cdot x^t \ \bmod \ g\left(x\right)\,.$

Note that the remainder has degree at most $t-1$, whereas the coefficients of $x^\left\{t-1\right\},x^\left\{t-2\right\},\dots,x^1,x^0$ in the polynomial $p\left(x\right)\cdot x^t$ are zero. Therefore, the following definition of the codeword $s\left(x\right)$ has the property that the first $k$ coefficients are identical to the coefficients of $p\left(x\right)$:

$s\left(x\right) = p\left(x\right)\cdot x^t - s_r\left(x\right)\,.$

As a result, the codewords $s\left(x\right)$ are indeed elements of $\mathbf\left\{C\text{'}\right\}$, that is, they are evenly divisible by the generator polynomial $g\left(x\right)$:[6]

$s\left(x\right) \equiv p\left(x\right)\cdot x^t - s_r\left(x\right) \equiv s_r\left(x\right) - s_r\left(x\right) \equiv 0 \mod g\left(x\right)\,.$

Equivalence of the two views
At first sight, the two views of Reed–Solomon codes above seem very different. In the first definition, codewords in the set $\mathbf\left\{C\right\}$ are values of polynomials, whereas in the second set $\mathbf\left\{C\text{'}\right\}$, they are coefficients. Moreover, the polynomials in the first definition are required to be of small degree, whereas those in the second definition are required to have specific roots.
Yet, it can be shown that the two sets are actually equal, that is, $\mathbf\left\{C\right\}=\mathbf\left\{C\text{'}\right\}$ holds (for an appropriate choice of $a_1,\dots,a_n$).
The equivalence of the two definitions is proved using the discrete Fourier transform. This transform, which exists in all finite fields as well as the complex numbers, establishes a duality between the coefficients of polynomials and their values. This duality can be approximately summarized as follows: Let $p\left(x\right)$ and $q\left(x\right)$ be two polynomials of degree less than $n$. If the values of $p\left(x\right)$ are the coefficients of $q\left(x\right)$, then (up to a scalar factor and reordering), the values of $q\left(x\right)$ are the coefficients of $p\left(x\right)$. For this to make sense, the values must be taken at locations $x=\alpha^i$, for $i=0,\dots,n-1$, where $\alpha$ is a primitive $n$th root of unity.
To be more precise, let

$p\left(x\right) = v_0 + v_1x + v_2x^2 + \cdots + v_\left\{n-1\right\}x^\left\{n-1\right\},$

$q\left(x\right) = f_0 + f_1x + f_2x^2 + \cdots + f_\left\{n-1\right\}x^\left\{n-1\right\}$

and assume $p\left(x\right)$ and $q\left(x\right)$ are related by the discrete Fourier transform. Then the coefficients and values of $p\left(x\right)$ and $q\left(x\right)$ are related as follows: for all $i=0,\dots,n-1$, $f_i=p\left(\alpha^i\right)$ and $\textstyle v_i=\frac\left\{1\right\}\left\{n\right\}q\left(\alpha^\left\{n-i\right\}\right)$.
Using these facts, we have: $\left(f_0,\ldots,f_\left\{n-1\right\}\right)$ is a code word of the Reed–Solomon code according to the first definition

if and only if $p\left(x\right)$ is of degree less than $k$ (because $f_0,\ldots,f_\left\{n-1\right\}$ are the values of $p\left(x\right)$),

if and only if $v_i=0$ for $i=k,\ldots,n-1$,

if and only if $q\left(\alpha^i\right)=0$ for $i=1,\ldots,n-k$ (because $q\left(\alpha^i\right)=nv_\left\{n-i\right\}$),

if and only if $\left(f_0,\ldots,f_\left\{n-1\right\}\right)$ is a code word of the Reed–Solomon code according to the second definition.

This shows that the two definitions are equivalent.

Remarks
Designers are not required to use the "natural" sizes of Reed–Solomon code blocks. A technique known as "shortening" can produce a smaller code of any desired size from a larger code. For example, the widely used (255,223) code can be converted to a (160,128) code by padding the unused portion of the source block with 95 binary zeroes and not transmitting them. At the decoder, the same portion of the block is loaded locally with binary zeroes. The Delsarte-Goethals-Seidel[7] theorem illustrates an example of an application of shortened Reed–Solomon codes. In parallel to shortening, a technique known as puncturing allows omitting some of the encoded parity symbols.

Properties
The Reed–Solomon code is a [n, k, n − k + 1] code; in other words, it is a linear block code of length n (over F) with dimension k and minimum Hamming distance n − k + 1. The Reed–Solomon code is optimal in the sense that the minimum distance has the maximum value possible for a linear code of size (n, k); this is known as the Singleton bound. Such a code is also called a maximum distance separable (MDS) code.
The error-correcting ability of a Reed–Solomon code is determined by its minimum distance, or equivalently, by $n - k$, the measure of redundancy in the block. If the locations of the error symbols are not known in advance, then a Reed–Solomon code can correct up to $\left(n-k\right)/2$ erroneous symbols, i.e., it can correct half as many errors as there are redundant symbols added to the block. Sometimes error locations are known in advance (e.g., "side information" in demodulator signal-to-noise ratios)—these are called erasures. A Reed–Solomon code (like any MDS code) is able to correct twice as many erasures as errors, and any combination of errors and erasures can be corrected as long as the relation 2E + S ≤ n − k is satisfied, where $E$ is the number of errors and $S$ is the number of erasures in the block.
For practical uses of Reed–Solomon codes, it is common to use a finite field $F$ with $2^m$ elements. In this case, each symbol can be represented as an $m$-bit value.
The sender sends the data points as encoded blocks, and the number of symbols in the encoded block is $n = 2^m - 1$. Thus a Reed–Solomon code operating on 8-bit symbols has $n = 2^8 - 1 = 255$ symbols per block. (This is a very popular value because of the prevalence of byte-oriented computer systems.) The number $k$, with $k < n$, of data symbols in the block is a design parameter. A commonly used code encodes $k = 223$ eight-bit data symbols plus 32 eight-bit parity symbols in an $n = 255$-symbol block; this is denoted as a $\left(n, k\right) = \left(255,223\right)$ code, and is capable of correcting up to 16 symbol errors per block.
The above properties of Reed–Solomon codes make them especially well-suited to applications where errors occur in bursts.  This is because it does not matter to the code how many bits in a symbol are in error — if multiple bits in a symbol are corrupted it only counts as a single error.  Conversely, if a data stream is not characterized by error bursts or drop-outs but by random single bit errors, a Reed–Solomon code is usually a poor choice compared to a binary code.
The Reed–Solomon code, like the convolutional code, is a transparent code. This means that if the channel symbols have been inverted somewhere along the line, the decoders will still operate. The result will be the inversion of the original data. However, the Reed–Solomon code loses its transparency when the code is shortened. The "missing" bits in a shortened code need to be filled by either zeros or ones, depending on whether the data is complemented or not. (To put it another way, if the symbols are inverted, then the zero-fill needs to be inverted to a one-fill.) For this reason it is mandatory that the sense of the data (i.e., true or complemented) be resolved before Reed–Solomon decoding.

Error correction algorithms
Theoretical decoder
Reed & Solomon (1960) described a theoretical decoder that corrected errors by finding the most popular message polynomial.  The decoder for a RS $\left(n,k\right)$ code would look at all possible subsets of $k$ symbols from the set of $n$ symbols that were received.  For the code to be correctable in general, at least $k$ symbols had to be received correctly, and $k$ symbols are needed to interpolate the message polynomial.  The decoder would interpolate a message polynomial for each subset, and it would keep track of the resulting polynomial candidates.  The most popular message is the corrected result.  Unfortunately, there are a lot of subsets, so the algorithm is impractical.  The number of subsets is the binomial coefficient, $\textstyle \binom\left\{n\right\}\left\{k\right\} = \left\{n! \over \left(n-k\right)! k!\right\}$, and the number of subsets is infeasible for even modest codes. For a $\left(255,249\right)$ code that can correct 3 errors, the naive theoretical decoder would examine 359 billion subsets.   The RS code needed a practical decoder.

Peterson decoder
Main article: Peterson–Gorenstein–Zierler algorithm
Peterson (1960) developed a practical decoder based on syndrome decoding.  (Welch 1997, p. 10)  Berlekamp (below) would improve on that decoder.

Syndrome decoding
The transmitted message is viewed as the coefficients of a polynomial s(x) that is divisible by a generator polynomial g(x).  Welch (1997, p. 5)

$s\left(x\right) = \sum_\left\{i = 0\right\}^\left\{n-1\right\} c_i x^i$

$g\left(x\right) = \prod_\left\{j=1\right\}^\left\{n-k\right\} \left(x - \alpha^j\right),$

where α is a primitive root.
Since s(x) is divisible by generator g(x), it follows that

$s\left(\alpha^i\right) = 0, \ i=1,2,\ldots,n-k$

The transmitted polynomial is corrupted in transit by an error polynomial e(x) to produce the received polynomial r(x).

$r\left(x\right) = s\left(x\right) + e\left(x\right)$

$e\left(x\right) = \sum_\left\{i=0\right\}^\left\{n-1\right\} e_i x^i$

where ei is the coefficient for the i-th power of x.  Coefficient ei will be zero if there is no error at that power of x and nonzero if there is an error.  If there are ν errors at distinct powers ik of x, then

$e\left(x\right) = \sum_\left\{k=1\right\}^\nu e_\left\{i_k\right\} x^\left\{i_k\right\}$

The goal of the decoder is to find the number of errors (ν), the positions of the errors (ik), and the error values at those positions (eik). From those, e(x) can be calculated and subtracted from r(x) to get the original message s(x).
The syndromes Sj are defined as



\begin{align}
S_j &= r(\alpha^j) = s(\alpha^j) + e(\alpha^j) = 0 + e(\alpha^j) = e(\alpha^j), \ j=1,2,\ldots,n-k \\

&= \sum_{k=1}^{\nu} e_{i_k} \left( \alpha^{j} \right)^{i_k}

\end{align}

The advantage of looking at the syndromes is that the message polynomial drops out. Another possible way of calculating e(x) is using polynomial interpolation to find the only polynomial that passes through the points $\left(\alpha^j,S_j\right)$ (Because $S_j=e\left(\alpha^j\right)$), however, this is not used widely because polynomial interpolation is not always feasible in the fields used in Reed-Solomon Error Correction. For example, it is feasible over the integers (of course), but it is infeasible over the integers modulo a prime.

Error locators and error values
For convenience, define the error locators Xk and error values Yk as:

$X_k = \alpha^\left\{i_k\right\}, \ Y_k = e_\left\{i_k\right\}$

Then the syndromes can be written in terms of the error locators and error values as

$S_j = \sum_\left\{k=1\right\}^\left\{\nu\right\} Y_k X_k^\left\{j\right\}$

The syndromes give a system of n − k ≥ 2ν equations in 2ν unknowns, but that system of equations is nonlinear in the Xk and does not have an obvious solution.  However, if the Xk were known (see below), then the syndrome equations provide a linear system of equations that can easily be solved for the Yk error values.

$\begin\left\{bmatrix\right\}$

X_1^1 & X_2^1 & \cdots & X_\nu^1 \\
X_1^2 & X_2^2 & \cdots & X_\nu^2 \\
\vdots & \vdots && \vdots \\
X_1^{n-k} & X_2^{n-k} & \cdots & X_\nu^{n-k} \\
\end{bmatrix}
\begin{bmatrix}
Y_1 \\ Y_2 \\ \vdots \\ Y_\nu
\end{bmatrix}
=
\begin{bmatrix}
S_1 \\ S_2 \\ \vdots \\ S_{n-k}
\end{bmatrix}

Consequently, the problem is finding the Xk, because then the leftmost matrix would be known, and both sides of the equation could be multiplied by its inverse, yielding Yk

Error locator polynomial
Peterson found a linear recurrence relation that gave rise to a system of linear equations. (Welch 1997, p. 10)
Solving those equations identifies the error locations.
Define the error locator polynomial Λ(x) as

$\Lambda\left(x\right) = \prod_\left\{k=1\right\}^\nu \left(1 - x X_k \right) = 1 + \Lambda_1 x^1 + \Lambda_2 x^2 + \cdots + \Lambda_\nu x^\nu$

The zeros of Λ(x) are the reciprocals $X_k^\left\{-1\right\}$:

$\Lambda\left(X_k^\left\{-1\right\}\right) = 0$

$\Lambda\left(X_k^\left\{-1\right\}\right) = 1 + \Lambda_1 X_k^\left\{-1\right\} + \Lambda_2 X_k^\left\{-2\right\} + \cdots + \Lambda_\nu X_k^\left\{-\nu\right\} = 0$

Multiply both sides by $Y_k X_k^\left\{j+\nu\right\}$ and it will still be zero. j is any number such that 1≤j≤v.



\begin{align}
& Y_k X_k^{j+\nu} \Lambda(X_k^{-1}) = 0. \\
\text{Hence } & Y_k X_k^{j+\nu} + \Lambda_1 Y_k X_k^{j+\nu} X_k^{-1} + \Lambda_2 Y_k X_k^{j+\nu} X_k^{-2} + \cdots + \Lambda_{\nu} Y_k X_k^{j+\nu} X_k^{-\nu} = 0, \\
\text{and so } & Y_k X_k^{j+\nu} + \Lambda_1 Y_k X_k^{j+\nu-1} + \Lambda_2 Y_k X_k^{j+\nu -2} + \cdots + \Lambda_{\nu} Y_k X_k^j = 0 \\
\end{align}

Sum for k = 1 to ν

\begin\left\{align\right\}

& \sum_{k=1}^\nu ( Y_k X_k^{j+\nu} + \Lambda_1 Y_k X_k^{j+\nu-1} + \Lambda_2 Y_k X_k^{j+\nu -2} + \cdots + \Lambda_{\nu} Y_k X_k^{j} ) = 0  \\
& \sum_{k=1}^\nu ( Y_k X_k^{j+\nu} ) + \Lambda_1 \sum_{k=1}^\nu (Y_k X_k^{j+\nu-1}) + \Lambda_2 \sum_{k=1}^\nu (Y_k X_k^{j+\nu -2}) + \cdots + \Lambda_\nu \sum_{k=1}^\nu ( Y_k X_k^j ) = 0
\end{align}
This reduces to

$S_\left\{j + \nu\right\} + \Lambda_1 S_\left\{j+\nu-1\right\} + \cdots + \Lambda_\left\{\nu-1\right\} S_\left\{j+1\right\} + \Lambda_\left\{\nu\right\} S_j = 0 \,$

$S_j \Lambda_\left\{\nu\right\} + S_\left\{j+1\right\}\Lambda_\left\{\nu-1\right\} + \cdots + S_\left\{j+\nu-1\right\} \Lambda_1 = - S_\left\{j + \nu\right\} \$

This yields a system of linear equations that can be solved for the coefficients Λi of the error location polynomial:

$\begin\left\{bmatrix\right\}$

S_1 & S_2 & \cdots & S_{\nu} \\
S_2 & S_3 & \cdots & S_{\nu+1} \\
\vdots & \vdots && \vdots \\
S_{\nu} & S_{\nu+1} & \cdots & S_{2\nu-1}
\end{bmatrix}
\begin{bmatrix}
\Lambda_{\nu} \\ \Lambda_{\nu-1} \\ \vdots \\ \Lambda_1
\end{bmatrix}
=
\begin{bmatrix}
- S_{\nu+1} \\ - S_{\nu+2} \\ \vdots \\ - S_{\nu+\nu}
\end{bmatrix}

The above assumes the decoder knows the number of errors ν, but that number has not been determined yet. The PGZ decoder does not determine ν directly but rather searches for it by trying successive values. The decoder first assumes the largest value for a trial ν and sets up the linear system for that value. If the equations can be solved (i.e., the matrix determinant is nonzero), then that trial value is the number of errors. If the linear system cannot be solved, then the trial ν is reduced by one and the next smaller system is examined. (Gill unknown, p. 35)[8]

Obtain the error locators from the error locator polynomial
Use the coefficients Λi found in the last step to build the error location polynomial. The roots of the error location polynomial can be found by exhaustive search. The error locators are the reciprocals of those roots. Chien search is an efficient implementation of this step.

Calculate the error locations
Calculate ik by taking the log base a of  Xk.

Calculate the error values
Once the error locators are known, the error values can be determined. This can be done by direct solution for Yk in the error equations given above, or using the Forney algorithm.

Fix the errors
Finally, e(x) is generated from ik and eik and then is subtracted from r(x) to get the sent message s(x).

Berlekamp–Massey decoder
The Berlekamp–Massey algorithm is an alternate iterative procedure for finding the error locator polynomial. During each iteration, it calculates a discrepancy based on a current instance of Λ(x) with an assumed number of errors e:

$\Delta = S_\left\{i\right\} + \Lambda_1 \ S_\left\{i-1\right\} + \cdots + \Lambda_e \ S_\left\{i-e\right\}$

and then adjusts Λ(x) and e so that a recalculated Δ would be zero. The article Berlekamp–Massey algorithm has a detailed description of the procedure. In the following example, C(x) is used to represent Λ(x).

Example
Consider the Reed–Solomon code defined in GF(929) with α = 3 and t = 4 (this is used in PDF417 barcodes). The generator polynomial is

$g\left(x\right) = \left(x-3\right)\left(x-3^2\right)\left(x-3^3\right)\left(x-3^4\right) = x^4+809 x^3+723 x^2+568 x+522$

If the message polynomial is p(x) = 3 x2 + 2 x + 1, then the codeword is calculated as follows.

$s_r\left(x\right) = p\left(x\right) \, x^t \mod g\left(x\right) = 547 x^3 + 738 x^2 + 442 x + 455$

$s\left(x\right) = p\left(x\right) \, x^t - s_r\left(x\right) = 3 x^6 + 2 x^5 + 1 x^4 + 382 x^3 + 191 x^2 + 487 x + 474$

$r\left(x\right) = s\left(x\right) + e\left(x\right) = 3 x^6 + 2 x^5 + 123 x^4 + 456 x^3 + 191 x^2 + 487 x + 474$

The syndromes are calculated by evaluating r at powers of α.

$S_1 = r\left(3^1\right) = 3\cdot 3^6 + 2\cdot 3^5 + 123\cdot 3^4 + 456\cdot 3^3 + 191\cdot 3^2 + 487\cdot 3 + 474 = 732$

$S_2 = r\left(3^2\right) = 637,\;S_3 = r\left(3^3\right) = 762,\;S_4 = r\left(3^4\right) = 925$

To correct the errors, first use the Berlekamp–Massey algorithm to calculate the error locator polynomial.

n

Sn+1

d

C

B

b

m

0
732
732
197 x + 1
1
732
1

1
637
846
173 x + 1
1
732
2

2
762
412
634 x2 + 173 x + 1
173 x + 1
412
1

3
925
576
329 x2 + 821 x + 1
173 x + 1
412
2

The final value of C is the error locator polynomial, Λ(x). The zeros can be found by trial substitution. They are x1 = 757 = 3−3 and x2 = 562 = 3−4, corresponding to the error locations. To calculate the error values, apply the Forney algorithm.

$\Omega\left(x\right) = S\left(x\right) \Lambda\left(x\right) \mod x^4 = 546 x + 732\,$

$\Lambda\text{'}\left(x\right) = 658 x + 821\,$

$e_1 = -\Omega\left(x_1\right)/\Lambda\text{'}\left(x_1\right) = -649/54 = 280 \times 843 = 74\,$

$e_2 = -\Omega\left(x_2\right)/\Lambda\text{'}\left(x_2\right) = 122\,$

Subtracting e1x3 and e2x4 from the received polynomial r reproduces the original codeword s.

Euclidean decoder
Another iterative method for calculating the error locator polynomial is based on the Euclidean algorithm

t = number of parities

R0 = xt

S0 = syndrome polynomial

A0 = 1

B0 = 0

i = 0

while degree of Si ≥ (t/2)

Q = Ri / Si

Si+1 = Ri – Q Si = Ri modulo Si

Ai+1 =  Q Ai + Bi

Ri+1 = Si

Bi+1 =  Ai

i = i + 1

Λ(x) = Ai / Ai(0)

Ω(x) = (–1)deg Ai Si / Ai(0)

Ai(0) is the constant (least significant) term of Ai.
Here is an example of the Euclidean method, using the same data as the Berlekamp Massey example above. In the table below, R and S are forward, A and B are reversed.

i

Ri

Ai

Si

Bi

0

001 x4 + 000 x3 + 000 x2 + 000 x + 000

001

925 x3 + 762 x2 + 637 x + 732

000

1

925 x3 + 762 x2 + 637 x + 732

533 + 232 x

683x2 + 676 x + 024

001

2

683 x2 + 676 x + 024

544 + 704 x + 608 x2

673 x + 596

533 + 232 x

Λ(x) = A2 / 544 = 001 + 821 x + 329 x2

Ω(x) = (–1)2 S2 / 544 = 546 x + 732

Decoding in frequency domain (sketch)
The above algorithms are presented in the time domain. Decoding in the frequency domain, using Fourier transform techniques, can offer computational and implementation advantages.  (Hong & Vetterli 1995)
The following is a sketch of the main idea behind this error correction technique.
By definition, a code word of a Reed–Solomon code is given by the sequence of values of a low-degree polynomial over a finite field. A key fact for the error correction algorithm is that the values and the coefficients of a polynomial are related by the discrete Fourier transform.
The purpose of a Fourier transform is to convert a signal from a time domain to a frequency domain or vice versa.
In case of the Fourier transform over a finite field, the frequency domain signal corresponds to the coefficients of a polynomial, and the time domain signal correspond to the values of the same polynomial.
As shown in Figures 1 and 2, an isolated value in the frequency domain corresponds to a smooth wave in the time domain. The wavelength depends on the location of the isolated value.
Conversely, as shown in Figures 3 and 4, an isolated value in the time domain corresponds to a smooth wave in the frequency domain.

In a Reed–Solomon code, the frequency domain is divided into two regions as shown in Figure 5: a left (low-frequency) region of length $k$, and a right (high-frequency) region of length $n-k$. A data word is then embedded into the left region (corresponding to the $k$ coefficients of a polynomial of degree at most $k-1$), while the right region is filled with zeros. The result is Fourier transformed into the time domain, yielding a code word that is composed only of low frequencies. In the absence of errors, a code word can be decoded by reverse Fourier transforming it back into the frequency domain.
Now consider a code word containing a single error, as shown in red in Figure 6. The effect of this error in the frequency domain is a smooth, single-frequency wave in the right region, called the syndrome of the error. The error location can be determined by determining the frequency of the syndrome signal.
Similarly, if two or more errors are introduced in the code word, the syndrome will be a signal composed of two or more frequencies, as shown in Figure 7. As long as it is possible to determine the frequencies of which the syndrome is composed, it is possible to determine the error locations. Notice that the error locations depend only on the frequencies of these waves, whereas the error magnitudes depend on their amplitudes and phase.
The problem of determining the error locations has therefore been reduced to the problem of finding, given a sequence of $n-k$ values, the smallest set of elementary waves into which these values can be decomposed. It is known from digital signal processing that this problem is equivalent to finding the roots of the minimal polynomial of the sequence, or equivalently, of finding the shortest linear feedback shift register (LFSR) for the sequence. The latter problem can either be solved inefficiently by solving a system of linear equations, or more efficiently by the  Berlekamp–Massey algorithm.

Decoding beyond the error-correction bound
The Singleton bound states that the minimum distance d of a linear block code of size (n,k) is upper-bounded by n − k + 1. The distance d was usually understood to limit the error-correction capability to ⌊d/2⌋. The Reed–Solomon code achieves this bound with equality, and can thus correct up to ⌊(n − k + 1)/2⌋ errors. However, this error-correction bound is not exact.
In 1999, Madhu Sudan and Venkatesan Guruswami at MIT published "Improved Decoding of Reed–Solomon and Algebraic-Geometry Codes" introducing an algorithm that allowed for the correction of errors beyond half the minimum distance of the code.[9] It applies to Reed–Solomon codes and more generally to algebraic geometric codes. This algorithm produces a list of codewords (it is a list-decoding algorithm) and is based on interpolation and factorization of polynomials over $GF\left(2^m\right)$ and its extensions.

Soft-decoding
The algebraic decoding methods described above are hard-decision methods, which means that for every symbol a hard decision is made about its value.[10] The advent of LDPC and turbo codes, which employ iterated soft-decision belief propagation decoding methods to achieve error-correction performance close to the theoretical limit, has spurred interest in applying soft-decision decoding to conventional algebraic codes. In 2003, Ralf Koetter and Alexander Vardy presented a polynomial-time soft-decision algebraic list-decoding algorithm for RS codes, which was based upon the work by Sudan and Guruswami.[11]

BCH code

Cyclic code

Chien search

Berlekamp–Massey algorithm

Forward error correction

Berlekamp–Welch algorithm

Folded Reed–Solomon code

Notes

References