Example of Simple BCH Error-Correcting Coding

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Vojtech@Brtnik.

eu BCH Coding April 19, 2010

Example of simple BCH error-correcting coding

Problem: Design a 2-error correcting BCH code C of length 13 over the field
GF(27). Find a non-zero code word in C, impose two errors and correct
using an efficient algorithm.

Definition: Let β be a primitive root of the polynomial xn − 1. If we use


the generator polynomial g(x) such that β, β 2 , . . . , β d−1 , are all roots of
g(x), such a code is then called a BCH-code with design distance d.

Part 1: factorization into irreducible factors and listing roots of


those factors.

In GF(3) holds

x13 − 1 = (x + 2)(x3 + 2x + 2)(x3 + x2 + 2)(x3 + x2 + x + 2)(x3 + 2x2 + 2x + 2).

Denote these polynomials as follows

f1 (x) := x + 2,
f2 (x) := x3 + 2x + 2,
f3 (x) := x3 + x2 + 2,
f4 (x) := x3 + x2 + x + 2,
f5 (x) := x3 + 2x2 + 2x + 2.

We will now work in the algebraic field extension of GF(3) such that x13 − 1
is factored into linear polynomials (x − βi ) where βi are primitive roots of
1. Such a field is GF(27).

Let β be a zero of f2 , i.e. f2 (β) = β 3 + 2β + 2 = 0. It also follows that β is


a root of x13 − 1 and thus

β 13 = 1. (1)

Notorically known Lemma says that in the field F of characteristics p is for


each a, b ∈ F and k ∈ N
k k k
(a + b)p = ap + bp . (2)

1
Vojtech@Brtnik.eu BCH Coding April 19, 2010

Because in GF(27) is 23 = 2, we have


f2 (β 3 ) = (β 3 )3 + 2β 3 + 2 = (β 3 + 2β 3 + 2)3 = 0
and we conclude that β 3 is a zero of f2 . Using the same argument β 9 is as
well a zero of f2 .

Let us compute f4 (β 2 ). We know that β 3 = −2β − 2 = β + 1.


f4 (β 2 ) = β 6 + β 4 + β 2 + 2
= (β + 1)2 + β(β + 1) + β 2 + 2
= β 2 + 2β + 1 + β 2 + β + β 2 + 2 = 0.
We can see that β 2 is a zero of f4 . Using the identity (2) in the similar
manner as presented, we find that β 6 is also a zero of f4 . Assume that β 5
is a zero of fi , then using (1) and (2) is also (β 5 )3 = β 15 = β 2 a zero of fi .
We know that β 2 is a zero of f4 and thus also β 5 must be a zero of f4 .

Furthermore
f3 (β 4 ) = β 12 + β 8 + 2
= (β + 1)4 + β 2 (β + 1)2 + 2
= β 4 + 4β 3 + 2β 2 + 4β + 1 + 4β 2 + β 4 + 2β 3 + β 2 + 2 = 0
f3 (β 12 ) = 0

Using (1) and (2) we find that β 7 , (β 7 )3 = β 8 , (β 8 )3 = β 11 are zeros of


the same fi and i must be thus 5. Also β 10 and β 4 are zeros of the same
polynomial.

We can conclude this part stating that f2 has zeros β, β 3 , β 9 ; f3 has zeros
β 4 , β 10 , β 12 ; f4 has zeros β 2 , β 5 , β 6 and finally f5 has zeros β 7 , β 8 and β 11 .

Part 2: Designing the code

The powers of β in GF(27) forms the following table:


1 β β 2 β 3 β 4 β 5 β 6 β 7 β 8 β 9 β 10 β 11 β 12 β 13
1 0 0 1 0 1 1 1 2 2 0 1 2 1
0 1 0 1 1 1 2 2 0 1 2 1 0 0
0 0 1 0 1 1 1 2 2 0 1 2 1 0

2
Vojtech@Brtnik.eu BCH Coding April 19, 2010

We want to develop a code C with the design distance d = 5. According to


the definition of BCH codes, we shall take as a generating polynomial g(x)
product of those fi such that β 1 ,. . . ,β 4 are zeros of this product. Put

g(x) = f2 (x) · f3 (x) · f4 (x) = 2 + x3 + x4 + 2x6 + x7 + 2x8 + x9 .

Because C is a cyclic code over GF(3), the generator matrix G can be written
immediately
 
2 0 0 1 1 0 2 1 2 1 0 0 0
 0 2 0 0 1 1 0 2 1 2 1 0 0 
G=  0 0 2 0 0 1 1 0 2 1 2 1 0 .

0 0 0 2 0 0 1 1 0 2 1 2 1

This matrix can be transformed into a canonical form Gc = (I A):


 
1 0 0 0 2 0 0 1 1 0 2 1 2
 0 1 0 0 2 2 0 1 2 1 2 0 0 
Gc =  0 0 1 0
.
0 2 2 0 1 2 1 2 0 
0 0 0 1 0 0 2 2 0 1 2 1 2

From this we get a canonical parity-check matrix Hc = (−AT I)

1 1 0 0 1 0 0 0 0 0 0 0 0
 

 0 1 1 0 0 1 0 0 0 0 0 0 0 


 0 0 1 1 0 0 1 0 0 0 0 0 0 


 2 2 0 1 0 0 0 1 0 0 0 0 0 

Hc = 
 2 1 2 0 0 0 0 0 1 0 0 0 0 .


 0 2 1 2 0 0 0 0 0 1 0 0 0 


 1 1 2 1 0 0 0 0 0 0 1 0 0 

 2 0 1 2 0 0 0 0 0 0 0 1 0 
1 0 0 1 0 0 0 0 0 0 0 0 1

Back to the BCH codes. According to the definition, the parity-check matrix
H of the code C has a form
1 β β 2 β 3 β 4 β 5 β 6 β 7 β 8 β 9 β 10 β 11 β 12
 
 1 β 2 β 4 β 6 β 8 β 10 β 12 β β 3 β 5 β 7 β 9 β 11 
H=  1 β 3 β 6 β 9 β 12 β 2 β 5 β 8 β 11 β
.
β 4 β 7 β 10 
1 β 4 β 8 β 12 β 3 β 7 β 11 β 2 β 6 β 10 β β5 β9

3
Vojtech@Brtnik.eu BCH Coding April 19, 2010

If we substitute vectors from GF(27), we get


 
1 0 0 1 0 1 1 1 2 2 0 1 2
 0 1 0 1 1 1 2 2 0 1 2 1 0 
 
 0 0 1 0 1 1 1 2 2 0 1 2 1 
 
 1 0 0 1 2 0 2 0 1 1 1 2 1 
 
 0 0 1 2 0 2 0 1 1 1 2 1 1 
 
 0 1 1 1 2 1 1 0 0 1 2 0 2
 
H= .

 1 1 1 2 2 0 1 2 1 0 0 1 0 
 0 1 2 1 0 0 1 0 1 1 1 2 2
 

 0 0 1 0 1 1 1 2 2 0 1 2 1
 

 1 0 2 2 1 1 1 0 1 0 0 1 2
 

 
 0 1 0 0 1 2 1 0 2 2 1 1 1 
0 1 2 1 0 2 2 1 1 1 0 1 0

It can be checked that a vector space generated by H has a dimension 9 and


is obviously the same as the vector space generated by Hc .

We conclude that we have designed a cyclic linear code C of the length 13


and dimension 3, over GF(3) with the generator matrix Gc and the parity-
check matrix Hc . It is also a BCH code over GF(27) of the design distance
5 with the parity-check matrix H.

Part 3: characteristics of the code.

Length: 13 Dimension: 4
Information symbols: 9 Check symbols: 4
Rate: 9/13 Designed distance: 5
#code words: |F3 |4 = 81 Capable of correcting: 2 errors

Hilbert bound says that

|F3 |13 313 313


M3 (13, d) ≤ = 13 13 13 = < 17329.
|Be (w)| 1 + 13 + 78
  
0 + 1 + 2

Because M3 (13, k = 4, d) < 34 = 81, M3 (13, k = 5, d) < 35 = 243, we see,


that the dimension of the code could be greatly improved.

4
Vojtech@Brtnik.eu BCH Coding April 19, 2010

Part 4: theory behind decoding.

This section is written rather briefly, introducing the theory is not the pur-
pose of this paper.

Let us assume that the design distance is d, and that e errors (e ≤ 1/2d)
have occurred when transmitting certain codeword. Let σ(z), ω(z) be poly-
nomials
Y X Y
σ(z) = (1 − β i z) and ω(z) = Ei β i z (1 − β j z),
i i j6=i

where i and j run through the positions of the errors and Ei is the value of
error i. The formal derivative of σ(z) is
X Y
σ 0 (z) = −β i (1 − β j )z.
i

If we let z = β −i and divide ω by σ 0 , we get

ω(β −i )
Ei = β i ,
σ 0 (β −i )

where we still consider only those i where errors have occurred, or at least
where σ(β −i ) = 0 so in both σ 0 and ω all terms but one disappear.

Now, we get
∞ ∞
ω(z) X Ei β i z X X
ij j
X X
(z) = = = E i β z = zj Ei β ij .
σ(z) 1 − βiz
i i j=1 j=1 i

Because i Ei β ij equals to the inner product of the received word with the
P
jth row of the check matrix, exactly d − 1 coefficients of (z) can be found.
The inner product must be equal to zero for a correct word. Because ω and
σ are at most of degree e and have constant terms 0 and 1, respectively, we
only have 2e ≤ d − 1 unknowns. We find those by solving the equation

ω(z) = σ(z)(z).

This gives a system of d − 1 linear equations in the unknown coefficients of


σ and ω.

5
Vojtech@Brtnik.eu BCH Coding April 19, 2010

Part 5: find a non-zero code word in C, impose two errors and


correct.

In this part, we index elements from zero. The first row of a matrix is thus
in our notation 0th row.

For simplicity assume that a word represented by the generating polynomial


g(x) = g(x0 x1 . . . x12 ) was sent. We shall call this vector s,

s = (2 0 0 1 1 0 2 1 2 1 0 0 0).

Furthermore assume that during the transition two errors occurred, on po-
sitions 3 and 4, i.e. bits x3 and x4 were changed. We have thus received for
instance the word

s0 = (2 0 0 2 0 0 2 1 2 1 0 0 0).

Based on the theory, we want to compute the coefficients of the polynomial



!
X X
(z) = zj · Ei β ij ,
j=1 i

where Ei is the value of error on position i. The j-th coefficient is equal


to the inner product of s0 and j-th row hj of the parity-check matrix H.
With a little abusive notation, we denote this coefficient (β j+1 ). When
calculating the coefficient we can cheat and use the fact that s · hj = 0
for each j = 0, . . . , 3. We have to consider only the third column where 1
was during transition changed to 2 and the fourth column, where one was
changed to 0. It means that s0 · hj = hj,3 − hj,4 = hj,3 + 2hj,4 . A computer
cannot cheat since it does not know where the position of errors are, but
the results that it gets are naturally the same.

(β) = β 3 − β 4 = β 3 + 2β 4 = 2β 12
(β 2 ) = β 6 − β 8 = β 6 + 2β 8 = 2β 5
(β 3 ) = β 9 − β 12 = β 9 + 2β 12 = 2β 10
(β 4 ) = β 12 − β 3 = β 12 + 2β 3 = β 6

Using the key equation ω(z) = σ(z) · (z), we will find the error positions
and will be able to correct the transition. Expanding the equation we get

ω1 z + ω2 z 2 = (1 + σ1 z + σ2 z 2 )(2β 12 z + 2β 5 z 2 + 2β 10 z 3 + β 6 z 4 ).

6
Vojtech@Brtnik.eu BCH Coding April 19, 2010

We shall decompose this into the following equations

ω1 = 2β 12
ω2 = 2β 5 + 2σ1 β 12
0 = 2β 10 + 2σ1 β 5 + 2σ2 β 12
0 = β 6 + 2σ1 β 10 + 2σ2 β 5 .

Solving the linear system in four variables, we get that ω1 = 2β 12 , ω2 = 0,


σ1 = 2β 6 , σ2 = β 7 .

Based on the theory, we write:

σ(z) = 1 + 2β 6 z + β 7 z 2 = (1 − β 3 z)(1 − β 4 z)
σ 0 (z) = 2β 6 + 2β 7 z
ω(z) = 2β 12 z 2

The roots of σ are β −3 and β −4 and we conclude that errors occurred on


positions 3 and 4, i.e. s03 and s04 have to be corrected. To calculate the
syndrome Ei , we will use the formula

ω(β −i )
Ei = −β i
σ 0 (β −i )
ω(β −3 ) 2β 6 3 β
6
E3 = −β 3 0 −3 = −β 3 6 = −β = β −3
σ (β ) 2β + 2β 4 2β 12
ω(β −4 ) 2β 4 4 β
4
E4 = −β 4 0 −4 = −β 4 6 = −β = 2β −4
σ (β ) 2β + 2β 3 β 12

The syndrome is thus

s00 = (0 0 0 1 2 0 0 0 0 0 0 0 0),

and if we subtract it from the received word

s0 = (2 0 0 2 0 0 2 1 2 1 0 0 0),

we get
s = (2 0 0 1 1 0 2 1 2 1 0 0 0),
exactly what was sent. This concludes the exercise.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy