Download Introduction to Error Control Codes

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Vincent's theorem wikipedia , lookup

System of polynomial equations wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

Transcript
李莉,Notes to Error Control Code,2007.05.05
7. Bose-Chaudhuri-Hocquenghem codes(BCH 码)
It is already known that a cyclic code has the property of cyclic. Furthermore
for a cyclic code any codeword polynomial has their generator polynomial as a
factor, so the roots of a code's generator polynomial are also the roots of
codewords.
1st Cyclic code can be considered in terms of g(x)'s roots in an extension field.
2nd BCH code can be constructed using a well-defined set of roots. The BCH
code is a subset of cyclic code. They are a powerful class of multiple-error
correcting codes with well-understood mathematical properties.
rd
3 Binary and nonbinary BCH codes exists, the Reed-Solomon codes are a
popular nonbinary class of BCH codes which find many applications.
7.1 Cyclic codes reviewed (再看循环码)
1) The roots of g(x) are roots of c(x) for cyclic code
A codeword polynomial c(x) of an (n,k) cyclic code can always be written as
c(x)=f(x)g(x)
(7.1)
where for nonsystematic code
f(x)=i(x), the information polynomial.
For systematic code
f(x)=q(x)=quotient of [xn-ki(x)]/g(x).
It is clear in cyclic code the roots of the generator polynomial g(x) are also the
roots of the codeword polynomials.
Example 7.1
Consider (a) The (7,4) cyclic code generated by g(x)=x3+x+1. One of its
codeword is c(x)= x5+ x2+x+1. (b) The (15,11) cyclic code generated by
g(x)=x4+x+1. One of its codeword is c(x)= x6+ x4+ x3+ x2+x+1. Show the roots of
g(x) is also the roots of c(x) respectively.
Solution:
(a) The (7,4) cyclic code, the roots of g(x) are the field elements , 2, 4
belonging to GF(23). Substituting x= into c(x) gives
c()= 5+ 2++1=0.
c(2)=10+ 4+2+1=0.
c(4)=20+ 8+4+1=0.
Where the calculations are carried out in GF(23).
(b) The (15,11) cyclic code, the roots of g(x) are the field elements , 2, 4 , 8
belonging to GF(24). Substituting x= into c(x) gives
c()= 6+ 4+3+ 2++1=0.
c(2)=12+ 8+6+ 4+2+1=0.
李莉,Notes to Error Control Code,2007.05.05
c(4)=24+ 16+12+ 8+4+1=9++12+8+4+1=0.
c(8)= 3+ 2+9+ +8+1=0.
Where the calculations are carried out in GF(24).
So the roots of g(x) are roots of c(x).
2) An arbitrary set of r field elements to construct a g(x)
10 Irreducible g(x) to construct a finite field
A generator polynomial g(x) is used to generate cyclic code. If the g(x) is
irreducible(既约的) over the base field then it can be used to generate a finite
field otherwise it can not be used to generate finite field.
For example the generator polynomial for the (15,7) cyclic code
g(x)= x8+ x7+x6+x4+1= (x4+x+1)( x4+x3+x2+x +1)
is reducible(可约的)。 The 8 roots of g(x) are field elements in GF(24) with
minimal polynomials x4+x+1 or x4+x3+x2+x +1 but g(x) cannot be used to
construct GF(24).
The polynomials x3+x+1 and x4+x+1 serve 2 functions. They can be expressed
as
x3+x+1=(x+)( x+2)( x+4)
x4+x+1=(x+)( x+2)( x+4) ( x+8)
so each generator polynomial being specified by a chosen set of field elements.
x3+x+1 is specified by ,2,4 in field GF(23); and x4+x+1 is specified by ,2,
4 , 8 in field GF(24). The chosen set of field elements forms a conjugate set in
GF(2m), with its minimal polynomial x3+x+1 or x4+x+1 respectively.
20 An arbitrary set of field elements to construct g(x) of a cyclic code
**Given an arbitrary set of r field elements 1,2,…, r the polynomial
g(x)=(x+1)(x+2)…(x+r)
(7.2)
is the minimal polynomial having 1,2,…, r as its roots, but may not a
binary minimal polynomial. For example taking 1=, 2=2 in GF(23) gives
g(x)= (x+)(x+2)=x2+2x+3
which has coefficients in GF(23), not in GF(2), it is not a binary polynomial.
**Replacing each factor (x+i) by mi(x), the minimal polynomial of  i, recall
mi(x) is constructed by  i and all its conjugates  i* ( i 的最小多项式 mi(x)以该
元素及其所有共轭元素为根,在 GF(2m)上是多个单因式的积), gives
g(x)=m1(x)m2(x)… mr(x)
(7.3)
李莉,Notes to Error Control Code,2007.05.05
which is now a binary polynomial with roots 1,2,…, r, but may not a least
degree polynomial with the set of roots 1,2,…, r.
**If any of the elements 1,2,…, r are conjugates of each other, the eqn. 7.3 will
contain multiple factors of the conjugates' minimal polynomial. Taking the
Least Common Multiple (LCM, 最小公倍式) of g(x) will exclude all such
common multiples(公倍式), so define
g(x)=LCM[m1(x),m2(x),… ,mr(x)]
(7.4)
as the binary polynomial of least degree with roots 1,2,…, r.
(提取 eqn 7.3 的最小公倍式,就会去除所有共轭域元素的最小多项式因子。 i.e.
每个因式不会有2 次的幂。)
**In GF(2m) the product of two or more minimal polynomials divides xq-1+1, where
q=2m, and therefore g(x) given by eqn (7.4) is a generator polynomial for a
cyclic code.
With a specific set of roots in GF(2m), BCH code is constructed.
7.2 Definition and construction of binary BCH code
(2 元 BCH 码的定义和构造)
The above gives how to construct a generator polynomial, of a cyclic code,
with an arbitrary set of field elements as its roots. The BCH codes are a subset
of cyclic codes whose generator polynomials have roots carefully specified so
as to give good error-correcting capability.
1) Definition of binary BCH code
** A t-error-correcting cyclic code with generator polynomial g(x) is a binary BCH
code if and only if g(x) is the least-degree polynomial over GF(2) that has
,2, 3,…, 2t
as roots, where  is an element of GF(2m). It has been shown that with this
selection of roots the resulting code is capable of correcting t errors.
** If  is primitive then the codes are known as primitive BCH codes (本原
BCH 码、狭义 BCH 码) and have a blocklength of n=2m -1. Unless stated
otherwise, the BCH codes considered here are primitive with
,2, 3,…, 2t
李莉,Notes to Error Control Code,2007.05.05
as the 2t consecutive roots. If  is not primitive the blocklength of n is the
factor of 2m –1, such BCH is not primitive BCH code.
** Using eqn 7.4 that the generator polynomial g(x) of a t-error-correcting binary
BCH code is given by
g(x)=LCM[m1(x),m2(x),… ,m2t(x)]
(7.5)
or g(x)=LCM[m1(x),m3(x),… ,m2t-1(x)]
(7.6)
where mi(x) is the minimal polynomial of i and  is an element of GF(2m).
Eqn 7.6 is derived from eqn 7.5 as any minimal polynomial of an even power
of a field element is equal to the minimal polynomial of some odd and lower
power of the element.
**The blocklength of a primitive BCH code constructed over GF(2m) is n=2m –1.
BCH codes are cyclic codes and the degree r of generator polynomial of an
(n,k) cyclic code is n-k. Hence the information length k of a BCH code is
k=n-r=2m –1-r.
Example 7.2
Construct (a) a double-error-correcting BCH code over GF(24);
(b) a single-error-correcting BCH code over GF(24);
(c) a triple-error-correcting BCH code with blocklength n=31 over GF(25);
Solution:
(a) t=2, the roots are ,2,3,4 over GF(24). Look up the table 6.9 in this note for
all the conjugates of  and 3 respectively, table 6.5 for additives over
GF(24).
m1(x)=(x+)(x+2)(x+4)(x+8)=x4+x+1, the order of  is 15.
m2(x)= m1(x)
m3(x)=(x+3)(x+6)(x+9)(x+12)=x4+x3+x2+x+1, the order of 3 is 5.
m4(x)= m3(x)
g(x)=LCM[m1(x),m3(x)]=(x4+x+1)(x4+x3+x2+x+1)=x8+x7+x6+x4+1
As  is primitive element of GF(24), the blocklength of the constructed code is
n=24-1=15. The degree of g(x) is r=8, therefore the information length is
k=15-8=7. So the double-error-correcting (15,7) BCH code can be constructed
with g(x)=x8+x7+x6+x4+1.
It can be shown the blocklength of BCH code n=LCM(e1,e3), where e1,e3
are the order of roots  and 3.
(b) t=1, the roots are ,2 over GF(24). Look up the table 6.9 in this note for all the
conjugates of  and 2 respectively, table 6.5 for additives over GF(24).
m1(x)=(x+)(x+2)(x+4)(x+8)=x4+x+1, the order of  is 15.
m2(x)= m1(x)
g(x)=LCM[m1(x), m2(x)]=x4+x+1
李莉,Notes to Error Control Code,2007.05.05
As  is primitive element of GF(24), the blocklength of the constructed code is
n=24-1=15. The degree of g(x) is r=4, therefore the information length is
k=15-4=11. So the single-error-correcting (15,11) BCH code can be
constructed with g(x)=x4+x+1 which is a cyclic Hamming code.
Single-error-correcting primitive BCH code is cyclic Hamming code.
(c) Over GF(25), t=3, the blocklength is n=31=25-1. So there must be a primitive
element of the GF(25) as one root. So let  be a primitive element over GF(25).
For BCH code the set of roots is ,2,3,4,5,6 over GF(25). In GF(25) the
conjugates of  are 2,4,8,16.
m1(x)=(x+)(x+2)(x+4)(x+8)(x+16)=x5+x2+1, the order of  is 31.
m2(x)= m1(x)
m3(x)=x5+x4+x3+x2+x+1,
m4(x)= m3(x)
m5(x)=x5+x4+x2+x+1,
m6(x)= m5(x)
g(x)=LCM[m1(x),m3(x) ,m5(x)]=(x5+x2+1)(x5+x4+x3+x2+x+1)(x5+x4+x2+x+1)
= x15+x11+x10+x9+x8+x7+x5+x3+x2+x+1
the blocklength and the information length are n=25-1=31 and k=31-15=16
respectively. So the triple-error-correcting (31,16) BCH code can be
constructed with g(x).
2) Designed distance of binary BCH code(2 元 BCH 码的设计距离)
A t-error-correcting BCH code has a guaranteed minimum distance of d=2t-1.
d=2t+1 is referred as the designed distance (设计距离)of a code.
The minimum distance dmin of a code may be greater than d, giving the code an
error-correcting capability greater than that designed.
Theorem: For any BCH code dmin d=2t+1.
(定理,BCH 限:BCH 码的最小距离至少是 2t+1。
Property 1: For a BCH code g(x) has 2t consecutive roots.)
3) Coding and decoding of binary BCH code
BCH codes are cyclic and linear, and so once a code's generator polynomial
g(x) is constructed, encoding can be carried out in the usual manner using g(x)
or the generator matrix G constructed from g(x).
It is at the decoding stage the techniques specific to BCH codes are used.
李莉,Notes to Error Control Code,2007.05.05
7.3
Error syndromes in finite fields (有限域中的错误校验子)
At the decoding stage of an error-correcting code, decisions are made on
the basis of error syndromes that depend on the presence of errors. Codewords,
whether represented by vectors in linear codes or polynomials in cyclic codes,
are constructed so as to give a zero contributions to the error syndromes.
Linear code: codeword c, cHT=0, while error syndrome of a word v, s=vHT.
Cyclic code: codeword polynomial c(x),
Rg(x)[c(x)]=0,
And error syndrome of a polynomial v(x), s(x)= Rg(x)[v(x)]
BCH code: error syndromes are field elements in an extension field.
1) Error syndromes of t-error correcting BCH code
10 The roots of codeword polynomials
Given a t-error correcting BCH code with ,2,…,2t as the roots of its
generator polynomial g(x), the roots of g(x) are also the roots of the codeword
polynomials c(x), therefore
c(i)=0
(7.7)
for i=1,2,…,2t. Equation 7.7 provides a means for testing whether a
polynomial v(x) is a codeword of a BCH code.
20
A polynomial v(x) is a codeword if and only if ,2, 3,…,2t are roots of v(x).
The error syndromes of v(x) with error pattern e(x)
Consider a codeword c(x) incurring an error pattern e(x), giving
v(x)=c(x)+e(x)
is the polynomial to be decoded. Evaluating v(x) at any of the field elements i
gives
v(i)=c(i)+e(i)=e(i)
for i=1,2,…,2t, the evaluating results depend solely on the error pattern e(x)
and can be used as error syndromes of v(x). From v(x) we can obtain 2t errors
syndromes and we define the ith error syndrome of v(x) as
Si=v(i)
(7.8)
Table 7.1 Error syndromes
Where i=1,2,…,2t.
in linear, cyclic and BCH codes
The error syndromes S1, S2,…,S2t
Linear Cyclic
BCH
are elements of the field GF(2m)
T
i
codewords
cH =0, Rg(x)[c(x)]=0,
c( )=0
containing . Table 7.1 gives a
Error syndromes s=vHT s(x)=Rg(x)[v(x)] Si=v(i)
comparison of syndrome definitions
in linear, cyclic and BCH codes, along with the condition that codewords
satisfy.
** If v(x) is error free then v(x)=c(x) and Si=v(i)=c(i)=0 for all 2t error syndromes.
If v(x) contains errors, then some of the error syndromes will be nonzero.
李莉,Notes to Error Control Code,2007.05.05
Example 7.3
Consider the codeword c(x)=x9+x6+x5+x4+x+1 belonging to double-error
correcting (15,7) BCH code. Introducing an error e(x)=x7+x4 to c(x), calculating
the error syndromes of c(x) and v(x)=c(x)+e(x).
Solution: The blocklength of the code is 15, so it's over GF(24). Let t=2
(1) v(x)=c(x): S1=v()=9+6+5+4++1=0
S2=v(2)=3+12+10+8+2+1=0
S3=v(3)=12+3+1+12+3+1=0
S4=v(2)=6+9+5++4+1=0; all error syndromes are zero.
(2) v(x)=c(x)+e(x)= 9+7+6+5++1:
S1=v()=9+7+6+5++1=3
S2=v(2)=3+14+12+10+2+1=6
S3=v(3)=12+6+3+1+3+1=4
S4=v(2)=6+13+9+5+4+1=12; all error syndromes are nonzero.
If the number of errors does not exceed the error-correction limit of a BCH
code, then the error pattern e(x) can be determined from S1,S2,…,S2t.
0
3 Simplified calculation of error syndromes over GF(2m)
∵ For field elements x1, x2, …, xn in GF(2m), we have the equation
x12+x22+…+xn2=(x1+x2+…+xn)2
Taking the above example,
S2=v(2)=(2)9+(2)7+(2)6+(2)5+(2)+1
=(9)2+(7)2+(6)2+(5)2+()2+1=(9+7+6+5++1)2
S1=v()=9+7+6+5++1
∴ S2= (S1)2, likewise S4=(S2)2, and in general, we have
S2i=(Si)2,
(7.9)
Therefore we need only to evaluate Si=v(i) for odd values of i and using eqn
7.9 to calculate the error syndromes for even values of i. However, eqn 7.9 only
applies to binary codes, it can not be used to determine the error syndromes
of nonbinary codes.
0
4 Error positions pi and error-location numbers Xi
(错误位置和错误位置数, ref. WXinmei,p269)
** Error positions pi.
An error pattern with  errors can be represented as
e(x)=xp1+xp2+…+ xp
(7.10)
where the error positions p1, p2,…,p give the locations of the errors in the
corresponding error vector e. [ The 1st error position is xn-1 for received (n,k)
BCH word v(x), i.e. if p1=n-1, means the highest bit in v(x) incurring an error.
李莉,Notes to Error Control Code,2007.05.05
设对(n,k)BCH 码,错误位置的计数是从最高位算的。p1=n-1,则表示 v(x)的最
高位出错。p=0 则表示,v(x)的最低位有错,且是第个错]
A codeword c(x) incurring  errors gives
v(x)=c(x)+e(x)=c(x)+(xp1+xp2+…+ xp)
as the word to be decoded. For example, in an 8-bit word 3-bit error pattern
e=(00101001) gives p1=5,p2=3,p3=0, and so
e(x)=x5+x3+x0=x5+x3+1
v(x)=c(x)+(x5+x3+1)
** Error-location numbers Xi.
The decoder for a t-error correcting code evaluates v(x) containing  errors at
x=,2, 3,…,2t to obtain the error syndromes
S1=v()=c()+e()=p1+p2+…+ p
S2=v(2)=c(2)+e(2)=2p1+2p2+…+ 2p
S3=v(3)=c(3)+e(3)=3p1+3p2+…+ 3p
┇
S2t=v(2t)=c(2t)+e(2t)=2tp1+2tp2+…+ 2tp
(7.11)
The right-hand side of eqn 7.11 is usually expressed in terms of error-location
numbers Xi (错误位置数) where
Xi = i
Note that the exponents of the error-location numbers give the error positions.
m
The Xi, i=1,2,…,  are nonzero field elements in GF(2 ) and provide a
p
convenient representation of the unknown error positions p1, p2,…,p.
Eqn 7.11 can be rewritten using error-location numbers Xi as
S1= X1+ X2 +…+ X
S2= X12+X22 +…+X2
S3= X13+X23 +…+X3
┇
S2t= X12t +X22t +…+X2t
(7.12)

unknown
variables
,
,…,
and
2t
known
terms S1, S2 ,
Eqn 7.12 contain
X1 X2
X
S3 ,…, S2t and are referred to as the syndrome equation (校验子方程,WXinmei
书 p282,称其为一般的初等幂和对称函数。). As S2i=(Si)2 and therefore of the 2t
syndrome equations only t equations of 7.12 are independent. This is a set of t
simultaneously equations with  unknowns, if t then a unique solution exists.
i.e. if the number of errors falls within the error-correcting capability of the code,
then the error-location numbers can be determined. The exponents of the
李莉,Notes to Error Control Code,2007.05.05
error-location numbers are then taken as the error positions.
However, eqn 7.12 is nonlinear, can not be solved using standard linear
techniques such as matrix inversion.
Instead indirect methods are used involving the transformation of the
syndrome equations into a form that can be readily solved. The solution of
syndrome equation is the key aspect of the decoding of BCH code. Any method
that can solve the syndrome equations can be referred to as a decoding
technique for the BCH codes. One of the most important method for decoding
BCH codes is Peterson-Gorenstein-Zierler decoder (PGZ 译码器) which is
capable of dealing with multiple errors (PGZ 译码器可以纠多位错误). We
consider first the simpler problems of decoding single-error-correcting and
double-error-correcting BCH codes.
7.4
Decoding SEC and DEC binary BCH codes
(纠 1 位错和纠 2 位错的 BCH 码的解码)
1) Decoding SEC BCH codes
For a single-error-correcting (SEC) BCH code, t=1, assuming that a single
error (i.e. the maximum number of correctable errors) has occurred, so that
=1. For t=1, =1 the syndrome equations 7.12 becomes
S1=X1
S2=X12
Therefore the error-location number X1=S1. S1 is calculated by evaluating
received word v(x) at x=.
Example 7.4
Consider the codeword c(x)= x5+x2+x+1 of (7,4) code incurring single-error
e(x)=x5. Determine the output of the SEC decoder.
Solution:
#1 The receiving word is
v(x)=c(x)+e(x)= x2+x+1
#2 (7,4) code is a SEC over GF(23). The 1st nonzero field element is . The error
syndrome S1=v()=2++1=5, obtained by looking up field elements
Adding Table over GF(23), (Table 6.3. in the text book.)
#3 Therefore the error-location number X1=S1=5 The exponent of X1 indicates
the error position in error pattern is x5.
#4 The error-pattern is e(x)=x5. Hence, the output of SEC decoder is
c~(x)=v(x)+e(x)= x2+x+1+ x5= x5+x2+x+1
just as expected because the maximum error number is within the correcting
limit of (7,4) code.
李莉,Notes to Error Control Code,2007.05.05
NB. ** if the error syndromes are zero, then the decoder assumes the received
word is the correct codeword.
** A syndrome table is not used but a table for addition on GF(23) is used
instead.
** S2 needs not be computed in decoding process.

2) Decoding DEC BCH codes
10 Assuming the occurrence of the maximum number of correctable errors, t ==2.
The syndrome equation reduce to
S1= X1+ X2
2
2
S2= X1 +X2
3
3
S3= X1 +X2
4
4
(7.14)
S4= X1 +X2
S2, S4 are dependent on S1, so that the solutions for X1, X2 can be obtained from
S1=X1+X2
3
3
S3=X1 +X2
The nonlinear equations are solved as follow.
∵ (X1+X2)3=(X1+X2)2(X1+X2)= (X12+X22) (X1+X2)= X13+X23+ X1X2(X1+X2)
3
∴
S1 = S3+ X1X2S1
3
replacing X2 by X2=X1+S1 :
S1 = S3+S1X1(X1+S1)
rearranging and dividing through by S1,
2
3
2
3
X1 +S1X1+ (S1 + S3)/S1=0
(7.15)
The solution of this gives X1, with the other solution giving X2.
If let X1=X2+S1, then
X2 +S1X2+ (S1 + S3)/S1=0
(7.16)
is obtained. The solution are X1, X2 again. Whether eqn 7.15 or eqn 7.16 is
used is arbitrary, so we can write
2
3
x +S1x+(S1 + S3)/S1=0
(7.17)
where X1, X2 are the two roots. The roots of eqn 7.17 over GF(2m) can be
obtained by using a Chien Search(钱搜索), that is by systematically testing to
see if field elements satisfy the equation, or by establishing the two factors.
20 Assuming the occurrence of single error, t=2, =1. Eqn 7.14 becomes
S1=X1,
S2=X12,
S3=X13=S13,
S4=X14,
李莉,Notes to Error Control Code,2007.05.05
Eqn 7.17 reduces to x+S1=0, the root X1=S1.
Example 7.5
Consider the codeword c(x)= x11+x8+x7+x6+x3+x2 of DEC (15,7) BCH code
incurring error pattern e(x)=x10+x2. and e(x)=x4. Determine the output of the
DEC decoder.
Solution: (1) e(x)= x10+x2.
#1 The receiving word is
v(x)=c(x)+e(x)=x11+x10+x8+x7+x6+x3
#2 (15,7) code is a DEC over GF(24), t=2, =2. The odd-number of nonzero field
element is ,3. The error syndrome
S1=v()=11+10+8+7+6+3=4,
S3=v(3)=3+1+9+6+3+9=13,
Evaluating gives
(S13+S3)/S1=(12+13)/4=12,
Substituting this into eqn 7.17, along with S1=4, gives
x2+4x+12=0
#3 Let p(x)=x2+4x+12, then using a Chien search we systematically test the
nonzero field elements of GF(24) to see if they are roots of p(x). Starting with
x=1, p(1)=13, p()=13, p(2)=0, p(3)=3. As is one roots, using the equation
S1=4=X1+X2, the other root is X2=(4+2)=10
The error-location numbers are therefore X1=2 and X2=10, the exponents of
X1 , X2 corresponding to the errors x2 and x10 respectively.
#4 The error-pattern is e(x)=x10+x2. Hence, the output of DEC decoder is
c~(x)=v(x)+e(x)=x11+x8+x7+x6+x3+x2
just as expected because the maximum error number is within the correcting
limit of (15,7) code.
(2) e(x)= x4.
v(x)=x11+x8+x7+x6+x4+x3+x2
S1=v()=4, S3=v(3)=12,over GF(24). Eqn 7.17 reduces to x+S1=0, X=S1=4.
which gives the error pattern e(x)=x4.

Example 7.6
Given that the codewords c1(x) and c2(x), belonging to the DEC (15,7) code
constructed over GF(24) incur 2 and 1 errors so giving
(a) v1(x)=x11+x9+x8+x6+x5+x+1
(b) v2(x)=x12+x11+x10+x9+x7+x5+x respectively, determine c1(x) and c2(x).
Solution: (a)
#1 The error syndromes over GF(24)
S1=v1()=11+9+8+6+5++1=3,
李莉,Notes to Error Control Code,2007.05.05
S3=v1(3)=13,
Substituting this into eqn 7.17, gives
x2+3x+7=0
#2 By inspection (经观察), x2+3x+7=(x+10)(x+12)=0, so the roots of
x2+3x+7=0 are 10, 12.
The error-location numbers are therefore X1=12 and X2=10, the exponents of
X1 , X2 corresponding to the errors x12 and x10 respectively.
#3 The error-pattern is e1(x)=x10+x12. Hence, the output of DEC decoder is
c1(x)=v1(x)+e1(x)=x12+x11+x10+x9+x8+x6+x5+x+1
(b)
#1 The error syndromes over GF(24)
S1=v1()=4,
S3=v1(3)=12, therefore, S13+S3=0
eqn 7.17 reduces to x+4=0
#2 The error-location numbers are therefore X1=4, giving an error-pattern
e2(x)=x4. Hence, the output of DEC decoder is
c2(x)=v2(x)+e2(x)=x12+x11+x10+x9+x7+x5+x4+x

30
Summarization, when decoding a double-error-correcting BCH code
If two errors occur, the syndromes equations become a quadratic eqn 7.17,
whose two roots give two error-location numbers.
If a single-error occurring, the quadratic eqn 7.17 reduces to a linear equation the
error-location number is given by S1, as for a single-error-correcting code.
If three or more errors occurring a decoding error will occur if eqn 7.17 has 1 or 2
roots.
If eqn 7.17 has no solution then an uncorrectable error pattern will have been
detected.
If the error pattern is identical to a codeword, then the syndromes are zero and
again a decoding error occurs.
Example 7.7
Consider the (15,7) double-error-correcting BCH code and codeword c(x)=
x8+x7+x6+x4+1. Determine the outcome of a decoder when c(x) incurs the error
patterns
(a) e1(x)=x7+x2+1
(b) e2(x)=x11+x9+x6+x4.
Solution: (a)
李莉,Notes to Error Control Code,2007.05.05
#1 The polynomial to be decoded is v(x)=c(x)+e(x)=x8+x6+x4+x2.
The error syndromes over GF(24)
S1=v1()=8+6+4+2=11,
S3=v1(3)=1,
Substituting this into eqn 7.17, gives
x2+11x+3=0
#2 By inspection (经观察), none of the elements in GF(24) are solutions of
x2+11x+3=0. No error-location numbers can therefore be obtained and the
decoder concludes that an uncorrectable error pattern has been detected,
i.e. a decoding failure occurs.
(b) v(x)= x11+x9+x8+x7+1.
#1 The error syndromes over GF(24)
S1=v1()=7,
S3=v1(3)=0,
eqn 7.17 gives x2+7x+14=0,
#2 By inspection x2+7x+14=(x+2)(x+12)
The error-location numbers are therefore X1=2, X2=12 . Hence the decoder
concludes that the double error pattern e2(x)=x12+x2 occurred and adding this
to v(x) gives
c(x)=v(x)+e(x)=x12+x11+x9+x8+x7+x2+1.
This is the wrong codeword and so a decoding error has occurred.

7.5
The error-location polynomial
(错误位置多项式,ref. WXinmeiP270)
For a t-error-correcting BCH code, a polynomial of degree t or less can be
defined whose coefficients are functions of the error syndromes. The
occurrence of t errors gives a polynomial of degree  whose  roots are the
reciprocal of the required error-location numbers (个根是错误位置数的倒数).
1) Definition
Reconsider eqn 7.17 and let
1=S1,
2=(S13+S3)/S1,
(7.18)
2
then eqn 7.17 becomes x +1x+2=0
This is the polynomial of highest degree that we need to solve when decoding
李莉,Notes to Error Control Code,2007.05.05
double-error-correcting codes. If 1 error occurs we get 2=0 and x+1=0, which
gives the error-location number X=1=S1.
For a t-error-correcting code we need to consider polynomials of the form
x+1x-1+2x-2+…+-1x+=0
where t and the polynomial coefficients are again functions of the error
syndromes and the  roots give the  error-location numbers.
Let replace x by its reciprocal 1/x and then multiply through by x we get
0+1x+2x2+…+-1x-1+x=0
where 0=1. Now the error-location polynomial (错误位置多项式) is defined
as
(x)=0+1x+2x2+…+-1x-1+x,
(7.19)
where its  roots are the reciprocal of the error-location numbers.(eqn 7.19
的个根分别是个错误位置数的倒数)。 The use of error-location polynomial
defined above is more convenient and conventional. The corresponding
error-location polynomial to a double-error-correcting code is
(x)=0+1x+2x2,
(7.20)
where the coefficients 1,2 are still defined by eqn 7.18.
Example 7.8
Given that v(x)= x9+x8+ x6+x4+1 represents a codeword c(x), of the doubleerror-correcting (15,7) BCH code that has incurred 2 errors determine c(x).
Solution:
#1 The error syndromes over GF(24)
S1=v1()=9+8+6+4+1=1,
S3=v1(3)=4,
Substituting this into eqn 7.18, gives 1=1, 2=.
The error-location polynomial is therefore
(x)=1+1x+2x2=1+x+x2.
#2 Using a Chien search(钱闻天搜索) we find that the roots of (x) are 6,8 over
GF(24). The error-location numbers are therefore,
X1=1/6=9,
X2=1/8=7,
Which gives the error polynomial e(x)=x9+x7 and codeword polynomial
c(x)=v(x)+e(x)=x8+x7+x6+x4+1.
2) Elementary symmetric functions of Xi and Newton's identities

李莉,Notes to Error Control Code,2007.05.05
(Xi 的初等幂和对称函数 ref. WXinmei,P270、牛顿恒等式 ref. WXinmei,P282)
If the roots of the error-location polynomial are the field elements 1, 2,…, 
then the error-location numbers are
X1=1/1,
X2=1/2,
┇
X=1/,
And the error-location polynomial can be expressed as

(x)=(xX1+1)(xX2+1)…(xX+1)=  (xXi+1),
i 1
(7.21)
Determining the error-location polynomial is the most difficult part of
decoding a BCH code(求错误位置多项式是 BCH 码解码的最难的部分). The
coefficients 1, 2, 3,…,  of the error-location polynomial (x), have to be
determined from the known error syndromes Si. To achieve this eqn 7.21 is
expanded and its coefficients are compared with those of eqn 7.19,
0=1,
1=X1+X2+…+X-1+X,
2=X1X2+X2X3+X3X4+…+X-1X,
┇
=X1X2X3X4…X-1X,
(7.22)
The coefficients of (x) as given above are referred to as elementary
symmetric function of the error-location numbers.(eqn 7.22 表示的错误位
置多项式的系数称为错误位置数 Xi 的初等幂和对称函数。)
Now there are two sets of equations involving the error-location numbers of a
t-error-correcting code(纠 t 位错的 BCH 码):
10 equation 7.12 relating the error-location numbers to the error syndromes.
20 equation 7.22 relating the error-location numbers to the error-location
polynomial coefficients.
From the two sets of equations we can eliminate the error-location numbers to
obtain expressions involving only error syndromes and the coefficients of the
error-location polynomial. The expressions for the first  error syndromes
S1=1,
S2=1S1+22,
S3=1S2+2S1+33,
李莉,Notes to Error Control Code,2007.05.05
┇
S=1S-1+2S-2+…+-1S1+,
(7.23)
Note that the last term ii in each expression in the equation 7.23 is 0 for even
values of i; i for odd values of i over field GF(2) with modulo-2 operations. i.e.
ii =0, for even values of i
ii =i, for odd values of i .
The remaining  error syndromes are given by
S+1=1S +2S-1+…+-1S2+S1,
S+2=1S+1+2S +…+-1S3+S2,
S+3=1S+2+2S+1+…+-1S4+S3,
┇
S2=1S2-1+2S2-2+…+-1S+1+S,
(7.24)
Equations 7.23 and 7.24 are a set of linear equations, referred to as Newton's
identities (牛顿恒等式) from which the coefficients of (x) can be determined.
3) Matrix forms of Newton's identities
The two groups of Newton's identities can be expressed in matrix forms
S1
S2
S3 =
┇
S
1
0 0 …
S1 2 0 …
S2 S1 3 …
┇
S-1 S-2 S-3 …
S+1
S
S-1 S-2 …
S+2
S+1 S S-1 …
S+3 = S+2 S+1 S …
┇
┇
S2
S2-1 S2-2 S2-3 …
0 0
0 0
0 0
1
2
3
(7.25)
┇
S1  
S2 S1
S3 S2
S4 S3
1
2
3
┇
S+1 S
(7.26)

In section 7.6 Peterson-Gorenstein-Zierler decoder uses eqn 7.26 as the basis
for multiple-error-correcting BCH codes. The Berlekamp's algorithm, a fast
algorithm uses eqns 7.23 and 7.24 for BCH code decoding.
4) The error-location polynomial of a binary BCH code
For a binary code eqns 7.23~7.26 can be simplified by taking into account the
relationship S2i=Si2. Consider eqn 7.23, using S2=S12 we find the second
equations reduces to the 1st equation S1=1 and the 2nd equation can be
excluded. Likewise all the even values of i can be excluded from eqns
7.23~7.26. Furthermore combine eqns 7.25, 7.26 to get
李莉,Notes to Error Control Code,2007.05.05
S1
1 0
0 …
S3
S2 S1 1
…
S5
= S4 S3 S2 …
┇
┇
S2-1
S2-2 S2-3 S2-4 …
0 0
0 0
0 0
1
2
3
┇
S S-1
(7.27)

**For a double-error-correcting code the maximum number of correctable errors is
2, setting =2 in eqn 7.27 gives
S1
S3
1 0
1
= S2 S1
2
S1=1
S3= S11+S12
1=S1
2=(S13+S3)/S1,
**For a triple-error-correcting code the maximum number of correctable errors is 3,
setting =3 in eqn 7.27 gives
S1
S3
S5
1 0
= S2 S1
S4 S3
0
1
S2
1
2
3
S1=1
S3= S21+S12+3
S5= S41+S32+S23
(7.28)
1=S1
Multiply the middle equation by S2 and adding it to the 3rd equation eliminates
1,3,so allowing 2 to be determined
S2S3+S5=(S1S2+S3)2
2= (S2S3+S5)/(S13+S3),
3= S3+S21+S12,
since 1 and 2 are already known.
Therefore for a triple-error-correcting code the coefficients of the error-location
polynomial (x)=1+1x+2x2+3x3 are determined as
1=S1
2=(S2S3+S5)/(S13+S3),
3=(S13+S3)+ S1(S2S3+S5)/(S13+S3),
Example 7.9
Given a triple-error-correcting code error syndromes S1=3, S3=8 and S5=1
over GF(24), determine the error-location polynomial (x).
Solution:
Using eqn 7.29 gives
李莉,Notes to Error Control Code,2007.05.05
1=S1=3,
2=(S2S3+S5)/(S13+S3)= (68+1)/(9+8)=6,
3=(S13+S3)+S1(S2S3+S5)/(S13+S3)=(9+8)+(98+31)/(9+8) =8,
the error-location polynomial is therefore
(x)=1+1x+2x2+3x3=1+3x+6x2+8x3.

**The method described here can be used to any t-error-correcting code. However
beyond t=4 or 5, the Newton's identities become too complicated so the
approach becomes impractical. Instead PGZ decoder forms a basis for
multiple-error correction.
7.6
The Peterson-Gorenstein-Zierler decoder
(PGZ 解码, ref. WXinmeiP268 )
The PGZ decoder is a general purpose decoder that can be used for decoding
any t-error-correcting BCH code. It is based on the error-location polynomial.
The decoder brings together into a single algorithm the various ideas considered
in the previous sections.
1) The determination of coefficients of error-location polynomial
The error syndromes S+1,S+2,…, S2 are related to the coefficients of the
error-location polynomial by eqn 7.26. By convention the order of the columns of
the matrix in eqn 7.26 are reversed, along with the rows of the column vector
containing the polynomial coefficients. This gives
S+1
S1 S2 S3 … S-1
S+2
S2 S3 S4 … S
S+3 = S3 S4 S5 … S+1
┇
┇
S2
S S+1 S+2 … S2-2
S
S+1
S+2

-1
-2
┇
S2-1
(7.30)
1
Which can be expressed as
S=M
The S,M,  are shown as eqns
7.31~7.33.
M=
Assuming that M is nonsingular, so that
its inverse M-1 exists, and multiplying
S=M through by M-1 gives
S+1
S+2
M-1S=(M-1M)= 
S=
S+3
= M-1S
(7.34)
┇
To evaluate eqn 7.34 M has to be
S2
nonsingular and we need to know the
S1 S2 S3 … S-1
S2 S3 S4 … S
S3 S4 S5 … S+1
┇
S S+1 S+2 … S2-2
(7.32)
=
S
S+1
S+2
(7.31)
S2-1

-1
-2
┇
1
(7.33)
李莉,Notes to Error Control Code,2007.05.05
number of errors  that have occurred. It can be shown that the matrix
is nonsingular if i=, but singular if i>.
S1 S2 S3 … Si-1 Si
For example consider a code that can
S2 S3 S4 … Si Si+1
M=
S3 S4 S5 … Si+1 Si+2
correct 5 errors but only 3 errors actually
┇
occur, so t=5 and =3.
Si Si+1 Si+2 … S2i-2 S2i-1
Taking i=5, the 5 by 5 matrix M of error
syndromes will give det(M)=0, M is singular. Likewise, the 4 by 4 matrix of error
syndromes is also singular when i=4. When i equals the number of errors that
have occurred, i.e. i==3, the 3 by 3 matrix is nonsingular. M-1 can be
determined. And the polynomial coefficients can be found using = M-1S.
2) The decoding process of BCH
PGZ algorithm decoder:
st
1 Calculate the error syndromes S1, S2,…, S2t from v(x).
2nd assume the maximum number of correctable errors have occurred, i=t, and
3rd Constructs M
4th Find the determinant of M. check if det(M)=0. if det(M)=0, reduce i by 1 and go
back to step 3, otherwise continue to step 5.
5th Determine M-1 and construct S.
6th Find the polynomial coefficients using = M-1S and construct (x) from  .
7th Determine the roots of (x) and take their reciprocals. The error-location
numbers are given by the reciprocal roots.
Example 7.10
A codeword c(x), of the (15,5) triple-error-correcting BCH code, incurring errors
so as to give v(x)=x8+x5+x2+x+1. Find the number of errors that c(x) has
incurred, the error pattern and c(x).
Solution:
Step 1 In GF(24) the error syndromes are
S1=8+5+2++1=2, S2=S12=4
S3=9+15+6+3+1=11, S4=S22=8
S5=40+25+10+5+1=0, S6=S32=7
S1 S2 S3
2 4 11
Step 2 Assume the maximum number of errors,
M= S2 S3 S4 = 4 11 8
S3 S4 S5
11 8 0
i=3.
Step 3 The matrix M is .
Step 4 The determinant of M is .
2 4 11
Det(M)=
The matrix M is therefore singular, so i is
4 11 8 =0
11 8 0
reduced by 1 to give i=2 and step 3, 4 are
repeated.
李莉,Notes to Error Control Code,2007.05.05
Step 3-repeated The matrix M now is
2 4
S1 S2
M= S2 S3 = 4 11
Step 4-repeated The revised value of det(M) is .
Now matrix M is nonsingular, so we can
2 4
det(M)= 4 11 =11+8=3
move to step 5 and find M-1.
 
Step 5 Using M-1=adj(M)/det(M) we get
11 4
adj(M)= 4 2
So M-1=(1/3)adj(M)
 
11
S
3
S=
= 8
8 
S4

M-1=
 14
Step 6 Using = M-1S gives
2
1
11
14
8
=  14 8 = 2

  
So 2=14, 1=2 and the error-location polynomial is therefore
(x)=1+1x+2x2=1+2x+14x2.
Step 7 Using a chien search(钱搜索) we find that the roots of (x) are 5, 11,
the reciprocals of which give the error location numbers 10 and 4
respectively.
The error pattern is e(x)=x10 +x4 ,
and so the required codeword is
10
8
5
4
2
c(x)=v(x)+e(x)= x +x +x +x +x +x+1.

The PGZ decoder forms the basis of decoding algorithms for t-error-correcting
BCH codes. It is relatively simple but the matrix inversion does present a
problem to the decoder. For a large error-correction limit t, evaluating the
resulting determinants can be computationally slow and inefficient.
Furthermore, as we shall see later, a second matrix inversion is required when
dealing with non-binary codes, and so aggravating the problem. To develop
fast decoding algorithms we need to avoid the matrix inversions.
7.7 Reed-Solomon codes (RS 码,ref. WXinmeiP259)
1) Information symbols(信息符号)
It is well known that information can be represented by symbols, such as
Chinese characters, English alphabets, numbers, etc. The number of a symbol
set can be different with other sets. For example the numbers of Chinese
characters and mathematical numbers can be thought of infinite however there
are only 26 English alphabets.
2) Bits of information (信息位)
李莉,Notes to Error Control Code,2007.05.05
In modern technology, information is usually digitalized in order to processing,
transmission and storage by machines (computers, equipments) easily,
effectively and automatically. We use finite information symbols and their
combination to represents approximately all kind of information.
The simplest digitalized information symbol is binary(2 元的), i.e. there are only
2 symbols. Furthermore we denote the 2 symbols as 0 and 1. 0 or 1 can also be
referred to as the values(值) of the 2 information symbols so that we can take
the advantage of mathematic theory related and the electronic circuit can
represents the two values with its two distinct states (2 种电路状态).Therefore,
Information processing, transmission, and storage are usually thought of in
terms of a binary representation(用二进制表示).
In such a case, every binary symbol is referred to as a bit(位), and the value of
a bit is 0 or 1. A convenient number of bits combined into an information word(信
息字). In order to representing the information effectively and transmission or
storing reliably, information words are usually coded into codeword(码字).
Bits are manipulated either individually or in blocks of convenient length, for
example as 8-bit words.
3) Binary and non-binary codes (2 元码,非 2 元/多元码)
10 Binary codes: there are only two information symbols in a word. The possible
value for each bit in a codeword is 0 or 1.
0
2 Nonbinary codes: there are more than two information symbols in a word. The
possible value for each symbol in a codeword is also more than two, such
as 0,1, , 2….
0
3 The inherent relationship between Binary and nonbinary codes:
A single non-binary symbol can be thought of as an 8-bit binary word with 256
(=28) different values, irrespective of its underlying structure (i.e. the fact that it is
really a collection of 8 bits and not a single symbol).
In general, a single non-binary symbol can be viewed as any sequence of r
bits (r 位的二进制序列) that has one of 2r values. Furthermore symbols need
not necessarily be restricted to 2r values but can be defined for any positive
李莉,Notes to Error Control Code,2007.05.05
integer. (每个非 2 元符号(r-bit 序列),的值不仅局限于 1~2r,而是可定义为任意
的 2r 个整数值。)
40 Non-binary codes are concerned with the detection and correction of
errors in symbols(非二进制 BCH 码是与符号检错和纠错有关的。).
The construction of non-binary codes, along with encoding and decoding
techniques, follows directly from that of binary codes.
The main difference arises in the need to determine the magnitude of errors
and not just the error locations (因非二进制码的符号取值为多个中的某一个,
故纠错时除了确定错误位置外,还要确定其数值才能纠正). In binary codes error
magnitudes are 1 and it is only necessary to determine the position of error.
Once located error the correction is achieved by simply inverting the erroneous
bits. With a non-binary code we first locate the position of errors and then
determine the magnitude of the errors.
Reed-Solomon codes are nonbinary BCH codes.
4) Comparison of binary and non-binary codes (2 元和多元码的比较)
Binary (n,k) code
code symbol
field; base field
codeword
component
linear
GF(2),
num. of infor. words
Nonbinary (n,k) code
GF(q), q=prime num. or any power of a
2k
(cn-1,cn-2,…,c2,c1,c0)
ciGF(2)
i,j, k, with ck=ci+cj
prime num.
num. of infor. words qk
(cn-1,cn-2,…,c2,c1,c0)
ciGF(q)
Exist at least 1 set of k codewords from
which all other codewords can be got by
their linear combinations
cyclic, g(x)
root-field of g(x)
g(x) roots to
Degree n-k, giGF(2),
Degree n-k, giGF(q), g(x) divides xn-1.
gn-k=g0=1, g(x) divides xn+1.
gn-k =1
Roots=arbitrary
Roots=arbitrary elements GF(qm),
elementsGF(2m), 2m=n+1
qm=n+1
2t consecutive elements in
, 2, 3,…, 2t. 2t consecutive elements
BCH, a subset of GF(2m) for t-error-correcting.
in GF(qm) for t-error-correcting.
cyclic codes
minimal
roots of mi are i and all its
roots of mi are i and all its conjugates in
polynomial mi
conjugates in GF(2m)
GF(qm)
李莉,Notes to Error Control Code,2007.05.05
construction of
g(x)=LCM[m1,m2, …,m2t-1,m2t,], g(x)=LCM[m1, m2, …,m2t-1, m2t,],
g(x)
mi over GF(2) of i
mi over GF(q) of i
RS code, a class
GF(q)=GF(qm), m=1 obviously.
of nonbinary
usually some power of 2. blocklength
BCH
n=q-1.码元的符号域与 g(x)的根域一致.
q2, is
5) Reed-Solomon codes
10 Definition
(n,k) Reed-Solomon codes are a special kind of nonbinary codes. Both the
symbols and the generator polynomial roots lie in the field GF(q) and
define a Reed-Solomon code with blocklength n=q-1.
Consider q=2m, the Reed-Solomon codes symbols and g(x) roots lie in GF(2m).
Then the RS code blocklength n=q-1=2m -1.
20 A t-error-correcting Reed-Solomon code
It is a cyclic code whose generator polynomial is the least-degree polynomial
that has , 2, 3,…, 2t as roots where GF(2m). The minimal polynomial over
GF(2m) of an element  in GF(2m) is the factor
m=x+
The generator polynomial of a RS code is therefore
g(x)=(x+)(x+2)(x+3)…(x+2t)
(7.35)
Note there is no need to take the least common multiple of the factors, as all
the factors are distinct. The coefficients of g(x) are no longer binary(g(x)的系
数不再是 2 元的了).
补充强调:RS 码的纠错检错是对信息“符号”而言的。
A t-error-correcting RS code of length n over GF(2m) can be implemented as
an (m(2m -1),m(2m –1-2t)) linear code over GF(2) which is capable of
correcting any burst-error pattern that does not affect more than t of the
symbols in the original GF(2m) version of the codeword.
李莉,Notes to Error Control Code,2007.05.05
可纠 t 个符号错误的(n,k)RS 码,因其符号域和 g(x)的根域均在
GF(2m)中,故可以用 m-bit 的二进制序列表示其任意单符号,
实际也是这样应用的。故可称其为二进制的 RS 码GF(q)上 q
=2m 进制的 BCH 码。有别于 GF(2)上的二进制 BCH 码。它
有如下的参数:
码长:n=2m-1 符号,或 nm=(2m-1)m bit (比特)
信息段:k
符号,或 km bits
监督段:n-k=2t 符号,或 m(n-k)=2mt bits
最小码距:d=2t+1 符号,或 md=m(2t+1) bits
Table 7.1.1
The field GF(23)
represented as
powers of ,
where 3=+1.
i i
0 001
1 010
2 100
3 011
4 110
5 111
6 101
故(n,k) RS 码亦可看成(nm,km)的二进制码。RS 码具有同时纠随机错误和突发错
误的能力,且纠突发错误的能力更强。
Table 7.1.1 gives an example of the GF(23) represented as powers of ,
where 3=+1.
For example consider a (7,3) RS code over GF(8). a codeword c=(3   1 0
3 1) can be converted to a binary vector c=(011 010 010 001 000 011 001).
On the other hand an error burst of length 5 incurred over a binary symmetric
channel E=(000 000 011 101 000 000 000) can be mapped into a
7-dimensional vector from GF(8), i.e. E=(0 0 3 6 0 0 0).
Ordinarily, it is difficult to correct 4 errors in a (21,9) linear code, but the (7,3)
RS code can correct (7-3)/2=2 error symbols, i.e. more patterns of burst
errors.
Example 7.11
Construct a double-error-correcting Reed-Solomon code with blocklength 15.
Solution:
The code is constructed over GF(24) as this gives a code with blocklength
n=24-1=15. Substituting t=2, and = in equation 7.35 gives
g(x)=(x+)(x+2)(x+3)(x+4)
= x4+13x3+6x2+3x+10.
Where  is a primitive element in GF(24), (ref. P164. Table 6.4). As the degree
of g(x) is r=4, using n-k=r gives the information length k is k=n-r=15-4=11. This
is therefore the generator polynomial of a double-error-correcting (15,11) RS
code.
该码的码距:d=2t+1=2*2+1=5 symbols= 5*4=20 bits
李莉,Notes to Error Control Code,2007.05.05
监督段:n-k=2*t=2*2=4 symbols=4*4 bits =16 bits
信息段:k=n-4=15-4=11 symbols=11*4 bits=44 bits
码长:n=15*4 bits=60 bits
(15,11) RS 可看成(60,44)二进制码。Further more (15,11) RS code can correct

up to 2 error symbols, or 8 bits burst errors.
30 Encoding of Reed-Solomon codes
** For encoding purposes the Reed-Solomon codes can be treated as cyclic
codes with generator polynomial g(x). Or the codes can be treated as linear
codes with generator matrix G constructed from g(x).
** Recall that to construct systematic codewords we require the remainder of
xn-ki(x) divide by g(x). When dividing two non-binary polynomials, care has to be
taken to ensure that at each step the coefficients of the highest power of x are
the same, i.e. one of the elements in GF(2m).
** RS 码的编码同样可用带反馈的移存器实现。所不同的是所有数据通道都是 m bit
宽。i.e. 移存器为 m 级并联工作。而每个反馈连接必须乘以 g(x)的相应系数i。
与i 的相乘可用 2m×m ROM 查表法实现。
Example 7.12
Construct the (7,5) single-error-correcting Reed-Solomon code and determine
the systematic codeword corresponding to i=(1 0  5 2) where  is an
element of GF(23)
Solution:
The generator polynomial is
First 5ticks closed
g(x)=(x+)(x+2)=x2+4x+3.
As the degree of g(x) is r=2, which is
consistent with the code's (n,k)
parameters, n-k=7-5=2. The
information polynomial corresponding
to i is
i(x)=x4+x2+5x+2
And multiply this by xn-k=x2 gives
Last 2ticks open
First 5ticks down
3
1 Last 2ticks up
4
output
Input
A systematic shift-register encoder for
(7,5) RS over GF(23),
g(x)=x2+4x+3
x2i(x)=x6+x4+5x3+2x2
dividing x2i(x) by g(x) gives the quotient and remainder
q(x)=x4+4x3+3x2+5x+6.
r(x)=x+2.
Respectively. The codeword polynomial is therefore
c(x)=x2i(x)+r(x)=x6+x4+5x3+2x2+x+2.
李莉,Notes to Error Control Code,2007.05.05
Which gives the codeword c=(1 0  5 2 1 2).

40
Decoding of Reed-Solomon codes
** The generator polynomial g(x) of a t-error-correcting RS code has 2t linear
factors, one for each root , 2, 3,…, 2t and the degree of g(x) is n-k=2t. Recall
that a t-error-correcting code requires a minimum distance of
dmin=2t+1=d0 (d0 Designed distance for t-error-correcting code. For any
BCH dmin d0. The error-control capability is usually greater
than designed.)
and so a t-error-correcting RS code has
dmin=n-k+1 (Singleton bound of linear code)
and therefore the Reed-Solomon codes are maximum-distance codes. Note
also that the designed distance, d0, and minimum distance, dmin of a RS code
are the same.
** The number of codewords in a non-binary code can be surprisingly large.
An (n,k) binary code has 2k codewords as there are 2k distinct information
words. In a t-error-correcting (n,n-2t) RS code over GF(q), each information
symbol has q distinct values and there are qn-2t codewords.
For example (7,4) binary code has 24=16 codewords, while (7,5) RS code has
(7+1)5=32768 codewords.
** Decoding RS codes algorithm should avoid the use of look-up tables for
such large numbers of codewords.
The decoding RS codes is achieved by 1st determining the error positions and
then the error magnitudes. The methods used for locating errors in binary
codes can also be used in RS codes. In a binary code an error pattern of 
errors can be represented by the error polynomial
e(x)=xp1+xp2+…+xp.
where p1,p2,…,p are the error positions. Taking error magnitudes into
account (考虑到错误值), the error polynomial becomes
e(x)=yp1xp1+yp2xp2+…+ y pxp.
(7.38)
where ypi is the error magnitude at the position pi, element in GF(2m).
The decoder input is v(x)=c(x)+e(x) where c(x) is the codeword polynomial
incurring the errors. For a t-error correcting code syndromes calculated by the
decoder are
Si=v(i)=c(i)+e(i)=e(i).
i.e.
S1= yp1p1+yp2p2+…+ y pp.
李莉,Notes to Error Control Code,2007.05.05
S2= yp12p1+yp22p2+…+ y p2p.
S3= yp13p1+yp23p2+…+ y p3p.
┇
S2t= yp12tp1+yp22tp2+…+ y p2tp.
(7.39)
Let Xi=pi , i=1,2,…,, are error-location number (错误位置数) as defined for
binary codes. Yi=ypi known as the error magnitude (错误值) of the ith
error-location number. Then the more convenient form of eqn 7.39 are
S1=Y1X1+Y2X2+…+YX.
S2=Y1X12+Y2X22+…+YX2.
S3=Y1X13+Y2X23+…+YX3.
┇
S2t=Y1X12t+Y2X22t +…+YX2t.
(7.40)
2
We haven already known that for binary code S2=S1 ; but for nonbinary code it
is not true. For nonbinary code, using the property of GF(2m), (ref. P177),
gives
S12=(Y1X1+Y2X2+…+YX)2=Y12X12+Y22X22+…+Y2X2S2.
as the pi, ypi , i=1,2,…,, are elements of GF(2m). Likewise for nonbinary code
S2iSi2.
And so the 2t error syndromes need to be individually evaluated.
Equations 7.40 consist of 2t equations with  unknown error-location numbers,
 unknown error magnitudes along with 2t known error syndromes. If t, then
a unique solution exists. The unknown error-location numbers and error
magnitudes can be determined from eqn 7.40.
** SEC Reed-Solomon code decoding (纠一位错的 RS 码译码)
t=1, =1(the maximum number of correctable errors), eqn 7.40 becomes as
S1=Y1X1.
S2=Y1X12.
(7.41)
Dividing S2 by S1 , gives X1=S2/S1.
Substituting X1 into the 1st eqn 7.41, gives Y1=S1/X1=S12/S2.
Therefore the error-location number X1 and the error magnitude Y1 of
single-error-correcting RS code are determined,
X1=S2/S1.
Y1=S12/S2.
(7.42)
2
Note if let S2=S1 , then eqns 7.42 gives X1=S2/S1=S1.Y1=1. which are the
correct error-location number and error magnitude for a SEC binary code.
李莉,Notes to Error Control Code,2007.05.05
Example 7.13
Construct the (7,5) single-error-correcting Reed-Solomon code. Given that
v=(0 1 5 2 1 6 3), where  is an element of GF(23), corresponds to a
codeword c with a single error. Determine the position and magnitude of the
error and the codeword c.
Solution:
The received word polynomial v(x)=x5+5x4+2x3+x2+6x +3
The error syndromes are S1=v()=, S2=v(2)=3.
Using eqn 7.42, X1=S2/S1=2. Y1= S12/S2=6, given the error-location x2 and
error magnitude 6. so the codeword polynomial is
c(x)=v(x)+6x2=x5+5x4+2x3+2x2+6x +3
giving c=(0 1 5 2 2 6 3). The bold denotes the corrected symbol.
** t-error-correcting RS code decoding
For t-error-correcting RS code the number of errors  and the error-location
numbers Xi, i=1,2,…, , can be determined by any technique that used for
binary BCH code.
Once the error-location numbers have been found. The  error magnitudes can
be obtained by solving the 1st  linear equations of Yi, i=1,2,…, , using
standard matrix inversion method. Define the column vectors S, Y and matrix X
as (eqns 7.43~7.45)
S1
Y1
S2
Y2
Then eqns 7.40 can be written as
S= S3
Y= Y3
(7.43)
(7.44)
S=XY
Note: the vector S defined here
differs from the vector defined for
use in PGZ decoder (ref. p203,
┇
S
X1 X2
┇
Y
X3 … X-1 X
where S consists of the last 
X12 X22 X32 … X-12 X2
(7.45)
3
3
3
3
3
error syndromes). X cannot be X= X1 X2 X3 … X-1 X
┇
singular because  nonzero and
X1 X2 X3 … X-1 X
distinct errors are already known
to exist. X, S are known so
Y=X-1S
(7.46)
The error magnitudes are linearly related to the error syndromes and the
known error-location numbers. However we face as before the computationally
inefficient process of matrix inversion. Later we shall see how this matrix
inversion can be circumvented. Decoding Reed-Solomon codes can be
summarized as follows:
1. Find the number of errors  and error-location numbers Xi=pi , i=1,2,…,,
李莉,Notes to Error Control Code,2007.05.05
2.
3.
by using any technique suitable to binary BCH codes.
From the error-location numbers construct the matrix X and determine its
inverse X-1.
The error magnitudes Yi=ypi , i=1,2,…,, are then given by Y=X-1S, where
S is the column vector constructed from the error syndromes Si,
i=1,2,…,,.
Example 7.14
A codeword c(x) belonging to the triple-error-correcting (15,9) Reed-Solomon
code incurs errors so giving v(x)=3x12+x8+10x7+2x5+8x4+14x3+6.
Determine the position and magnitude of the error and the codeword c.
Solution:
Over GF(24) the error syndromes are
S1=v()=312+8+107+25+84+143+6=6
S2=v(2)=27+16+24+12+16+20+6=0
S3=v(3)= 39+24+31+17+20+23+6=14
S4=v(4)= 51+32+38+22+24+26+6=11
S5=v(5)= 63+40+45+27+28+29+6=14
S6=v(6)= 75+48+52+32+32+32+6=9
The decoder first assumes that the maximum
S1 S2 S3
number of correctable errors, 3, have occurred
S2 S3 S4
M=
and constructs the matrix M
S3 S4
Evaluating the
determinate of M
gives
S5
6 0 14
= 0 14 11
14 11 14
6 0 14
14 11
11
14
Det(M)= 0 14 11 =6   +0 0 
14 0 
+
11
14
14
14
14
 
 
 11
14 11 14
=6(13+7)+14(1414)= 11+12=1
Hence det(M)0, and so the decoder assumes that 3 errors have occurred
(which we known is correct). The inverse of M is
5 10 13
Adj(M)
-1
M = Det(M) = 10 7 2
13 2 5
The coefficients of the error-location polynomial
are given by
5 10 13 11
3
16+24+22
4
10
7
2
21
21
11
14
2 =   
 =  + + = 11
And so 1=1, 2=11, and
13
2
5
  
24+16+14
1
9
1
3=4 giving the error-location
polynomial
(x)=1+1x+2x2+3x3=1+x+11x2+4x3
Searching GF(24) for the roots of (x) shows that x=3, 9, and 14 are roots,
李莉,Notes to Error Control Code,2007.05.05
and taking the reciprocal of the roots gives the error-location numbers X1=12,
X2=6, X3= respectively. To find the error magnitudes we construct matrix X.
The determinant of X is det(X)=2 and its inverse is X-1.
X1 X2 X3
12 6 
X= X12 X22 X32 = 9 12 2
X13 X23 X33
6 3 3
8 12 
X = 7 7 9
8 9 5
-1
Using Y=X-1S the error magnitudes Y1, Y2, and Y3 are given by
8 12 
Y1
Y2 = 7 7 9
8 9 5
Y3
14+15
6
3
13
23
0 =  + = 3
14+19
14
9
and so Y1=3, Y2=3, Y3=9. The error-location numbers X1=12, X2=6, and
X3= correspond to errors in positions x12, x6, and x respectively, the error
pattern is therefore
e(x)= 3x12+3x6+9x
and adding this to v(x) gives the codeword polynomial
c(x)=x8+10x7+3x6+2x5+8x4+14x3+9x +6.

7.8 The Berlekamp-Massey algorithm
(伯利坎普-梅西迭代算法,ref. WXinmeiP277)
Under the definition of an error-location polynomial (x) whose reciprocal roots
are the error-location numbers, the PGZ decoder is prime important in
illustrating the principles of decoding BCH codes. It is of limited practical use
however.
The PGZ first find the coefficients of (x), by constructing a  by  matrix M
using known 2 error syndrome Si, i=1,2,…,2, find the inversion of matrix M,
solve a linear matrix equation. Then determine the roots of (x) and the
error-location numbers Xi, i=1,2,…, are the reciprocals of the roots.
For non-binary BCH code, such as RS codes, another  by  matrix X using
solved error-location numbers Xi, and their powers, i=1,2,…,, should be
constructed, take the inversion of matrix X, together with the first  error
syndromes Si, the error magnitudes Yi, i=1,2,…, can be solved by standard
linear matrix inversion.
1) Introduction
The Berlekamp algorithm is a fast efficient algorithm for decoding BCH. It is
complex to proof the algorithm so we omit it. (Berlekamp 算法给出 BCH 译码的
迭代算法,用于求错误位置多项式的系数。Massey 指出迭代译码算法与序列的
李莉,Notes to Error Control Code,2007.05.05
最短线性移位寄存器综合之间的简化关系。故统称 BM 算法。这里主要介绍迭代
算法。)
The Berlekamp algorithm uses an iterative technique to find an error-location
polynomial (x) whose coefficients satisfy the 2 Newton's identities as given
in eqns 7.23, 7.24. The algorithm starts with a carefully selected set of initial
conditions which defines the first 2 iterations, denoted as (-1)(x) and (0)(x). For
a t-error-correcting code a maximum of 2t iterations are required to get (2t)(x),
the final least degree polynomial whose coefficients satisfy all the 2 Newton's
identities. Furthermore if the degree of (2t)(x) is greater than t, then an
uncorrectable number of errors has occurred. (如果迭代出的最小次数多项式的
次数大于码可纠错误数 t, 则表明发生了不可纠的错误数。)
2) Estimation of (i+1)th error syndrome, ith discrepancy and value nk
[(i+1)th 错误校验子估计 S~i+1 , ith 差值 di, 和 ni 值]
Let (i)(x) be the polynomial of least degree whose coefficients satisfy the first i
Newton's identities, we can express (i)(x) as
(i)(x)=1+1(i)x+2(i)x2+…+ri(i)xri.
Where ri is the degree of (i)(x), there exist coefficients 1(i), 2(i),…ri(i). Compute
ri
S~i+1=1(i)Si+2(i)Si-1+…+ri(i)Si+1-ri.=  k(i)Si+1-k.
k 1
(7.47)
Which can be thought of as the (i+1)th syndrome as predicted or estimated by (i)(x).
The ith discrepancy di is obtained by adding S~i+1 to the known error syndrome Si+1.
di =Si+1+S~i+1.
(7.48), 第 i 个差值由第 i+1 个错误校验子及其估值求出。
Both Si+1 and S~i+1 are elements in the same field GF(2m) and di is a field
element that gives a measure of the difference between the two error
syndromes. The value ni is defined as
ni =i-ri.
3) A step-by-step description of the algorithm
Given that the ith has been completed so that (i)(x) and di are known. Then for
the current (i+1)th iteration, the polynomial (i+1)(x) is obtained as follows:
Step 1: If di=0,
Take (i)(x) as the next polynomial , and so
(i+1)(x)= (i)(x)
ri+1 =ri.
李莉,Notes to Error Control Code,2007.05.05
go to Step 3.
Step 2: If di0,
Find a previous polynomial (k)(x) , k<i, such that nk has the largest value and
dk0.
(i+1)(x)= (i)(x)+
xi d i
(k)(x)= (i)(x)+didk-1xi-k(k)(x)
xk d k
ri+1 =max(ri,i-nk).
Step 3: The polynomial (i+1)(x) is checked to see if its coefficients are consistent
with the next Newton's identity, so determine
ri 1
S~i+2=1(i+1)Si+1+2(i+1)Si+…+ri+1(i+1)Si+2-ri+1.=  k(i+1)Si+2-k.
k 1
And the discrepancy
along with
~
di+1=Si+2+S i+2.
ni+1=i+1- ri+1
make a note of (i+1)(x), ri+1, ni+1, di+1 in the table containing
the initial conditions.
Table 7.2
Initial
conditions for the
Berlekamp algorithm
i
(i)(x) ri ni di
Repeat iterations until (2t)(x) is obtained.
-1 1
0 -1 1
Note that at each iteration the index i denotes the results of
0 1
0 0 S1
the previous iteration and the algorithm determines the
polynomial for the current iteration, i.e. the (i+1)th, and then checks how well the
polynomial satisfies the conditions for the next iteration, i.e. the (i+2)th.
The carefully selected initial conditions are shown in Table 7.2.
Example 7.15
A codeword c(x) belonging to the triple-error-correcting (15,5) BCH code incurs
errors so giving v(x)=x13+x10+x8+x4+x+1. Determine the positions of the errors,
the error pattern and the codeword c.
Solution:
The error syndromes are S1= v()=12, S2= v(2)=9, S3=10, S4=3, S5=5, S6=5,
where  is an element of GF(24). Let's now determine the error-location
polynomial using Berlekamp algorithm. The initial conditions (I.C.) required are
shown in the first two rows of table 7.3.
1st iteration:
The i=0 row in Table 7.3 defines the previous iteration and we start with i=0 and
determine (i+1)(x)= (1)(x). As the discrepancy d0=120, we skip Step 1 and
go to Step 2. We need to find a polynomial (k)(x) prior to (0)(x) that has dk0,
and the largest nk. There is only one polynomial before (0)(x) , namely
(-1)(x)=1 and this must be used and therefore k=-1. The discrepancy d-1=10.
So the required polynomial is
李莉,Notes to Error Control Code,2007.05.05
(1)(x)=(0)(x)+(
x 0d 0
x
d 1
12
x 1  1
)=1+12x1+1(1)x,
 . The degree of (1)(x) is
r1=max(r0, 0-n-1)=max(0,1)=1.
Proceeding now to Step 3 we need to find d1 by first using the coefficient of
where
1(1)=
1
) (-1)(x)=1+(
12
(1)(x) to estimate the next error syndrome S~2,
S~2=1(1)S1=1212=9
So
d1= S2+S~2=9+9=0.
Finally evaluate
n1=1-r1=0
And make a note of (1)(x), r1, n1, and d1 in Table 7.3(row i=1)
2nd iteration:
Here i=1, we start by looking at the previous discrepancy d1. since d1=0 we
carry out Step 1.
(2)(x)= (1)(x)=1+12x
r2 =r1=1.
Omitting Step 2 and carrying out Step 3
gives
S~3=1(2)S2+2(2)S1=129=6
As 1(2)=12 and 2(2)=0. The
discrepancy d2 is
Table 7.3
The Berlekamp algorithm applied to a
triple-error correcting code
i
-1
0
1
2
3
4
5
6
(i)(x)
1
1
1+12x
1+12x
1+12x+10x2
1+12x+10x2
1+12x+x2+5x3
1+12x+x2+5x3
ri
0
0
1
1
2
2
3
-
ni
-1
0
0
1
1
2
2
-
di
1
12
0
S~i Si
First2
rows I.C.
0
12
7 9
0
6
1
3
0
10
5
d2= S3+S~3=10+6=7.
And n2=2-r2=1. The results are noted in
table 7.3(row i=2)
rd
3 , 4th and 5th iterations:
Taking i=2, 3, 4 and proceeding as illustrated in the previous two iterations
gives the next three rows shown in Table 7.3.
th
6 iteration:
Taking i=5, the previous discrepancy d5=0.so we carry out Step 1.
9
10
3
5
5
(6)(x)= (5)(x)=1+12x+x2+5x3.
There is no need to continue further, for a triple-error-correcting code has t=3
and so (2t)(x)=(6)(x) is the last polynomial to be determined. The required
error-location polynomial is therefore
(x)= (6)(x)=1+12x+x2+5x3.
Which is the same as that obtained in Example 7.6, (p206). A Chien search
(钱闻天) over GF(24) gives the roots 2,10,13 and taking their reciprocals
gives 13,5,2 as the error-location numbers respectively. The error pattern is
therefore e(x)= x13+x5+x2.
The codeword polynomial is c(x)=v(x)+e(x)= x10+x8+x5+x4+x2+x+1.
李莉,Notes to Error Control Code,2007.05.05
4) For occurred error <t
If the number of errors  is less than t, then not all 2t iterations are required. If
the discrepancy di and the following mi=t-ri-1 discrepancies are zero, then
(i)(x) is the required error-location polynomial (如果 di=0,且其后 mi=t-ri-1
个差值也是零,则迭代可以终止, (i)(x)就是所要求的错误位置多项式). Adding
this to the algorithm, each time di =0, we start counting successive zero
discrepancies. If the count reaches the required number mi, then the algorithm
stops. Otherwise the count stops, is initialized to zero and counting
recommences at the next zero discrepancy.
Example 7.16
A codeword c(x) belonging to the triple-error-correcting (15,5) BCH code incurs
a single error e(x)=x11 so giving v(x)=x12+x9+x8+x7+x2+1. Show that the
Berlekamp algorithm requires fewer than 2t iterations.
Solution:
Over the GF(24), the error syndromes are shown as in Table 7.4. The initial
conditions are shown in the first 2 rows of the Table 7.4.
At the 1st iteration we take the previous discrepancy d0=110. The only
iteration prior to this is i=-1, so taking k=-1, d-1=10, the required polynomial is
(1)(x)=(0)(x)+(
x 0d 0
x
1
)(-1)(x) =1+(
d 1
11
x 1  1
The values of r1, n1 are,
r1=max(r0, 0-n-1)=1
n1=1- r1=0
as r0=0, n-1=-1. To defined d1, we first
determine S~2=1(1)S1=1111=7. So
d1= S2+S~2=7+7=0.
Now m1=t-r1-1=3-1-1=1 as the
error-correcting limit t=3 and therefore if
the next discrepancy is zero we can stop.
As d1 =0 the next iteration gives
)=1+11x1+1(1)x,
Table 7.4 The Berlekamp
algorithm applied to a triple-error
correcting code with 1 error
i (i)(x) ri ni di S~i Si
-1
0
1
2
3
4
5
6
1
1
1+11x
1+11x
1+11x
1+11x
1+11x
1+11x
0
0
1
1
1
1
1
-
-1
0
0
1
2
3
4
-
1
11
0
0
0
0
0
-
First2
rows I.C.
0
11
7
3
14
10
6
7
3
14
10
6
(2)(x)=(1)(x)=1+11x1+1(2)x,
and S~3=1(2)S2+2(2)S1=117=3
as 1(2)=11 and 2(2)=0. So
d2= S3+S~3=3+3=0.
Therefore no further iteration is needed and (x)=(2)(x)=1+11x is the required
error-location polynomial. The root of (x) is -11, and its reciprocal 11 is the
李莉,Notes to Error Control Code,2007.05.05
error-location number, and the error pattern is e(x)=x11. So that the code
polynomial is c(x)=v(x)+e(x)= x12+x11+x9+x8+x7+x2+1.
All the remaining discrepancies must equal zero, we can check by calculating
S~4, S~5, S~6. Note (x)=1+11x gives 1=11, 2=0, 3=0.
S~4=1S3+2S2+3S1=113=14.
S~5=1S4+2S3+3S2=1114=10.
S~6=1S5+2S4+3S3=1110=6.
Which gives d3=d4=d5=0. Hence the coefficients of (x) satisfy the required
2t=6 Newton's identities.
5) Discussion
10 In practice it is quite likely that the number of errors is less than the
error-correction limit t, otherwise the code would not be suitable for the given
application. Hence the number of iterations required by the Berlekamp
algorithm is normally less than 2t.
0
2 The algorithm described here applies to non-binary as well as binary codes. For
binary codes the algorithm can be simplified so that a maximum of t, and not 2t,
iterations are required; this is not covered here. Hence offering a further
reduction in processing time.
0
3 The processing time of the PGZ decoder increases significantly as t increased,
because the computational requirement for evaluating the inverse of a t by t
matrix is dependent on t3. However, in the Berlekamp algorithm, the maximum
number of iterations increases linearly with t and there is therefore no
significant degradation in performance when codes with large error-correction
limits are used.
7.9 The error-evaluator polynomial (错误估值多项式)
(求非二元 BCH 码的错误值。ref. WXinmeiP281, 错误值多项式,p287~289)
Now we consider how the error magnitudes can be determined without the
need for matrix inversion. Consider a t-error-correcting RS code and assume
that the error syndromes S1, S2,…, S2t have been determined along with the
number of errors  and the error-location polynomial
(x)=1+1x+2x2+…+x.
To find the error magnitudes we first define the error-evaluator polynomial
(x)=1+1x+2x2+…+x.
(7.53)
where 1=S1+1
2=S2+1S1+2
李莉,Notes to Error Control Code,2007.05.05
┇
=S+1S-1+2S-2+…+.
Once the error-evaluator polynomial is determined, the magnitude Yj
corresponding to the error-location number Xj is given by
Yj =(Xj-1)/[(1+Xj-1X1)(1+Xj-1X2)…(1+Xj-1X)]

=(Xj-1)/  (1+Xj-1Xi)
(7.54)
i  j,i 1
Where j=1,2,…, . The product on the denominator excludes the term (1+Xj-1Xj).
To illustrate the algorithm we reconsider the example 7.14 (in this notes, or S.
Gravano p215-216) covered in Section 7.7 in which the PGZ decoder was used
to decode a triple-error-correcting (15,9) Reed-Solomon code.
Example 7.17
A codeword c(x) belonging to the triple-error-correcting (15,9) Reed-Solomon
code incurs errors so giving v(x)=3x12+x8+10x7+2x5+8x4+14x3+6.
Determine the positions and magnitudes of the error pattern and the codeword
c by Berlekamp algorithm and error-evaluator polynomial.
Solution:
Over GF(24) the error syndromes are
S1=v()=6
S2=v(2)=0
S3=v(3)=14
S4=v(4)=11
S5=v(5)=14
S6=v(6)=9
The error-location polynomial is found by Berlekamp algorithm:
The 1st iteration: The previous discrepancy d0=60. The only iteration prior
to this is i=-1, so taking k=-1, d-1=10, the required polynomial is
(1)(x)=(0)(x)+(
x 0d 0
x
1
x
d 1
The values of r1, n1 are,
r1=max(r0, 0-n-1)=1;
6
)(-1)(x) =1+(
1
)=1+6x1+1(1)x,
1
n1=1- r1=0,
as r0=0, n-1=-1. To defined d1, we first determine S~2=1(1)S1=66=12. So
d1= S2+S~2=0+12=120.
The 2nd iteration:
d1=120. prior to this and having largest nk value, and dk0, it is k=0, because
n0=0> n-1=-1
李莉,Notes to Error Control Code,2007.05.05
(2)(x)=(1)(x)+(
x1d1
)(0)(x) =1+6x + (
x12
)1=1+6x+6x 1,
x0   6
0
x d0
The values of r2, n2 are,
r2=0;
n2=2- r2=2,
rd
The 3 iteration:
S~3=1(2)S2+2(2)S1=0. d2= S3+S~3=14+0=140.
d2= 140. select k=0: largest n0,
least degree polynomial,d00.
(3)(x)=(2)(x)+( x 2d 2 )(0)(x)
x 0d 0
=1+ x2( 
14

r3=2;
S~
4=1
)=1+8x2,
6
n3=3- r3=1,
(3)S
(3)
14
8
3+2 S2=0 + 0=0.
d3= S4+0=110.
这里不取 k=1,否则得到的
(3)(x)= 1+2x+8x 2, x 的一次幂
的系数2 大于 k=0 时 x 一次幂的系数
0.
The 4th iteration:
Table 7.5 The Berlekamp
algorithm applied to a triple-error
correcting code with 3 errors
i
-1
0
1
2
3
4
5
6
(i)(x)
1
1
1+6x
1
1+8x2, 取 k=0
1+12x+8x2
1+12x+7x2
1+12x+7x2+7x3
1+x+11x2+4x3,
ri
0
0
1
0
2
2
2
-
ni
-1
0
0
2
1
2
3
-
di
1
6
12
14
11
10
6
k=2
k=4
S~i Si
First2
rows I.C.
0
6
12 0
0
14
0
11
11

14
5 9
d3= 110. select k=2, n2=2 is the largest ni.
(4)(x)=(3)(x)+d3d2-1x3-2(2)(x) =1+8x2+ x11-141=1+12x+8x2,
r4=2;
n4=4- r4=2,
S~5=1(4)S4+2(4)S3=1211+814=11.
d4= S5+S~5=14+11=100.
The 5th iteration:
d4=100. select k=2,
(5)(x)=(4)(x)+d4d2-1x4-2(2)(x) =1+12x+8x2+x210-141=1+12x+7x2,
r5=2;
n5=5- r5=3,
S~6=1(5)S5+2(5)S4=1214+711=5.
d5= S6+S~6=9+5=60.
The 6th iteration:
***** d5=60. select k=2, n2=2
(6)(x)=(5)(x)+ d5d2-1x5-2(2)(x) =1+12x+7x2+x36-141
=1+12x+7x2+7x3,
The result is not the same as find by PGZ algorithm. Why???参见后面的讨论。
If we select k=4, n4=2, (the value is the same as n2=2 )
李莉,Notes to Error Control Code,2007.05.05
(6)(x)=(5)(x)+x5-4d5d4-1(4)(x) =1+12x+7x2+x6-10(1+12x+8x2)
= 1+x+11x2+4x3,
The result is the same as that of PGZ's. (x)=(6)(x)=1+x+11x2+4x3, which
indicates there are 3 errors. The root of (x) over GF(24) are 3, 9, 14 , so the
error-location numbers are their reciprocals X1=12, X2=6, X3= corresponding
to errors in positions x12, x6, x.
For =3 errors the error evaluator polynomial reduces to
(x)=1+1x+2x2+3x3.
(7.55)
where 1=S1+1=13
2=S2+1S1+2=
3=S3+1S2+2S1+3=11.
(7.56)
13
So the error-evaluator polynomial is determined, (x)=1+ x+x2+11x3.
(X1-1)= (-12)=1+13-12+-12*2+11-12*3=11.
(X2-1)= (-6)=1+13-6+-6*2+11-6*3=6.
(X3-1)= (-1)=1+13-1+-1*2+11-1*3=.
Taking j=1,2,3 and substituting (Xj-1), X1, X2, X3 into eqn 7.54, gives the error
magnitudes:
Y1 =(X1-1)/[(1+X1-1X2)(1+X1-1X3)]=11/[(1+-126)(1+-12)]=3,
Y2 =(X2-1)/[(1+X2-1X1)(1+X2-1X3)]=6/[(1+-612)(1+-6)]=3,
Y3 =(X3-1)/[(1+X3-1X1)(1+X3-1X2)]=/[(1+-112)(1+-16)]=9,
The error pattern
e(x)=Y1xp1+Y2xp2+Y3xp3= 3x12+3x6+9x.
The decoding codeword is
c~(x)=v(x)+e(x)
= 3x12+x8+10x7+2x5+8x4+14x3+6 + (3x12+3x6+9x).
= x8+10x7+3x6+2x5+8x4+14x3+9x +6
Discussions:
10 The solution by Berlekamp algorithm is usually not unique, such as in the above
example 7.17. (第 (i+1)th 迭代,遇到前面行最大的 ni 值有多个时,就有如何选
择 k 值的问题。Eg.7.17, 第 6 步迭代:k=2,4 的均为 2,是最大的,如何选?
经分析,所取的 k 值,应使得到的(i+1)(x)的低次幂系数最小。因为对 RS code,
GF(2m)域中的元素{0,1, , 2,…, 2t}有序排列时,位于前面的符号重量较小,从
李莉,Notes to Error Control Code,2007.05.05
最大似然概率解码的角度,总认为“错的位数少的可能性最大”)。但在 WXinmei,
p281 的例子中,不管我们这里的分析,取哪个均可,本例不行,本例和下例与
WXinmei 的例题不同点:此处的两个例子中的校验子均有一个是零。
20 The procedure discussed here is not the same as that given in ref.
WXinmeip280, but the final results are both correct.
0
3 If we use the method given by WXinmeip280, there is a problem at the i=2 step
where the degree of (2)(x) is less than the degree of (2)(x) while the theoretic
condition is " the degree of (i)(x) should be larger than or equal to the
degree of (i)(x)". So the algorithm here is a simplified one.
根据上述分析,再看 example as follows.
Example 7.18
A codeword c(x) belonging to triple-error-correcting (15,9) RS code incurs errors
so giving v(x)=x10+3x8+11x7+8x6+6x5+4x4+5x2+9x+6. Determine c(x).
Solution:
(x)=(6)(x)=
1+2x+11x2+5x3, which
indicates there are 3 errors.
The root of (x) over GF(24)
are 5, 8, 12 , so the
error-location numbers are
their reciprocals X1=10,
X2=7, X3=3 corresponding
to errors in positions x10, x7,
x3.
For =3 errors the error
evaluator polynomial
reduces to
Table 7.6 The Berlekamp
algorithm applied to a triple-error correcting code
with 3 errors
i (i)(x)
ri ni di S~i Si
-1 1
0 1
0 -1 1
0 0 4
First2
rows I.C.
1 1+4x
2 1+11x
1 0 2
1 1 14 8
3 1+11x +10x2, 取 k=0,
1+x +x2,
取 k=1,
2 1
11 10
11
2 1 
4 1+11x+10x2,
5 1+11x+3x2+8x3,取 k=2, 
1+12x+5x2+x3,取 k=3,
6 1+2x+11x2+5x3,对应 k=2,
1+8x+x3, 对应 k=3,
2
3
3
-
2 11 8
2 5 11
2 3
12
1
4
1
7
0
14
14
(x)=1+1x+2x2+3x3
where 1=S1+1=10
2=S2+1S1+2=4
3=S3+1S2+2S1+3=2.
So the error-evaluator polynomial is determined, (x)=1+10x+4x2+2x3.
(X1-1)= (-10)=1+10-10+4-10*2+2-10*3=13.
(X2-1)= (-7)=1+10-7+4-7*2+2-7*3=1.
李莉,Notes to Error Control Code,2007.05.05
(X3-1)= (-3)=1+10-3+4-3*2+2-3*3=.
the error magnitudes:
Y1 =(X1-1)/[(1+X1-1X2)(1+X1-1X3)]=13/[(1+-107)(1+-103)]=1,
Y2 =(X2-1)/[(1+X2-1X1)(1+X2-1X3)]=1/[(1+-710)(1+-73)]=4,
Y3 =(X3-1)/[(1+X3-1X1)(1+X3-1X2)]=/[(1+-310)(1+-37)]=6,
The error pattern
e(x)=Y1xp1+Y2xp2+Y3xp3=x10+4x7+6x3.
The decoding codeword is
c~(x)=v(x)+e(x)
= x10+3x8+11x7+8x6+6x5+4x4+5x2+9x+6+ (x10+4x7+6x3).
= 3x8+13x7+8x6+6x5+4x4+6x3+5x2+9x +6