请输入您要查询的百科知识:

 

词条 Berlekamp–Massey algorithm
释义

  1. Description of algorithm

  2. Code sample

  3. The algorithm for the binary field

  4. See also

  5. References

  6. External links

{{distinguish|Berlekamp's algorithm}}

The Berlekamp–Massey algorithm is an algorithm that will find the shortest linear feedback shift register (LFSR) for a given binary output sequence. The algorithm will also find the minimal polynomial of a linearly recurrent sequence in an arbitrary field. The field requirement means that the Berlekamp–Massey algorithm requires all non-zero elements to have a multiplicative inverse.[1] Reeds and Sloane offer an extension to handle a ring.[2]

Elwyn Berlekamp invented an algorithm for decoding Bose–Chaudhuri–Hocquenghem (BCH) codes.[3][4] James Massey recognized its application to linear feedback shift registers and simplified the algorithm.[5][6] Massey termed the algorithm the LFSR Synthesis Algorithm (Berlekamp Iterative Algorithm),[7] but it is now known as the Berlekamp–Massey algorithm.

Description of algorithm

The Berlekamp–Massey algorithm is an alternative to the Reed–Solomon Peterson decoder for solving the set of linear equations. It can be summarized as:

In the code examples below, C(x) is a potential instance of Λ(x). The error locator polynomial C(x) for L errors is defined as:

or reversed:

The goal of the algorithm is to determine the minimal degree L and C(x) which results in all syndromes

being equal to 0:

Algorithm:

C(x) is initialized to 1, L is the current number of assumed errors, and initialized to zero. N is the total number of syndromes. n is used as the main iterator and to index the syndromes from 0 to (N-1). B(x) is a copy of the last C(x) since L was updated and initialized to 1. b is a copy of the last discrepancy d (explained below) since L was updated and initialized to 1. m is the number of iterations since L, B(x), and b were updated and initialized to 1.

Each iteration of the algorithm calculates a discrepancy d. At iteration k this would be:

If d is zero, the algorithm assumes that C(x) and L are correct for the moment, increments m, and continues.

If d is not zero, the algorithm adjusts C(x) so that a recalculation of d would be zero:

The xm term shifts B(x) so it follows the syndromes corresponding to 'b'. If the previous update of L occurred on iteration j, then m = k - j, and a recalculated discrepancy would be:

This would change a recalculated discrepancy to:

The algorithm also needs to increase L (number of errors) as needed. If L equals the actual number of errors, then during the iteration process, the discrepancies will become zero before n becomes greater than or equal to (2 L). Otherwise L is updated and algorithm will update B(x), b, increase L, and reset m = 1. The formula L = (n + 1 - L) limits L to the number of available syndromes used to calculate discrepancies, and also handles the case where L increases by more than 1.

Code sample

The algorithm from {{Harvtxt|Massey|1969|p=124}} for an arbitrary field:

  polynomial(field K) s(x) = ... /* coeffs are s_j; output sequence as N-1 degree polynomial) */  /* connection polynomial */  polynomial(field K) C(x) = 1;  /* coeffs are c_j */  polynomial(field K) B(x) = 1;  int L = 0;  int m = 1;  field K b = 1;  int n;
  /* steps 2. and 6. */  for (n = 0; n < N; n++)    {      /* step 2. calculate discrepancy */      field K d = s_n + \\Sigma_{i=1}^L c_i * s_{n-i};
      if (d == 0)        {          /* step 3. discrepancy is zero; annihilation continues */          m = m + 1;        }      else if (2 * L <= n)        {          /* step 5. */          /* temporary copy of C(x) */          polynomial(field K) T(x) = C(x);
          C(x) = C(x) - d b^{-1} x^m B(x);          L = n + 1 - L;          B(x) = T(x);          b = d;          m = 1;        }      else        {          /* step 4. */          C(x) = C(x) - d b^{-1} x^m B(x);          m = m + 1;        }    }  return L;

The algorithm for the binary field

The following is the Berlekamp–Massey algorithm specialized for the binary finite field F2 (also written GF(2)). The field elements are '0' and '1'. The field operations '+' and '−' are identical and are equivalent to the 'exclusive or' operation, XOR. The multiplication operator '*' becomes the logical AND operation. The division operator reduces to the identity operation (i.e., field division is only defined for dividing by 1, and x/1 = x).

  1. Let be the bits of the stream.
  2. Initialise two arrays and each of length to be zeroes, except
  3. assign .
  4. For step 1 while :
    • Let discrepancy be .
    • if , then is already a polynomial which annihilates the portion of the stream from to .
    • else:
    • * Let be a copy of .
    • * Set up to (where is the Exclusive or operator).
    • * If , set , set , and let ; otherwise leave , and alone.

At the end of the algorithm, is the length of the minimal LFSR for the stream, and we have for all .

See also

  • Reed–Solomon error correction
  • Reeds–Sloane algorithm, an extension for sequences over integers mod n
  • NLFSR, Non-Linear Feedback Shift Register

References

1. ^{{Harvnb|Reeds|Sloane|1985|p=2}}
2. ^{{Citation |last=Reeds |first=J. A. |last2=Sloane |first2=N. J. A. |authorlink2=N. J. A. Sloane |journal=SIAM Journal on Computing |volume=14 |issue=3 |pages=505–513 |year=1985 |title=Shift-Register Synthesis (Modulo n) |url=http://neilsloane.com/doc/Me111.pdf |doi=10.1137/0214038 |citeseerx=10.1.1.48.4652 }}
3. ^{{Citation |last= Berlekamp |first= Elwyn R. |authorlink= Elwyn Berlekamp |title= Nonbinary BCH decoding |year= 1967 |series= International Symposium on Information Theory |place= San Remo, Italy}}
4. ^{{Citation |last= Berlekamp |first= Elwyn R. |authorlink= Elwyn Berlekamp |title=Algebraic Coding Theory |place=Laguna Hills, CA |origyear=1968 |year=1984 |edition= Revised |publisher=Aegean Park Press |isbn= 978-0-89412-063-3}}. Previous publisher McGraw-Hill, New York, NY.
5. ^{{Citation |first= J. L. |last= Massey |authorlink= James Massey |title= Shift-register synthesis and BCH decoding |journal= IEEE Trans. Inf. Theory |volume= IT-15 |issue= 1 |year= 1969 |pages= 122–127 |url= http://crypto.stanford.edu/~mironov/cs359/massey.pdf|doi= 10.1109/TIT.1969.1054260 }}
6. ^{{Citation |last= Ben Atti |first= Nadia |last2= Diaz-Toca |first2= Gema M. |last3= Lombardi |first3= Henri |title= The Berlekamp–Massey Algorithm revisited |citeseerx=10.1.1.96.2743 |doi= }}
7. ^{{Harvnb|Massey|1969|p=124}}

External links

  • {{springer|title=Berlekamp-Massey algorithm|id=p/b120140}}
  • [https://web.archive.org/web/20120716181541/http://planetmath.org/encyclopedia/BerlekampMasseyAlgorithm.html Berlekamp–Massey algorithm] at PlanetMath.
  • {{MathWorld|urlname=Berlekamp-MasseyAlgorithm|title=Berlekamp–Massey Algorithm}}
  • [https://code.google.com/p/lfsr/ GF(2) implementation in Mathematica]
  • {{de icon}} Applet Berlekamp–Massey algorithm
  • [https://berlekamp-massey-algorithm.appspot.com/ Online GF(2) Berlekamp-Massey calculator]
{{DEFAULTSORT:Berlekamp-Massey Algorithm}}

2 : Error detection and correction|Cryptanalytic algorithms

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/14 6:31:02