Chapter 6 BCH code -...
Transcript of Chapter 6 BCH code -...
١
١
Chapter Chapter 66
BCH codeBCH code
Ammar Abu-Hudrouss Islamic University Gaza
Spring 2009
Slide ٢Channel Coding Theory
Zeros of cyclic code
Many of the most important block codes for random-error correction fall into the family of BCH codes, named after their discoverers Bose, Chaudhuri and Hocquenghem.
BCH codes include Hamming codes as a special case.
The construction of a t-error correcting binary BCH code starts with an appropriate choice of length:
n = 2m - 1 (m is integer 3)
It is given that n - k mt and dmin 2t + 1
٢
Slide ٣Channel Coding Theory
Zeros of cyclic code
A t-error correcting q-ary BCH code of length qm - 1 is a cyclic code whose roots include 2t consecutive powers of , the primitive element of GF(qm).
Two main cases of interests
Binary BCH codes will consist of binary sequences of length 2m —1 with roots including 2t consecutive powers of the primitive element of GF(2m).
Reed Solomon codes are the special case where m = 1. They therefore consist of sequences of length q — 1 whose roots include 2t consecutive powers of the primitive element of GF(q).
Slide ٤Channel Coding Theory
Construction of Binary BCH code
We construct GF(16) so that we can define codes of length 15. The primitive polynomial to be used is p(X) = X4 + X + 1. The polynomial basis representation of the elements is
ValueElementValueElement101170000
0101800010
1010900101
01111001002
11101110003
11111200114
11011301105
10011411006
٣
Slide ٥Channel Coding Theory
Single error correcting code
we choose 1 and 2 as the consecutive roots for this code.
We know that there will be conjugate roots, the full set of conjugates being 12 48
The generator polynomial is
842)( XXXXXg
0013117121069532
84234)(
XXXXXg
1)( 4 XXXg
Slide ٦Channel Coding Theory
Single error correcting code
Alternatively we find that the generator polynomial is the LCM of the minimum polynomials of 1 and 2.
Both these elements have X4 + X + 1 as their minimum polynomial, therefore this is the generator of the code. The code has 4 parity checks (from the degree of the generator) and so is a (15, 11) code.
٤
Slide ٧Channel Coding Theory
Double error correcting code
Suppose we choose 1 2 3 and 4 as the consecutive roots for this code.
Starting of and including the conjugates we have roots 1 2
4 8
Which include 2 and 4 but not 3 . The conjugates of 3 are 3 6 12 9
The degree of the generator is 8, so the code is (15, 7).
91263842)( XXXXXXXXXg
11)( 2344 XXXXXXXg
1)( 4678 XXXXXg
Slide ٨Channel Coding Theory
Triple error correcting code
For triple correcting code we want to have 1 2 3 4 5 and 6 all the roots are included in the double code but 5 with conjugates 5 10
The degree of the generator is 10, so the code is (15, 5).
1054678 1)( XXXXXXXg
11)( 24678 XXXXXXXg1)( 245810 XXXXXXXg
٥
Slide ٩Channel Coding Theory
Roots and Parity Check Matrix
Consider the code generator polynomial
And if is a root of v (X ) then
Or in vector form
012
21
1 vXvXvXvXv nn
012
21
10 vvvvv nn
0
1
2
1
n
v
Slide ١٠Channel Coding Theory
Roots and Parity Check Matrix
Similarly if there are j roots from 1 to j
But vHT = 0
0
1111121
221
22
21
111
12
11
jj
jj
nj
nj
nn
v
TTj
Tj
Tnj
TTj
Tj
Tnj
TTTTn
TTTTn
H
1
1
11
211
21
11
222
12
121
11
٦
Slide ١١Channel Coding Theory
Parity Check Matrix for Single Error
If we take element as a root, then
The powers of a are just all the nonzero elements of the field
For example taking the code based on GF(8), for which 3 + + 1 = 0, gives
TTTTnH 121
100101101011100010111
H
TTTTTTT
H 1123456
Slide ١٢Channel Coding Theory
Parity Check Matrix for Double Errors
Suppose we choose 1 2 3 and 4 as the consecutive roots for this code, and 3 are independent, then
For length 15 we have
TTTTn
TTTTn
H11
32313
21
11
36912036912036912
12356789101112131415
TTTTTTTTTTTTTT
TTTTTTTTTTTTTT
H
٧
Slide ١٣Channel Coding Theory
Parity Check Matrix for Double Errors
Which gives
100011000110001000110001100011001010010100101011110111101111100010011010111010011010111100001001101011110000100110101111
H
Slide ١٤Channel Coding Theory
Parity Check Matrix for Triple Errors
Suppose we choose 1 2 3 4 5and 6 as the consecutive roots for this code, , 3 and 5 are independent, then
For length 15 we have
TTTTn
TTTTn
TTTTn
H
1
11
52515
32313
21
TTTT
TTTT
TTTT
H
1
11
51010
32312
214
٨
Slide ١٥Channel Coding Theory
Parity Check Matrix for Double Errors
After deleting all zeros row and duplicated row
101101101101101011011011011011100011000110001000110001100011001010010100101011110111101111100010011010111010011010111100001001101011110000100110101111
H
Slide ١٦Channel Coding Theory
Algebraic Decoding
BCH codes allow an algebraic method of decoding. Consider the case of a double error correcting code where there are errors at positions i and j .The syndrome
The syndrome has two components
Substituting the first in the second
Roots can be found by trying all possible values of i.
TeHs
jj
ji
s
s33
3
1
0331
21
21 ssss ii
٩
Slide ١٧Channel Coding Theory
Algebraic Decoding
Example: For the double-error correcting BCH code of length 15, if the received sequence is 101010110010101
Subsisting in equation in the previous slide
The equality holds for i = 2 and i = 13.
The errors are therefore at positions 2 and 13 giving a transmitted sequence m = 111010110010001
51410010110 TRHs
051221413 ii
00000000 TmHs
Slide ١٨Channel Coding Theory
BCH Decoding and the BCH bound
We want to prove here that if we want to 2t consecutive zeros in the frequency domain are sufficient to guarantee t error corrections.
Assume d = 2t + 1
Suppose we have a code vector c (X ) with fewer than d nonzero components (i.e dmin = weight(c) < d)
As c (X ) is a valid codevector, it has 2t consecutive roots. Which means that the spectrum C (z ) will have 2t = d -1.
Assume (X ) which is the inverse of c. i.e it equals zero when c =1 and vice versa.
١٠
Slide ١٩Channel Coding Theory
BCH Decoding and the BCH bound
The zero components in (X ) means that each ij will be root of the transform (z ) of (X ) . ij is the position of zeros in (X )
This mean
Now in the time domain, i ci = 0, therefore in the frequency domain , replacing the multiplication with a convolution,
v
j
i jzz1
1
1
0
n
jjkjC
Slide ٢٠Channel Coding Theory
BCH Decoding and the BCH bound
But the degree v of (z ) is at most d -1 and = 0, which leaves us with
Which means that the components Ck can be generated from the previous d – 1 components as in the graph
1
1
d
jjkjk CC
١١
Slide ٢١Channel Coding Theory
BCH Decoding and the BCH bound
But as C (z ) has d – 1 consecutive zero components. If these are happened to initialize the register all the next components will equals zero.
This mean that the minimum weight should equal at least 2t + 1 = d to avoid the generation of zero codeword.
Slide ٢٢Channel Coding Theory
Decoding in the Frequency Domain
Assume that we transmit a code sequence c (X) and that it is received with the addition of an error sequence e(X).
We take the transform of the received sequence, giving
We know that C(z) is zero in 2t consecutive spectral locations, so we can use these locations to give us a window on E(z),
2t components of E(z) can easily be obtained and can be considered to form a syndrome S(z).
zEzCzR
١٢
Slide ٢٣Channel Coding Theory
Decoding in the Frequency Domain
We assume that there are v < t errors and define an error locator polynomial (X) such that it is zero in the positions where e (X ) is nonzero.
The product of the received sequence and the error locator sequence in the time domain will therefore be zero, which means that in the frequency domain the convolution between (z) and E (z) will be zero
00
t
jjkjE
Slide ٢٤Channel Coding Theory
Decoding in the Frequency Domain
If we know the error spectrum from positions m to m + 2t - 1, we can form t equations by letting k take values from m + t to m + 3t — 1.
Assuming the spectral zeros of the code are from positions 1 to 2t, the equations are as follows:
This set of t equations in t + 1 unknowns is called the key equation, this can be solved if we assume 0 = 1
00
0
12120
121120
1110
tttt
tttt
ttt
EEEEEE
EEE
١٣
Slide ٢٥Channel Coding Theory
Decoding in the Frequency Domain
Example 1Take the example of the (15, 7) binary BCH code from Section 6.6 where we received a sequence 1010101 100 10101 which was found to have two errors, in positions 2 and 13.
We calculate the Fourier transform of the received sequence in the positions of the zeros, i.e. positions 1, 2, 3 and 4.
The key equation becomes
zzzzzS 1421335411
0214
1135
0213
1511
Slide ٢٦Channel Coding Theory
Decoding in the Frequency Domain
To solve, we can multiply each term in the second equation by and add to the first equation to eliminate 2. This gives
Hence,
Decoding can now be carried out by finding the roots of z 2 + l4z + 1,
The roots are 2 and 13. Hence the errors are at positions -2 and -13, or the error at the locations are 13,2.
141
12
١٤
Slide ٢٧Channel Coding Theory
Decoding in the Frequency Domain
Example 2 Suppose now that only one error occurred, say the error in
position 13. The syndromes are found to be s1 = 13, s3 = 9, giving a full syndrome polynomial of
Hence,
Which leads
zzzzzS 132113947
0213
1119
0211
197
131 02
Slide ٢٨Channel Coding Theory
Decoding in the Frequency Domain
The connection polynomial is therefore 13 z + 1, which has root at -13 , indicating an error at position 13.
١٥
Slide ٢٩Channel Coding Theory
Decoding in the Frequency Domain
Example 3 Suppose now that we have three errors at 2,10,13. The
syndromes are found to be s1 = a11, s3 = a10, giving a full syndrome polynomial of
Hence,
Which leads
zzzzzS 1127310414
0211
1710
027
11014
111 1
2
Slide ٣٠Channel Coding Theory
Decoding in the Frequency Domain
The Connection polynomial is therefor z 2 + l1 z + 1,
No roots can be found for this equation.
١٦
Slide ٣١Channel Coding Theory
Polynomial Form of The Key Equation
We wish to find a solution to the key equation, which can be expressed as
This convolution can be expressed as multiplication of the sequence polynomial in the previous equation it represents the terms from t to 2t-1
The term of power more that 2t is represented by f(z)z2t
The term of power less than t is represented by (z)
12000
tkEt
jjkj
1202 tkzzzfzEzA t
Slide ٣٢Channel Coding Theory
Euclid's method
enables us to find minimum degree solutions for polynomials f(z) and g(z) such that
where r(z) is known to have degree less than some fixed value. In our case, r(z) will have degree < t, a(z) = z2t and b(z) is the
syndrome polynomial S(z).
The polynomial g(z) will give us (z), which is what we need to know. The method involves repeated division of polynomials until a remainder of degree < t is found.
zrzgzbzfza
١٧
Slide ٣٣Channel Coding Theory
Euclid's method
The first step is to divide a(z) by b(z) to find the quotient q1(z) and remainder r1(z):
The degree of r1(z) is less than t then we have reached our solution with f(z) = 1, g (z) = q1 (z) and r (z) = r1 (z).
Otherwise set g1(z) = q1(z) and proceed to the next stage. The second step is to divide b(z) by r1(z) giving
Leading to
zrzrzqza 211
zrzrzqzb 212
)(1 2122 zrzbzgzqzazq
Slide ٣٤Channel Coding Theory
Euclid's method
Set g2 (z) = q2(z)g1(z) + 1. If the degree of r2(z) is less than t then g(z) = g2(z);otherwise, continue to the next step.
The third step continues in similar vein, dividing r1 (z) by r2(z):
Again the degree of the remainder is decreasing. Using Equations (6.14) and (6.15)b to eliminate r1(z) and r2(z) gives
If the degree of r3 (z) is less than t then g3(z) = g3(z) = q3(z)g2(z) + g1(z).
zrzrzqzr 3221
zrzbzgzqzgzazqzq 3231321
١٨
Slide ٣٥Channel Coding Theory
Euclid's method
The method continues in this way until a remainder of degree less than t is found, at each stage setting
0,1 1021 zgzgzgzgzqzg nnnn
Slide ٣٦Channel Coding Theory
Euclid's method
Example We shall now solve the key equation for the double-error
example. The syndrome was given as
Divide z 4 by S (z) to give Divide z 4 by S (z ) to give
Which leads
Divide S (z) by
141325311 zzzzS
125261413253111344 zzzzzzz
1341 zzg
12526 zz
81252695141325311 zzzzzz
١٩
Slide ٣٧Channel Coding Theory
Euclid's method
Set
As the remainder is < 2, this is the end of Euclid's algorithm. The result for g2(z) is the connection polynomial (z)
9829134952 1 zzzzzg
Slide ٣٨Channel Coding Theory
Berlerkamp-Massey Algorithm
The algorithm is easy to implement but difficult to understand how it works.
We will focus on the implementation.
Consider l represents the degree of the error locator polynomial. n represents the degree of the syndrome polynomial
٢٠
Slide ٣٩Channel Coding Theory
Berlerkamp-Massey Algorithm
Berlekamp-Massey Algorithm for binary BCH example Begin l : = 0; n : = 0; k = -1; (z) := 1; D (z ) := z (z); While (n < 2t) do
If ( 0) then If (l < n – k) l* := n – k k: = n – l D (z ) := (z)/ ; l := l* end
l
iiniS
0
:
Slide ٤٠Channel Coding Theory
Berlerkamp-Massey Algorithm
(z) := *(z); end; D (z ) := z D (z ); n := n + 1; end end
٢١
Slide ٤١Channel Coding Theory
Berlerkamp-Massey Algorithm
Example We shall now solve the key equation for the double-error
example. The syndrome was given as
Initializations l : = 0; n : = 0; k = -1; (z) := 1; and D (z ) := z (z); First iteration
l < n – k l* := 1; k :=0; D (z ) =, l : =1
141325311 zzzzS
014 1* 14 zz
1* 14 zzz
Slide ٤٢Channel Coding Theory
Berlerkamp-Massey Algorithm
D (z) = z D (z) = z; n =1;
2nd iteration (1 < 4)
D (z) = z D (z) = z2; n =2;
3rd iteration (2 < 4)
l < n – k l* := 2; k :=1; D (z ) =z + , l : =2
0
014 1* 142 zzz
1* 142 zzzz
٢٢
Slide ٤٣Channel Coding Theory
Berlerkamp-Massey Algorithm
D (z) = z D (z) = z2 + z; n =3;
4th iteration (3 < 4)
D (z) = z D (z) = z3 + z2; n =4; Stop
0
Slide ٤٤Channel Coding Theory
Berlerkamp-Massey Algorithm
Inversionless Berlekamp-Massey Algorithm Begin l : = 0; n : = 0; k = -1; (z) := 1; D (z ) := z (z); * = 1; While (n < 2t) do
If ( 0) then *(z) = *x (z) + x D (z); If (l < n – k) l* := n – k; * = ;
l
iiniS
0
:
٢٣
Slide ٤٥Channel Coding Theory
Berlerkamp-Massey Algorithm
k: = n – l; D (z ) := (z); l := l*; End; (z) := *(z); end; D (z ) := z D (z ); n := n + 1; End; End;
Slide ٤٦Channel Coding Theory
Berlerkamp-Massey Algorithm
Example We shall now solve the key equation for the double-error
example. The syndrome was given as
Initializations l : = 0; n : = 0; k = -1; (z) := 1; and D (z ) := z (z); * = 1; First iteration
l < n – k l* := 1; k :=0; D (z ) =0, l : =1
141325311 zzzzS
014 1* 14 zz
1* 14 zzz
14*
٢٤
Slide ٤٧Channel Coding Theory
Berlerkamp-Massey Algorithm
D (z) = z D (z) = 0z; n =1;
2nd iteration (1 < 4)
D (z) = z D (z) = 0z2; n =2;
3rd iteration (2 < 4)
l < n – k l* := 2; k :=1; D (z ) = 14z +1, l : =2
0
014 1413214* zzz
14*
1413214* zzzz
Slide ٤٨Channel Coding Theory
Berlerkamp-Massey Algorithm
D (z) = z D (z) = 14z2 +z; n =3;
4th iteration (3 < 4)
D (z) = z D (z) = 14z3 +z2; n =4; Stop
0