Lecture 5 Decodng Bnary BCH Codes In ths class, we wll ntroduce dfferent methods for decodng BCH codes 51 Decodng the [15, 7, 5] 2 -BCH Code Consder the [15, 7, 5] 2 -code C we ntroduced n the last lecture Its generator polynomal s g(x) (x 4 +x+1)(x 4 + x 3 + x 2 + x + 1), and f ω denotes a zero of x 4 + x + 1, then the roots of g(x) are ω, ω 2, ω 3, ω 4, ω 6, ω 8, ω 9, ω 12 Suppose that we have a receved word y (y 0,, y 14 ) of whch we know that t has dstance 2 from a codeword Our task s to fnd the closest codeword c to y We know that y c + e, where e s of weght at most 2 Let us assume for now that e s of weght exactly 2, and t s one at postons 1 and 2, say What do we know then? Let y(x) y x, c(x) c x, and e(x) x 1 + x 2 The only polynomal n ths lst that we know s y(x) But, we also know that y(α) e(α) whenever c(α) 0, so that we know S for 1, 2, 3, 4, 6, 8, 9, 12, where S : y(ω ) Thus, set X : ω 1 and Y : ω 2, we know the followng: X + Y S 1 X 2 + Y 2 S 2 X 3 + Y 3 S 3 X 4 + Y 4 S 4 We have left out the other equatons, because, as t turns out, these four are suffcent to determne the error postons 1 and 2 Our task s to fnd X and Y, two nonzero and dfferent elements n F 2 k F(ω) satsfyng the above equatons Note that ths descrpton s also vald when the weght of e s 1: n that case, X or Y are zero Suppose that we could fnd XY from these equatons Then we would know X + Y (whch s S 1 ), and XY, so that we know the polynomal (X z)(y z) z 2 (X + Y )z + XY Factorng ths polynomal then reveals X and Y Our task should thus consst of fndng XY Note that S 3 1 (X + Y ) 3 (X 2 + Y 2 )(X + Y ) X 3 + Y 3 + XY (X + Y ) S 3 + XY S 1 (51) Snce S 1 0, we fnd that XY S 2 1 S 3 /S 1 S 2 S 3 /S 1, and we can thus decode the code Example 51 Let ω be a root of x 4 + x + 1 F 2 [x] For the followng calculaton, t s advantageous to keep a table of the varous representatons of powers of ω, whch s gven n Table 51 Lecture and scrbes by Amn Shokrollah
2 Modern Codng Theory, Sprng 2006 1 ω 2 ω 2 3 ω 3 4 ω + 1 5 ω 2 + ω 6 ω 3 + ω 2 7 ω 3 + ω + 1 ω 8 ω 2 + 1 9 ω 3 + ω 10 ω 2 + ω + 1 11 ω 3 + ω 2 + ω 12 ω 3 + ω 2 + ω + 1 13 ω 3 + ω 2 + 1 14 ω 3 + 1 ω Table 51: Table of values of ω Suppose that we have receved the word The polynomal y(x) s then equal to We therefore have y (0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0) y(x) x 4 + x 6 + x 7 + x 8 + x 13 S 1 y(ω) ω 2 + ω 3 ω 6 S 2 y(ω 2 ) 1 + ω + ω 2 + ω 3 ω 12 S 3 y(ω 3 ) 1 + ω + ω 3 ω 7 S 4 y(ω 4 ) ω + ω 3 ω 9 (52) The polynomal to be factored s z 2 + (ω 2 + ω 3 )z + (ω 12 ω) z 2 + ω 6 z + ω 13 There are varous ways to factor ths polynomal, one of whch s to try all possble values of ω for z Such a search (called a Chen Search n the lterature) reveals the two zeros ω 0, ω 13 of ths polynomal Ths shows that the receved word has errors at postons 0 and 13, so that the closest codeword to y s (1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0) 52 The Newton Relatons The general method of decodng s about the same: suppose that the generator polynomal of the code has the consecutve set of zeros ω, ω 2,, ω 2t Then we can correct at most t errors We form the polynomal y(x) from the receved word, and calculate S 1 y(ω), S 2 y(ω 1 ),, S 2t y(ω 2t ) We call these values the syndromes of the receved word y If the error postons are 1,, t, then we wrte X l for ω l, and we obtan the relatons X 1 + + X t S 1, X1 2 + + Xt 2 S 2, X 2t 1 + + X 2t t S 2t How can we obtan the coeffcents of the polynomal L(z) (z X 1 ) (z X t ) from these relatons? Ths s expressed n terms of Newton Relatons To descrbe them, t s more convenent to work wth the polynomal H(z) (1 X 1 z) (1 X t z) nstead Of course, f we can fnd ths polynomal (usually called the error-locatng polynomal), then we can read off the locatons of the errors from ths polynomal Theorem 52 [Newton Relatons] Let H(z) ( 1) t σ t z t + ( 1) t 1 σ t 1 z t 1 + σ 1 z + 1, and let H (z) denote the formal dervatve of H wth respect to z Further, let S(z) S 1 + S 2 z + S 3 z 2 + be a power seres wth the S as coeffcents Then we have H(z) S(z) H (z)
Lecture 5: Decodng Bnary BCH Codes 3 Proof We work wth formal power seres Then we have whch s equvalent to our asserton H (z) t H(z) X j H(z) 1 X j z t X j Xj l z l H(z) l 0 H(z) S(z), l 0 t X l+1 j z l 53 Recurrence Relatons Let S (S 1, S 2,, S 2t ) be a sequence of length 2t over a feld F A polynomal r(z) of degree t s called a recurrence relaton for the sequence f there s a polynomal µ(z) of degree less than deg(r) such that S(z) µ(z)/r(z), where S(z) S 1 + S 2 z + + S 2t z 2t 1 Note that S may not have a recurrence at all However, f t does, then t has a mnmal recurrence, e, one of mnmal degree It turns out that every recurrence s a multple of a mnmal one, and hence, the mnmal recurrence s unque up to scalar multplcaton Sums of recurrence relatons are also recurrence relatons, Theorem 53 Suppose that S(z) S 1 + S 2 z + + S 2t z 2t 1 has a recurrence Then t has a mnmal recurrence µ(z), and any other recurrence s a multple of µ(z) Moreover, f S(z) v(z)/a(z) for co-prme polynomals v(z) and a(z) wth deg(u) < deg(a) t, then a(z) s a mnmal recurrence Proof Let S(z) η(z)/µ(z) mod z 2t wth deg(η) < deg(µ) We can assume that η(z) and µ(z) are co-prme, because otherwse the mnmalty of µ(z) would be volated Let h(z) be another recurrence relaton for S, wth S(z) v(z)/a(z) mod z 2t Then a(z)η(z) v(z)µ(z) 0 mod z 2t It s easly seen that the degree of the left-hand sde s less than 2t, so that the polynomal on the left s zero Ths means that v(z)/a(z) η(z)/µ(z) Snce µ s of mnmal degree and η(z) and µ(z) are co-prme, ths shows that a(z) s a multple of µ(z) Suppose now that S(z) v(z)/a(z) wth co-prme a(z) and v(z) Snce v(z)/a(z) η(z)/µ(z), the polynomal a(z) must be a scalar multple of µ(z), hence s a mnmal recurrence The Newton relatons of the prevous secton proves that the error locator s a recurrence for the sequence of syndromes S 1, S 2, In fact, t turns out that t s a mnmal recurrence for ths sequence Theorem 54 Any recurrence relaton of length 2t and degree t for the sequence of syndromes s a multple of the error locator polynomal Proof Let H(z) denote the error locator By the Newton relatons we have S(z) H (z)/h(z) Snce H(z) does not have double roots, the polynomals H (z) and H(z) are co-prme, hence H(z) s a mnmal recurrence The prevous result mples the followng Corollary 55 If a(z) s a polynomal of degree t and v(z) s a polynomal of degree < t, and f a(z)s(z) v(z) mod z 2t, (53) then a(z) s a multple of the error locator H(z) Moreover, a mnmal soluton to (53e, a nonzero soluton of mnmal degree) s (up to scalar multplcaton) the error locator How ths can be used s demonstrated n the next sectons
4 Modern Codng Theory, Sprng 2006 54 Decodng BCH-Codes usng Matrx Equatons Snce multplcaton of both sdes of (53) wth a nonzero polynomal does not alter the equaton, we can assume that a(z) s of degree t Let a 0, a 1,, a t 1 denote the coeffcents of z 0, z 1,, z t 1 n a(z), respectvely By consderng the coeffcents of z t, z t+1,, z 2t 1 on both sdes of (53) we obtan the followng system of equatons: S t+1 S t S 2 S t+2 S t+1 S 3 S 2t S 2t 1 S t+1 a 0 a 1 a t 1 S 1 S 2 S t (54) From the results of the last secton we know that the above system has a soluton, and that any soluton s a multple of the error locator The algorthm we present here s a modfed verson of the Peterson-Gorensten-Zerler decoder 1 Upon recepton of y, check whether t s n the code If so, then STOP 2 Compute the syndromes S y(ω ), 1,, 2t 3 Fnd a nonzero soluton a of the system (54) Declare ERROR f t does not exst 4 Form the polynomal a(z) and calculate ts roots ω 1,, ω s n {1, ω,, ω n 1 } 5 Declare postons 1,, s as erasures Use any erasure decodng algorthm for the BCH-code to recover these postons and obtan a codeword c The way t s descrbed, ths algorthm uses O(t 3 ) steps for solvng the system (54), and an addtonal O(k 3 ) steps for the erasure decodng step Ths can be mproved n several ways Frst, the system of equatons gven n (54) s structured The matrx correspondng to ths system s called a Toepltz matrx and ts nverse can be found wth O(t 2 ) operatons over F 2 (ω) We wll encounter structured matrces and methods for nvertng them later n the class The second way n whch ths algorthm can be mproved s the erasure decodng part, whch could also be accomplshed wth O(k 2 ) operatons over F 2 (ω) Note that ths part could be avoded altogether f we could mmedately fnd the error locator n the frst step The algorthm provded n the next secton s more effcent In fact, t fnds the error locator mmedately, though we wll not prove ths here Example 56 We use the same example as n the frst secton Then, recallng (52), the system (54) becomes ( ) ω 7 ω 12 a0 ω 6 ω 9 ω 7 We obtan a 0 ω 2 and a 1 ω 8 The polynomal a(z) s thus equal to ω 2 + ω 8 z + z 2 Its roots are 1 ω 0 and ω 2 ω 13, and hence the error locatons are contaned n 0 and 13 In ths case, the error locatons are exactly these two values a 1 ω 12 55 Decodng Bnary BCH Codes va the Extended GCD-Algorthm One way to obtan the polynomals a(z) and v(z) n (53) s the followng We apply the extended GCD-algorthm to S(z) and z 2t At each step of the algorthm, we obtan polynomals a (z), b (z), and v (z) such that a 1 (z)s(z) + b 1 (z)z 2t v (z) As soon as the degree of v (z) becomes smaller than that of a 1 (z), we have satsfed the assumptons of Corollary 55, and we have dentfed a super-set of the error postons Erasure decodng, as descrbed n the prevous secton, wll then reveal the correct codeword The polynomals a, b, and v are obtaned as follows Set v 0 (z) z 2t, and v 1 (z) S(z) Then, at each step 0, perform a dvson algorthm to compute q such that v (z) q (z)v +1 (z) + v +2 Ths way, we have ( v+1 v +2 1 q 1 q 1 1 q 0 v0 v 1 b a : b +1 a +1 v0 v 1 )
Lecture 5: Decodng Bnary BCH Codes 5 To have a matrx equaton between (v, v +1 ) and (v 0, v 1 ) for all values of 0, we defne ( ) b 1 a 1 1 0 : (55) b 0 a 0 Then we have the recurrence relatons ( b a b +1 a +1 1 q b 1 a 1 b a b q b + b 1 a q a + a 1 ) The algorthm would thus proceed as follows: 1 Intalze a, b, 1, 0, as n (55) 2 Intalze v 0 z 2t and v 1 S(z), 0 3 Whle deg(v ) deg(a 1 ) do (advson step) Compute q (z) and v +2 from v (z) q (z)v +1 (z) + v +2 (bupdate) Set a +1 q a + a 1, and b +1 q b + b 1 (c) Set + 1 4 The polynomal a 1 (z) s now a multple of the error locator polynomal Calculate ts roots ω 1,, ω s n {1, ω,, ω n 1 } 5 Declare postons 1,, s as erasures Use any erasure decodng algorthm for the BCH-code to recover these postons and obtan a codeword c On the surface, ths algorthm has not really mproved the Peterson-Gorensten-Zerler algorthm However, t can be shown that the polynomal b 1 (z) found above s n fact a scalar multple of the error locator, though we are not gong to show t here (Ths result s due to varous researchers, among them Mc Elece, Welch and Scholtz, Chenc, and Dornstetter) The algorthm gven above s essentally equvalent to the famous Berlekamp-Massey algorthm whch fnds a mnmal recurrence of degree t for the frst 2t values of a gven sequence We wll dscuss ths algorthm n the exercses Example 57 We contnue wth the runnng example of Secton 1 Settng v 0 (z) z 4 and v 1 (z) S(z) ω 9 z 3 + ω 7 z 2 + ω 12 z + ω 6, we obtan v 0 (z) v 1 (z) (ω 6 z + ω 4 ) + (ω 5 z 2 + ω 11 z + ω 10 ) v 1 (z) q 0 (z) + v 2 (z) b 1 (z) 1 a 1 (z) q 0 (z) v 1 (z) v 2 (z) (ω 4 z + ω 7 ) + ω 3 v 2 (z) q 1 (z) + v 3 (z) b 2 (z) q 1 (z) a 2 (z) q 1 (z) b 1 (z) + b 0 (z) (ω 6 z + ω 4 ) (ω 4 z + ω 7 ) + 1 ω 10 z 2 + ω 3 z + ω 12 We see that deg(v 3 ) < deg(a 2 ), and hence a 2 (z) s a multple of the error locator Ths polynomal has the roots ω 0 and ω 13, whch shows that the errors are at most n postons 0 and 13