Berlekamp–Welch algorithm

From HandWiki
Short description: Error-correcting algorithm

The Berlekamp–Welch algorithm, also known as the Welch–Berlekamp algorithm, is named for Elwyn R. Berlekamp and Lloyd R. Welch. This is a decoder algorithm that efficiently corrects errors in Reed–Solomon codes for an RS(n, k), code based on the Reed Solomon original view where a message m1,,mk is used as coefficients of a polynomial F(ai) or used with Lagrange interpolation to generate the polynomial F(ai) of degree < k for inputs a1,,ak and then F(ai) is applied to ak+1,,an to create an encoded codeword c1,,cn.

The goal of the decoder is to recover the original encoding polynomial F(ai), using the known inputs a1,,an and received codeword b1,,bn with possible errors. It also computes an error polynomial E(ai) where E(ai)=0 corresponding to errors in the received codeword.

The key equations

Defining e = number of errors, the key set of n equations is

biE(ai)=E(ai)F(ai)

Where E(ai) = 0 for the e cases when bi ≠ F(ai), and E(ai) ≠ 0 for the n - e non error cases where bi = F(ai) . These equations can't be solved directly, but by defining Q() as the product of E() and F():

Q(ai)=E(ai)F(ai)

and adding the constraint that the most significant coefficient of E(ai) = ee = 1, the result will lead to a set of equations that can be solved with linear algebra.

biE(ai)=Q(ai)
biE(ai)Q(ai)=0
bi(e0+e1ai+e2ai2++eeaie)(q0+q1ai+q2ai2++qqaiq)=0

where q = n - e - 1. Since ee is constrained to be 1, the equations become:

bi(e0+e1ai+e2ai2++ee1aie1)(q0+q1ai+q2ai2++qqaiq)=biaie

resulting in a set of equations which can be solved using linear algebra, with time complexity O(n3).

The algorithm begins assuming the maximum number of errors e = ⌊(n-k)/2⌋. If the equations can not be solved (due to redundancy), e is reduced by 1 and the process repeated, until the equations can be solved or e is reduced to 0, indicating no errors. If Q()/E() has remainder = 0, then F() = Q()/E() and the code word values F(ai) are calculated for the locations where E(ai) = 0 to recover the original code word. If the remainder ≠ 0, then an uncorrectable error has been detected.

Simple Example

The error locator polynomial serves to "neutralize" errors in P by making Q zero at those points, so that the system of linear equations is not affected by the inaccuracy in the input.

Consider a simple example where a redundant set of points are used to represent the line y=5x, and one of the points is incorrect. The points that the algorithm gets as an input are (1,4),(2,3),(3,4),(4,1), where (3,4) is the defective point. The algorithm must solve the following system of equations:

Q(1)=4*E(1)Q(2)=3*E(2)Q(3)=4*E(3)Q(4)=1*E(4)


Given a solution Q and E to this system of equations, it is evident that at any of the points x=1,2,3,4 one of the following must be true: either Q(xi)=E(xi)=0, or P(xi)=Q(xi)E(xi)=yi. Since E is defined as only having a degree of one, the former can only be true in one point. Therefore, P(xi) must equal yi at the three other points.

Letting E(x)=x+e0 and Q(x)=q0+q1x+q2x2 and bringing E(x) to the left, we can rewrite the system thus:

q0+q1+q24e04=0q0+2q1+4q23e06=0q0+3q1+9q24e012=0q0+4q1+16q2e04=0


This system can be solved through Gaussian elimination, and gives the values:

q0=15,q1=8,q2=1,e0=3


Thus, Q(x)=x2+8x15,E(x)=x3. Dividing the two gives:

Q(x)E(x)=P(x)=5x


5x fits three of the four points given, so it is the most likely to be the original polynomial.

Example

Consider RS(7,3) (n = 7, k = 3) defined in GF(7) with α = 3 and input values: ai = i-1 : {0,1,2,3,4,5,6}. The message to be systematically encoded is {1,6,3}. Using Lagrange interpolation, F(ai) = 3 x2 + 2 x + 1, and applying F(ai) for a4 = 3 to a7 = 6, results in the code word {1,6,3,6,1,2,2}. Assume errors occur at c2 and c5 resulting in the received code word {1,5,3,6,3,2,2}. Start off with e = 2 and solve the linear equations:

[b1b1a11a1a12a13a14b2b2a21a2a22a23a24b3b3a31a3a32a33a34b4b4a41a4a42a43a44b5b5a51a5a52a53a54b6b6a61a6a62a63a64b7b7a71a7a72a73a74][e0e1q0q1q2q3q4]=[b1a12b2a22b3a32b4a42b5a52b6a62b7a72]


[1060000556666636653656464513356356323623152561616][e0e1q0q1q2q3q4]=[0222165]


[1000000010000000100000001000000010000000100000001][e0e1q0q1q2q3q4]=[4243313]

Starting from the bottom of the right matrix, and the constraint e2 = 1:

Q(ai)=3x4+1x3+3x2+3x+4

E(ai)=1x2+2x+4

F(ai)=Q(ai)/E(ai)=3x2+2x+1 with remainder = 0.

E(ai) = 0 at a2 = 1 and a5 = 4 Calculate F(a2 = 1) = 6 and F(a5 = 4) = 1 to produce corrected code word {1,6,3,6,1,2,2}.

See also