• No results found

Correction of errors of weight 2

3 The Many Decoding Algorithms for Reed – Solomon Codes

3.3 Correction of errors of weight 2

3.3 Correction of errors of weight 2

A binary extended BCH code over GF(2) with minimum distance 5 can be decoded in a simple way by factoring a quadratic equation over GF(2). An extended Preparata code over Z4can be decoded in a similar simple way by dropping combinations of the Z4syndromes into GF(2), then factoring a quadratic equation over GF(2). We shall develop these decoding procedures for distance-5 codes both over GF(2) and over Z4

in this section. In each case, because the extended code must have even weight, the existence of a two-error-correcting decoder implies further that the extended code has weight 6 so it can detect triple errors. This means that the decoders that we describe

149 3.3 Correction of errors of weight 2

can be easily extended – though we will not do so – to detect triple errors as well as correct double errors.

A BCH code of minimum distance 5 over GF(2) is the set of polynomials c(x) such that c(α) = c(α3) = 0. The syndromes are S1=v(α) = e(α) and S3=v(α3) = e(α3).

For a single-error pattern, e(x) = xi, so S1 = αi and S3 = α3i. This case can be recognized by noting that S13+ S3 = 0. Then the exponent of α, in S1, points to the location of the error. For a double-error pattern, e(x) = xi + xi. The syndromes are S1 = X1+ X2, which is nonzero, and S3 = X13+ X23, where X1 = αi and X2 = αi. This case can be recognized by noting that S13+ S3= 0. Then

(x − X1)(x − X2) = x2+ S1x+ (S13+ S3)/S1.

The polynomial on the right side depends only on the syndromes. By factoring the right side, as by trial and error, one obtains X1 and X2. The exponents ofα in X1 and X2 point to the two error locations. Thus this process forms a decoding algorithm for a distance-5 BCH code.

We will now give a comparable decoding algorithm for an extended Preparata code over the ring Z4 that corrects all error patterns of Lee weight 2 or less. This means that the minimum Lee distance of the code is at least 5, and since the min-imum distance of the extended code must be even, it is at least 6. This decoding algorithm provides an alternative proof that the minimum distance of the extended Preparata code is (at least) 6. The decoding algorithm also applies to an extended Preparata code over GF(2m) simply by regarding each pair of bits as a symbol of Z4.

Letv(x) be any senseword polynomial with Lee distance at most 2 from a code-word c(x) of the Preparata code. The senseword polynomialv(x) can be regarded as a codeword polynomial c(x) corrupted by an error polynomial asv(x) = c(x) + e(x).

The correctible sensewords consist of two cases: single errors, either with e(x) = 2xi or with e(x) = ±xi; and double errors, with e(x) = ±xi ± xi. (Detectable error patterns, which we do not consider here, have Lee weight 3 and consist of double errors with e(x) = 2xi± xi and triple errors with e(x) = ±xi± xi ± xi.) Because the codewords are defined by c + c(1) = 0 and c(ξ) = c(ξ2) = 0, the sense-word v(x) can be reduced to three pieces of data. These are the three syndromes S0 = v+v(1) = e+ e(1), S1 = v(ξ) = e(ξ), and S2 = v(ξ2) = e(ξ2). We will give an algorithm to compute e(x) from S0, S1, and S2. (Although syndrome S2 contains no information not already in S1, it is more convenient to use both S2and S1 as the input to the decoder.)

The syndrome S0 is an element of Z4, corresponding to one of three situations. If S0 = 0, either there are no errors or there are two errors with values +1 and −1. If S0 = ±1, then there is one error with value ±1. If S0 = 2, then either there are two errors, both with the same value+1 or −1, or there is a single error with value 2.

Suppose there is a single error, so e(x) = eixi, and S0= ei,

S1= e(ξ) = eiξi, S2= e(ξ2) = eiξ2i,

where ei = ±1 or 2. The case of a single error of Lee weight 1 can be recognized by noting that S0is ±1, or by computing S12m and finding that S12m = S1. The case of a single error of Lee weight 2 can be recognized by noting that S0 = 2 and S12 = 0.

If either instance of a single error is observed, thenξi = S1/S0. The exponent ofξ uniquely points to the single term of e(x) with a nonzero coefficient. Syndrome S0is the value of the error.

For the case of a correctable pattern with two errors, S0 = 0 or 2 and S12m = S1. Because the Lee weight is 2, ei = ±1 and ei= ±1. Then

S0= e(1) = ±1 ± 1, S1= e(ξ) = ±ξi± ξi, S2= e(ξ2) = ±ξ2i± ξ2i.

Syndrome S0 = 0 if the two errors have opposite signs. In this case, without loss of generality, we write e(x) = xi − xi. If, instead, the two errors have the same sign, syndrome S2= 2. Thus for any correctable pattern with two errors, we have

S12− S2 = ξ2i+ 2ξiξi+ ξ2i∓ ξ2i∓ ξ2i

=

⎧⎪

⎪⎩

2iξi+ ξ2i) if S0= 0

2iξi) if S0= 2 and both errors are + 1 22i+ ξiξi+ ξ2i) if S0= 2 and both errors are − 1.

In any case, this is an element of Z4that has only an even part, which is twice the odd part of the term in parentheses. Every even element of GR(4m) is a unique element of GF(2m) multiplied by 2, so the terms in parentheses can be dropped into GF(2m). Let B be the term S12− S2, reduced by the factor of 2. Then

B=

⎧⎪

⎪⎩

αiαi+ α2i if S0= 0

αiαi if S0= 2 and both errors are + 1 α2i+ αiαi+ α2i if S0= 2 and both errors are − 1.

Let A denote S1modulo 2 and let X1and X2 denoteξi andξi modulo 2. Then the equations, now in GF(2), become

A= X1+ X2

151 3.4 The Sugiyama algorithm

and

B+ X12= X1X2 if S0= 0,

B= X1X2 if S0= 2 and both errors are + 1, B+ A2= X1X2 if S0= 2 and both errors are − 1.

It is trivial to solve the first case by substituting X2 = A + X1into B+ X12 = X1X2. This yields X1 = B/A and X2 = A + B/A. The latter two cases, those with S0 = 2, though not distinguished by the value of S0, can be distinguished because only one of them has a solution. To see this, reduce the equations to observe that, in the two cases, X1and X2are the solutions of either

z2+ Az + B = 0 or

z2+ Az + A2+ B = 0.

The first of these can be solved only if trace(B/A2) = 0. The second can be solved only if trace(B/A2) = 1. Only one of these can be true, so only one of the two polynomials has its zeros in the locator field.