In coding theory, the '''Forney algorithm''' (or '''Forney's algorithm''') calculates the error values at known error locations. It is used as one of the steps in decoding BCH codes and Reed&ndash;Solomon codes (a subclass of BCH codes). George David Forney Jr. developed the algorithm in 1965.<ref>{{Harvnb|Forney|1965}}</ref>

==Procedure== :''Need to introduce terminology and the setup...''

Code words look like polynomials. By design, the generator polynomial has consecutive roots &alpha;<sup>c</sup>, &alpha;<sup>''c''+1</sup>, ..., &alpha;<sup>''c''+''d''&minus;2</sup>.<!-- for RS, c = 1 -->

Syndromes

Error location polynomial<ref>{{Harvnb|Gill|n.d.|p=24}}</ref>

:<math>\Lambda(x) = \prod_{i=1}^\nu (1- x \, X_i) = 1 + \sum_{i=1}^\nu \lambda_i \, x^i</math>

The zeros of &Lambda;(''x'') are ''X''<sub>1</sub><sup>&minus;1</sup>, ..., ''X''<sub>''&nu;''</sub><sup>&minus;1</sup>. The zeros are the reciprocals of the error locations <math>X_j = \alpha^{i_j}</math>.

Once the error locations are known, the next step is to determine the error values at those locations. The error values are then used to correct the received values at those locations to recover the original codeword.

In the more general case, the error weights {{mvar|e<sub>j</sub>}} can be determined by solving the linear system

:<math>s_0 = e_1 \alpha^{(c + 0)\,i_1} + e_2 \alpha^{(c + 0)\,i_2} + \cdots \, </math> :<math>s_1 = e_1 \alpha^{(c + 1)\,i_1} + e_2 \alpha^{(c + 1)\,i_2} + \cdots \, </math> :<math> \cdots \, </math>

However, there is a more efficient method known as the Forney algorithm, which is based on Lagrange interpolation. First calculate the error evaluator polynomial<ref name="Gill-Forney">{{Harvnb|Gill|n.d.|p=47}}</ref>

:<math>\Omega(x) = S(x)\,\Lambda(x) \pmod{x^{2t}} \, </math> <!-- previous used small omega; mod was x^(d-1); Gill uses 2t. -->

Where {{math|''S''(''x'')}} is the partial syndrome polynomial:<ref>{{Harvtxt|Gill|n.d.|p=48}}</ref> :<math>S(x) = s_0 x^0 + s_1 x^1 + s_2 x^2 + \cdots + s_{2t-1} x^{2t-1}.</math>

Then evaluate the error values:<ref name="Gill-Forney"/> <!-- Gill uses b where c is used above -->

:<math>e_j = - \frac{X_j^{1-c} \, \Omega(X_j^{-1})}{\Lambda'(X_j^{-1})} \, </math> <!-- minus often left out because no effect in common fields. Formal derivative in some fields has drastic simplification. -->

The value {{mvar|c}} is often called the "first consecutive root" or "fcr". Some codes select {{math|''c'' {{=}} 1}}, so the expression simplifies to: :<math>e_j = - \frac{\Omega(X_j^{-1})}{\Lambda'(X_j^{-1})}</math>

==Formal derivative== {{Main|Formal derivative}}

&Lambda;'(''x'') is the formal derivative of the error locator polynomial &Lambda;(''x''):<ref name="Gill-Forney"/> :<math>\Lambda'(x) = \sum_{i=1}^{\nu} i \, \cdot \, \lambda_i \, x^{i-1}</math> <!-- nu is number of errors / order of Lambda(x). Better exposition needed. -->

In the above expression, note that ''i'' is an integer, and &lambda;<sub>''i''</sub> would be an element of the finite field. The operator &sdot; represents ordinary multiplication (repeated addition in the finite field) which is the same as the finite field's multiplication operator, i.e. :<math> i\lambda = (1+\ldots+1)\lambda=\lambda+\ldots+\lambda. </math> For instance, in characteristic 2, <math>i\lambda=0, \lambda</math> according as ''i'' is even or odd. <!-- discuss simplification. When addition is exclusive or (common case), only odd ''i'' are relevant. -->

==Derivation== Lagrange interpolation

{{Harvtxt|Gill|n.d.|pp=52&ndash;54}} gives a derivation of the Forney algorithm.

==Erasures== Define the erasure locator polynomial :<math>\Gamma(x) = \prod (1- x \, \alpha^{j_i})</math> Where the erasure locations are given by ''j<sub>i</sub>''. Apply the procedure described above, substituting &Gamma; for &Lambda;.

If both errors and erasures are present, use the error-and-erasure locator polynomial :<math>\Psi(x) = \Lambda(x) \, \Gamma(x)</math>

==See also== *BCH code *Reed&ndash;Solomon error correction

==References== {{reflist|30em}} *{{Citation |first= G. |last= Forney |authorlink=Dave Forney |title= On Decoding BCH Codes |journal= IEEE Transactions on Information Theory |volume= 11 |issue= 4 |date= October 1965 |pages= 549–557 |issn= 0018-9448 |doi= 10.1109/TIT.1965.1053825}} *{{Citation |last = Gill |first = John |title = EE387 Notes #7, Handout #28 |date = n.d. |accessdate = April 21, 2010 |pages = 42&ndash;45 |publisher = Stanford University |url = http://www.stanford.edu/class/ee387/handouts/notes7.pdf |url-status = dead |archiveurl = https://web.archive.org/web/20140630172526/http://web.stanford.edu/class/ee387/handouts/notes7.pdf |archivedate = June 30, 2014 }} * W. Wesley Peterson's book

{{DEFAULTSORT:Forney algorithm}} Category:Error detection and correction Category:Coding theory