Content deleted Content added
Fixed typo is algorithm description |
→Pseudocode: added a sum symbol, subscripts and superscripts. Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 95:
The algorithm from {{Harvtxt|Massey|1969|p=124}} for an arbitrary field:
<!-- Notes: notation changes from Massey:
Massey Here
Line 105 ⟶ 106:
-->
polynomial(field ''K'') s(x) = ... /* coeffs are s<sub>j</sub>; output sequence as N-1 degree polynomial) */
polynomial(field K)
▲polynomial(field K) B(x) = 1;
int
/* steps 2. and 6. */
for (n = 0; n < N; n++) {▼
/*
field K d = s<sub>n</sub> + {{math|∑{{su|p=L|b=i=1}} c<sub>i</sub> s<sub>n - i</sub>}} <!--∑i=1Lci⋅sn−i;-->
▲for (n = 0; n < N; n++) {
/* step 3. discrepancy is zero; annihilation continues */
L = n + 1 - L;
C(x) = C(x) - d b<sup>-1</sup> x<sup>m</sup> B(x);
} else {▼
▲ m = m + 1;
}
return L;▼
▲return L;
In the case of binary GF(2) BCH code, the discrepancy d will be zero on all odd steps, so a check can be added to avoid calculating it.
for (n = 0; n < N; n++) {▼
/* if odd step number, discrepancy == 0, no need to calculate it */▼
▲for (n = 0; n < N; n++) {
if ((n&1) != 0) {
▲ /* if odd step number, discrepancy == 0, no need to calculate it */
==See also==
|