Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Berlekamp–Massey algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Description of algorithm== The Berlekamp–Massey algorithm is an alternative to the [[Reed–Solomon error correction#Peterson–Gorenstein–Zierler decoder|Reed–Solomon Peterson decoder]] for solving the set of linear equations. It can be summarized as finding the coefficients Λ<sub>''j''</sub> of a polynomial Λ(''x'') so that for all positions ''i'' in an input stream ''S'': :<math> S_{i + \nu} + \Lambda_1 S_{i+\nu-1} + \cdots + \Lambda_{\nu-1} S_{i+1} + \Lambda_\nu S_i = 0. </math> 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: :<math> C(x) = C_L x^L + C_{L-1} x^{L-1} + \cdots + C_2 x^2 + C_1 x + 1 </math> or reversed: :<math> C(x) = 1 + C_1 x + C_2 x^2 + \cdots + C_{L-1} x^{L-1} + C_L x^L. </math> The goal of the algorithm is to determine the minimal degree ''L'' and ''C''(''x'') which results in all [[Decoding methods#Syndrome decoding|syndromes]] :<math> S_n + C_1 S_{n-1} + \cdots + C_L S_{n-L}</math> being equal to 0: :<math> S_n + C_1 S_{n-1} + \cdots + C_L S_{n-L} = 0,\qquad L\le n\le N-1.</math> 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: :<math> d \gets S_k + C_1 S_{k-1} + \cdots + C_L S_{k-L}.</math> 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: :<math>C(x) \gets C(x) - (d / b) x^m B(x).</math> The ''x<sup>m</sup>'' 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: :<math> d \gets S_k + C_1 S_{k-1} + \cdots - (d/b) (S_j + B_1 S_{j-1} + \cdots ).</math> This would change a recalculated discrepancy to: :<math> d = d - (d/b)b = d - d = 0.</math> 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 the 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)