Lably
Skip to content

Berlekamp–Welch algorithm

  • 2 min read
  • 2 chapters

Explore on Lably

ToursExplore Lably’s 3D tours

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+⋯+ee−1aie−1)−(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.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Scientists, inventors, and mathematicians