Top Banner
Cyclic Codes ECEN 5682 Theory and Practice of Error Control Codes Cyclic Codes Peter Mathys University of Colorado Spring 2007 Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
29

ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Jul 04, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic Codes

ECEN 5682 Theory and Practice of Error ControlCodes

Cyclic Codes

Peter Mathys

University of Colorado

Spring 2007

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 2: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Cyclic Codes

Linear cyclic codes have a lot of structure that can be exploited forhighly efficient encoder and decoder implementations. The class oflinear cyclic codes includes BCH (Bose-Chaudhuri-Hocquenghem)codes, RS (Reed-Solomon) codes, and the Golay codes. It alsoincludes CRC (cyclic redundancy check) error detection codeswhich are widely used in data communications and data storage.

Definition: A q-ary linear (n, k) blockcode C is called a cyclic codeif every cyclic shift of a codeword in C is also a codeword in C.

Note: It is possible to define and construct non-linear codes withthe property that every cyclic shift of a codeword is anothercodeword. However, these codes have less structure and are hardlyused in practice.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 3: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Example: Let c = (c0, c1, . . . , cn−1) be a codeword of C. If C is acyclic code, then the cyclic shift to the right by one place of c,denoted c(1), and defined by

c(1) = (cn−1, c0, c1, . . . , cn−2) ,

must also be in C. Repeated application yields the codewordcyclically shifted to the right by i places

c(i) = (cn−i , cn−i+1, . . . , cn−1, c0, c1, . . . , cn−i−1) ,

which must also be in C. Note that a cyclic shift to the right by iplaces is equivalent to a cyclic shift to the left by n − i places.

Note: A cyclic right shift of a codeword c over F by i placescorresponds to multiplying the corresponding code polynomial c(x)by x i in the quotient ring F [x ]/(xn − 1), i.e.,

c(i) ←→ Rxn−1(xi c(x)) .

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 4: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Theorem: The monic nonzero code polynomial of minimum degreein a linear cyclic code C is unique.

Proof: Suppose g(x) = x r + gr−1 x r−1 + . . . + g0 andg ′(x) = x r + g ′r−1 x r−1 + . . . + g ′0 are both such monic nonzerocode polynomials of minimum degree. Because the code is linear,g(x)− g ′(x) = (gr−1− g ′r−1) x r−1 + . . . + (g0− g ′0) must also be acodeword. Since it has degree at most r − 1, this contradicts thestatement that g(x) and g ′(x) are nonzero code polynomials ofsmallest degree, unless g(x) = g ′(x). QED

Definition: The unique monic nonzero code polynomial ofminimum degree in a linear cyclic code C is denoted by g(x) andcalled the generator polynomial of C.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 5: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Theorem: Let g(x) be the generator polynomial of a linear cycliccode C of blocklength n and assume deg g(x) = r < n. Then apolynomial c(x) with deg c(x) < n is a code polynomial iff it is amultiple of g(x), i.e., iff c(x) = a(x) g(x), where deg a(x) < n− r .

Proof: Suppose c(x) is a multiple of g(x). Then

c(x) = a(x) g(x) = (an−r−1 xn−r−1 + . . . + a1 x + a0) g(x)

= an−r−1 xn−r−1g(x) + . . . + a1 xg(x) + a0 g(x) ,

i.e., c(x) is a linear combination of the code polynomialsg(x), xg(x), . . . , xn−r−1g(x), and thus c(x) ∈ C.Now suppose that c(x) ∈ C. Use the division algorithm to writethat c(x) = a(x) g(x) + r(x), with deg r(x) < deg g(x). Thusr(x) = c(x)− a(x) g(x). But both c(x) ∈ C and a(x) g(x) ∈ Cwhich implies that r(x) ∈ C since C is linear. This is a contradictionto the fact that g(x) is the smallest degree nonzero codepolynomial in C, unless r(x) = 0. Thus c(x) = a(x) g(x). QED

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 6: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Corollary: Let g(x) be the generator polynomial of a linear cyclic(n, k) code C. Then deg g(x) = n − k.

Proof: Follows immediately from above theorem.

Theorem: A linear cyclic code C of blocklength n with generatorpolynomial g(x) exists iff g(x) | (xn − 1).

Proof: Using the division algorithm, write xn−1=h(x) g(x)+r(x),with deg r(x) < deg g(x). Then

0=Rxn−1(xn−1)=Rxn−1(h(x) g(x)+r(x))=Rxn−1(h(x) g(x))+r(x),

which implies r(x) = −Rxn−1(h(x) g(x)). That is, r(x) is a codepolynomial with degree less than deg g(x) and the only such codepolynomial is r(x) = 0. Therefore g(x) | (xn − 1). Since everypolynomial that divides xn−1 can be used as a generatorpolynomial, this completes the proof. QED

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 7: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Definition: The polynomial h(x) in xn − 1 = h(x) g(x), where g(x)is a generator polynomial, is called parity-check polynomial.

Note: The above theorem asserts that any factor of xn − 1 overGF(q) with degree n − k generates a q-ary linear cyclic (n, k)code. However, not all such factors generate good (i.e., large dmin)codes.

Any code polynomial c(x) of a linear cyclic (n, k) code C can bewritten as c(x) = a(x) g(x), deg a(x) < k, where g(x) is thegenerator polynomial of C and deg g(x) = n − k. This polynomialmultiplication can be expressed in vector-matrix form as

c(x) =[a0 a1 · · · ak−1

]

g(x)x g(x)

...xk−1 g(x)

.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 8: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Setting c = (c0, c1, . . . , cn−1) and a = (a0, a1, . . . , ak−1), acodeword c can thus be written as c = aG, where the generatormatrix G is given by

G =

g0 g1 · · · gn−k

g0 g1 · · · gn−k 0. . .

. . .. . .

. . .

0 g0 g1 · · · gn−k

g0 g1 · · · gn−k

.

Next, recall that g(x) | (xn − 1) and that xn − 1 = g(x) h(x),where h(x) is the parity-check polynomial of C. This leads to thefollowing theorem.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 9: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Theorem: Let C be a linear cyclic (n, k) code with parity-checkpolynomial h(x) =

∑ki=0 hi x

i . Then the parity check matrix H ofC is given by

H =

hk hk−1 · · · h0

hk hk−1 · · · h0 0. . .

. . .. . .

. . .

0 hk hk−1 · · · h0

hk hk−1 · · · h0

.

Proof: It needs to be shown that GHT = 0. Definevm =

∑mi=0 hi gm−i . Then

GHT =

vk vk+1 · · · vn−1

vk−1 vk · · · vn−2...

......

v1 v2 · · · vn−k

.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 10: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Butg(x) h(x) =

n−kXi=0

gi xi

kXj=0

hj xj =

n−kXi=0

kXj=0

gihj xi+j

=nX

m=0

mXj=0

hjgm−j xm =

nXm=0

vm xm = xn − 1 .

The last equality implies that vm = 0 for 0 < m < n and thusGHT = 0 as claimed. QED

Note that the top row of H can be expressed in polynomialnotation as

h̃(x) = xk h(x−1) = h0xk + h1x

k−1 + . . . + hk .

Since H is the generator matrix of the dual code, it is not difficultto prove the following

Theorem: Let C be a linear cyclic (n, k) code with generatorpolynomial g(x). Then the dual code C⊥ is cyclic as well and isgenerated by h̃(x) = xk h(x−1), where h(x) = (xn − 1)/g(x).

Proof: Left as an exercise.Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 11: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

It is often convenient to use a systematic encoder. Computingc(x) = u(x) g(x), where u(x) is the information polynomial, will ingeneral not yield c(x) in systematic form. However, the followingencoding rule will ensure systematic codewords of the formc = (b0, b1, . . . , bn−k−1, u0, u1, . . . , uk−1).

Systematic encoding rule: Multiply the information polynomialu(x) by xn−k and add b(x) =

∑n−k−1i=0 bi x

i such thatc(x) = xn−k u(x) + b(x) is divisible by g(x), i.e., such that

Rg(x)[c(x)] = Rg(x)[xn−k u(x)+b(x)] = Rg(x)[x

n−k u(x)]+b(x) = 0.

This requires that

b(x) = −Rg(x)[xn−k u(x)] .

Note that the systematic encoding rule produces exactly the sameset of codewords as any nonsystematic encoding rule. The onlydifference is that the mapping from u(x) to c(x) is different.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 12: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Definition: Let c(x) be a code polynomial and let v(x) be areceived (possibly corrupted) code polynomial. Thene(x) = v(x)− c(x) is called the error polynomial. It has nonzerocoefficients in those locations where channel errors occured.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 13: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Construction of BCH and RS Codes

BCH (Bose-Chaudhuri-Hocquenghem) codes and RS(Reed-Solomon) codes are two large classes of cyclic multiple errorcorrecting codes that are used in many practical applications. Forsmall to moderate blocklengths (up to a few thousand symbols)both classes of codes contain good codes (but usually not the bestcodes known). The main reason for the popularity of the BCH andRS codes is the (relative) ease with which they can be generatedand decoded (mostly processing hard decisions) using shift registercircuits.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 14: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Definition: Given q, m ≥ 1, and n such that n | (qm − 1), letβ ∈ GF(qm) be any primitive n-th root of unity. Then, for anyinteger h, the corresponding BCH code of designed minimumdistance d is the cyclic code of blocklength n with symbols inGF(q) with generator polynomial

g(x) = lcm {fh(x), fh+1(x), . . . , fh+d−2(x)} ,

where fj(x) is the minimal polynomial over GF(q) of βj . That is,g(x) has the following d − 1 consecutive powers of β as roots{

βh, βh+1, . . . , βh+d−2}

.

Note that g(x) usually has more roots than the ones shown above.Often h = 1 is selected and then the resulting code is called anarrow-sense BCH code. If n = qm − 1, then the BCH code iscalled a primitive BCH code.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 15: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Note: In general k (the number of information symbols) is onlyknown after the lcm (least common multiple) operation isperformed.

Theorem: BCH bound. The BCH codes as defined above satisfy

dmin ≥ designed minimum distance d .

Proof: Will be given later.

Example: Binary n = 15, d = 7 (designed minimum distance)BCH code. Since 24 − 1 = 15 = n, choose β = α, whereα ∈ GF (24) is a primitive element (with order 15). Setting h = 1and using d = 7, a generator polynomial is needed that has thefollowing 6 consecutive powers of α as roots:

{α1, α2, α3, α4, α5, α6} .

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 16: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

To make sure that g(x) has all its coefficients in GF (2) use

g(x) = lcm{f1(x), f2(x), f3(x), f4(x), f5(x), f6(x)} = f1(x) f3(x) f5(x),

where

f1(x) = minimal polynomial of {α1, α2, α4, α8} ,

f3(x) = minimal polynomial of {α3, α6, α12, α9} ,

f5(x) = minimal polynomial of {α5, α10} .

Since deg [f1(x)] = deg [f3(x)] = 4 and deg [f5(x)] = 2,deg [g(x)] = n − k = 4 + 4 + 2 = 10 and thus k = 5.

To actually compute g(x), the elements of GF (24) have to begenerated. Using the primitive polynomial p(x) = x4 + x + 1, thefollowing elements and minimal polynomials are obtained:

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 17: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Element α3 α2 α1 α0 Order Minimal Polynomial

α0 0 0 0 1 1 x + 1α1 0 0 1 0 15 x4 + x + 1α2 0 1 0 0 15 x4 + x + 1α3 1 0 0 0 5 x4 + x3 + x2 + x + 1α4 0 0 1 1 15 x4 + x + 1α5 0 1 1 0 3 x2 + x + 1α6 1 1 0 0 5 x4 + x3 + x2 + x + 1α7 1 0 1 1 15 x4 + x3 + 1α8 0 1 0 1 15 x4 + x + 1α9 1 0 1 0 5 x4 + x3 + x2 + x + 1α10 0 1 1 1 3 x2 + x + 1α11 1 1 1 0 15 x4 + x3 + 1α12 1 1 1 1 5 x4 + x3 + x2 + x + 1α13 1 1 0 1 15 x4 + x3 + 1α14 1 0 0 1 15 x4 + x3 + 1

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 18: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

The generator polynomial can now be written as

g(x) = (1 + x + x4)(1 + x + x2 + x3 + x4)(1 + x + x2)

= 1 + x + x2 + x4 + x5 + x8 + x10 .

The generator matrix for this binary (15, 5, 7) BCH code is

G =

1 1 1 0 1 1 0 0 1 0 1 0 0 0 00 1 1 1 0 1 1 0 0 1 0 1 0 0 00 0 1 1 1 0 1 1 0 0 1 0 1 0 00 0 0 1 1 1 0 1 1 0 0 1 0 1 00 0 0 0 1 1 1 0 1 1 0 0 1 0 1

.

To encode the message polynomial u(x) = 1 + x2 + x3, forexample, one can either compute c(x) = u(x)g(x), or c = uG,where u = (1011). The result is

c(x) = 1+x+x4+x6+x11+x12+x13 ↔ c = (110010100001110).

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 19: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Example: Shortened binary n = 14, d = 7 BCH code. Start fromthe (15, 5, 7) code given above with generator polynomial

g(x) = 1 + x + x2 + x4 + x5 + x8 + x10 .

But now restrict the message polynomial u(x) to have degree lessthan or equal to 3 so that c(x) = u(x)g(x) will always havedeg[c(x)] ≤ 13 (and thus n = 14). The generator matrix of thisshortened binary (14, 4, 7) BCH code is

G =

1 1 1 0 1 1 0 0 1 0 1 0 0 00 1 1 1 0 1 1 0 0 1 0 1 0 00 0 1 1 1 0 1 1 0 0 1 0 1 00 0 0 1 1 1 0 1 1 0 0 1 0 1

,

i.e., the same as before, but with the last column and the last rowdeleted. Note that shortened BCH codes are not cyclic codesanymore in general, but they can be encoded and decoded as ifthey were cyclic codes.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 20: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

RS codes can be viewed as a subset of the BCH codes and definedas follows.

Definition: For RS codes use the same construction as for BCHcodes, but set m = 1. Thus, β ∈ GF(q) and the codewords areover GF(q).

Note: For RS codes fj(x) and βj are both over the same field andthus fj(x) = x − βj . Therefore, for RS codes,

g(x) = (x − βh) (x − βh+1) · · · (x − βh+d−2) .

This implies, deg g(x) = n − k = d − 1 from which k = n − d + 1follows. Often h = 1 is chosen.

Theorem: RS codes as defined above satisfy

dmin = designed minimum distance d .

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 21: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Proof: From the BCH bound dmin ≥ d . But for RS codesd = n − k + 1 and the Singleton bound states that for any linearcode dmin ≤ n − k + 1. QED

Corollary: RS codes are MDS codes.

Note: Shortened RS codes (n and k reduced by the sameamounts) and punctured RS codes (n and r = n − k reduced bythe same amounts) are also MDS codes, but they are no longercyclic codes.

Example: RS code over GF(24) with blocklength n = 15 andminimum distance dmin = 5. Set β = α, where α ∈ GF(24) is aprimitive element. Then, setting h = 1, compute the generatorpolynomial as (based on generating GF(24) using the primitivepolynomial x4 + x + 1)

g(x) = (x − β) (x − β2) (x − β3) (x − β4)

= x4 + α13 x3 + α6 x2 + α3 x + α10 .

The resulting code is a (15, 11, 5) RS code over GF(24).Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 22: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Decoding of BCH and RS Codes

One of the key features of BCH and RS codes is that they arequite easy to decode (up to the designed minumum distance d andusing hard decisions from the channel output). Let

c(x) = c0 + c1 x + . . . + cn−1 xn−1 , transmitted codeword,

e(x) = e0 + e1 x + . . . + en−1 xn−1 , error pattern,

v(x) = v0 + v1 x + . . . + vn−1 xn−1 , received codeword,

and assume v(x) = c(x) + e(x). Suppose that the error patterncontains ν errors at locations `1, `2, . . . , `ν , with 0 ≤ `j < n. Thus

e(x) = e`1 x`1 + e`2 x`2 + . . . + e`ν x`ν ,

where e`jare the error values. Note that initially `j , e`j

, and ν areunknown.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 23: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

The first step towards determining `j , e`j, and ν is to compute the

syndromes of the error pattern.

Definition: For an arbitrary cyclic code C of length n over GF(q)whose generator polynomial g(x) has zeros γ1, γ2, . . . , γr ,γi ∈ GF(qm), the syndromes Si ∈ GF(qm) are defined by

Si = v(γi ) = c(γi )︸ ︷︷ ︸= 0

+e(γi ) =n−1∑j=0

ej γji , i = 1, 2, . . . , r .

To simplify the notation for BCH and RS codes, assume that thegenerator polynomial g(x) has 2t consecutive rootsβ1, β2, . . . , β2t , where ord(β) = n. This corresponds to a cyclict-error correcting code of designed minimum distance 2t + 1 withparameter h = 1. In this case the syndromes are

Si = v(βi ) = e(βi ) = e`1 βi`1+e`2 βi`2+. . .+e`ν βi`ν , 1 ≤ i ≤ 2t .

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 24: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Note: Si are the frequency components (GDFT coefficients) ofthe error vector.

Definition: To obtain a more concise notation, define

Xj = β`j , j = 1, 2, . . . , ν , error locators,

Yj = e`j, j = 1, 2, . . . , ν , error values.

Note: Since β is a primitive n-th root of unity, all error locatorsare distinct.

With this notation, the syndromes become

Si = v(βi ) = Y1 X i1 + Y2 X i

2 + . . . + Yν X iν ,

for i = 1, 2, . . . , 2t and 0 ≤ ν ≤ t. This is a set of 2t (nonlinear)equations in the unknowns

X1, . . . ,Xν , Y1, . . . ,Yν , ν .

If ν ≤ t, then a unique solution exists. However, the original set ofnonlinear equations is too difficult to solve directly.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 25: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Definition: Define the error locator polynomial σ(z) as

σ(z) = (1− X1z)(1− X2z) · · · (1− Xνz)

= σ0 + σ1 z + . . . + σν zν , σ0 = 1 .

Note: The roots of σ(z) are X−1j , 1 ≤ j ≤ ν, i.e., the inverses of

the error locators Xj . Clearly, if σ0, σ1, . . . , σν are known, then thezeros of σ(z) and thus the error locators Xj can be found.

The coefficients σi and the error locators Xj are related by thefollowing equations (the σi are known as elementary symmetricfunctions of the Xj)

σ0 = 1 ,

σ1 = −(X1 + X2 + . . . + Xν) ,

σ2 = X1 X2 + X1 X3 + . . . + Xν−1 Xν ,...

σν = (−1)ν X1 X2 · · · Xν .

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 26: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Theorem: Generalized Newton Identities. For all integers µ, thesyndromes Si satisfy the recurrence

Sµ+ν + σ1 Sµ+ν−1 + . . . + σν Sµ = 0 .

In particular, for µ = 1, 2, . . . , ν ,Sν Sν−1 . . . S1

Sν+1 Sν . . . S2...

......

S2ν−1 S2ν−2 . . . Sν

σ1

σ2...

σν

=

−Sν+1

−Sν+2...−S2ν

.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 27: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

Theorem: The matrix of syndromes

Sm =

Sm Sm−1 . . . S1

Sm+1 Sm . . . S2...

......

S2m−1 S2m−2 . . . Sm

,

is invertible if m = ν ≤ t and it is singular if ν < m ≤ t, where ν isthe actual number of errors in the received codeword v(x).

Thus, one strategy to find the actual number ν of errors in areceived codeword is to compute det(Sm) for m = t, t − 1, t − 2,etc, until the value of det(Sm) becomes zero for the first time.Once ν is known, then S−1

ν can be computed and the result usedto find the coefficients σ1, σ2, . . . , σν of the error locatorpolynomial σ(z). This procedure is known as thePeterson-Gorenstein-Zierler (PGZ) decoder.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 28: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

A more elegant and efficient procedure, known as theBerlekamp-Massey (BM) algorithm uses the generalized Newtonidentities as the basis for synthesizing a linear feedback shiftregister (LFSR) circuit that finds both ν and σ1, σ2, . . . , σν .

Once σ(z) is known (either from the PGZ decoder or the BMalgorithm), the next step is to find the roots of σ(z), which are theinverse error locators X−1

j = β−`j . For polynomials of degree 5 ormore, no general closed-form solution method exists for finding theroots. The most common procedure, known as Chien search, is toset z = β0, β−1, . . . , β−(n−1) and successively try whether any ofthem is a root of σ(z). In practice this is not quite as inefficient asit sounds initially, because BCH and RS codes are often decodedsequentially, symbol by symbol, and thus one root trial operation isperformed for each decoded code symbol.

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes

Page 29: ECEN 5682 Theory and Practice of Error Control Codes - Cyclic …ecee.colorado.edu/~mathys/ecen5682/slides/cyclic99.pdf · 2007-05-04 · Cyclic Codes Cyclic Codes, Basic Definitions

Cyclic CodesCyclic Codes, Basic DefinitionsBCH and RS Codes

After σ(z) and its roots are found, decoding is complete in thecase of binary codewords, because all error values in the errorlocations will be one. For non-binary BCH codes and RS codes,however, the error values Yj = e`j

still need to be determined. Thedefinition of the syndromes can be used to write

S1

S2...

=

X 1

1 X 12 . . . X 1

ν

X 21 X 2

2 . . . X 2ν

......

...X ν

1 X ν2 . . . X ν

ν

Y1

Y2...

.

The matrix on the right-hand side is a Vandermonde matrix andthus can be inverted, if ν and the Xj are known, to obtain the Yj .

Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes