0

Berlekamp-Massey algorithm

I am trying to implement this algorithm in above picture. The Berlekamp-Massey algorithm solves the following problem in a RS(n,k) system : Given a syndrome polynomial

S(z) = {S(n-k-1),........S(2),S(1),S(0)}

, finds the Smallest degree Error polynomial. This algorithm works fine for all Syndromes but when S(0) becomes 0, the error polynomial is incorrect. Is there anything missing from the algorithm mentioned ??

1 Answers1

1

At what point does it fail? Is it failing to produce an error locator polynomial, or does it create one that doesn't have the proper roots, or is it failing later, such as the Forney algorithm?

I'm not sure if you really mean S(0) in your question. Most articles define S(j) as the sum of elements times successive powers (locations) of (alpha^j). It's important that the syndromes used by a decoder are based on the roots of the generator polynomial, if the first consecutive root = FCR = alpha^0 = 1 (g(x) = (x-1)(x-alpha)(x-alpha^2)...), use S(0) through S(n-k-1), or if FCR = alpha (g(x) = (x-alpha)(x-alpha^2)...), use S(1) through S(n-k).

Any RS decoder should work, despite zero syndromes, as long as there aren't too many zero syndromes (which would indicate an uncorrectable error).

The wiki article has a simpler description of the algorithm with example code. Note it uses lambda (Λ) instead of sigma (σ) to represent the error locator polynomial. The description is for the example code, and in this case S[0] could mean S(0) or S(1), depending on the FCR (which is not mentioned).

https://en.wikipedia.org/wiki/Berlekamp%E2%80%93Massey_algorithm

I also wrote interactive RS programs for 4 bit and 8 bit fields, which include Berlekamp Massey as one of the three decoders implemented in the programs. The programs allow the user to specify FCR as 1 or 2, unless a self-reciprocal polynomial is chosen (a non-popular option used to simplify hardware encoders). In these example programs, the polynomials are generally stored most significant term first (legacy issue), so the code shifts arrays to deal with this.

http://rcgldr.net/misc/eccdemo4.zip

http://rcgldr.net/misc/eccdemo8.zip


I modded one one of my ecc demo programs to work with GF(2^10). I ran your test case:

S[...] = {0000 0596 0302 0897}   (S[0] = 0)

These are the iterations and polynomials that I get for BM decoder:

k      d    σ

0   0000    0001
1   0596    0596 x^2 + 0000 x + 0001
2   0302    0596 x^2 + 1006 x + 0001
3   0147    0585 x^2 + 1006 x + 0001

roots are:

383 = 1/(2^526) and 699 = 1/(2^527)

Trivia, by reversing the coefficients, you get the locators instead of their inverse:

 0001 x^2 + 1006 x + 0585 : roots are 346 = 2^526 and 692 = 2^527

Note that Forney needs the unreversed polynomial if using Forney to calculate the error values.

rcgldr
  • 27,407
  • 3
  • 36
  • 61
  • 1
    @Sudarshanshenoy - take a look at the wiki article for [RS classic syndrome decoding](https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction#Syndrome_decoding). This explains the key relationship between syndromes and the generator polynomial, which is the basis for the decoder methods shown in the wiki article. In the wiki articles, the generator polynomial is g(x) = (x-alpha^1)(x-alpha^2)..., so S(1) through S(n-k) are the syndromes that are used. – rcgldr Oct 30 '18 at 05:56
  • Field is GF(2^10) , Generater polynomial is x^10 + x^3 + 1 = 0. We are actually using shortened code(528,514). The syndromes are evaluated with the generator polynomial itself. Consider the case where e(X) = 512 x^527 + 512 x^526. The syndromes go like , S(alpha^0) = 0 , S(alpha^1) = 596 , S(alpha^2) = 302 and so on.... Now in Berlekamp Method , first descrepancy becomes 0. Then for k = 1 , L(length of LFSR) becomes 2. The final error polynomial is incorrect. – Sudarshan shenoy Oct 30 '18 at 06:02
  • @Sudarshanshenoy - I added your test case to my answer, except I'm using σ[k+1] = σ[k] - (d/δ) β[k] . – rcgldr Oct 30 '18 at 08:57
  • 1
    @Sudarshanshenoy - I think the question is useful for others, specifically that one or more syndromes can be zero. The expectation is that all the non-error terms will sum up to zero, but what could be unexpected to others reading this is that some of the error terms may also sum up to zero. In addition, it's also an example where a non-zero discrepancy can increase the degree of σ by more than one or in other cases not at all, and this example shows both situations, going from 0 to 2 on the first iteration, then staying at 2 for the rest of the iterations while the constants get fixed. – rcgldr Oct 30 '18 at 09:42
  • 1
    @Sudarshanshenoy - I added a bit of trivia related to [reciprocal polynomial](https://en.wikipedia.org/wiki/Reciprocal_polynomial). – rcgldr Oct 30 '18 at 09:56
  • WOW. I will surely use this. – Sudarshan shenoy Oct 30 '18 at 10:02