You are on page 1of 16

Chapter 7

Reed-
Reed -Solomon Code

Spring 2009

Ammar Abu-Hudrouss Islamic


University Gaza ١

Introduction

 A Reed Solomon code is a special case of a BCH code in which


the length of the code is one less than the size of the field over
which the symbols are defined.

 It consists of sequences of length q — 1 whose roots include 2t


consecutive powers of the primitive element of GF(q).

 The Fourier transform over GF(q) will contain 2t consecutive


zeros.

 Note that because both the roots and the symbols are specified
in GF(q), the generator polynomial will have only the specified
roots; (NO Conjugates)

Channel Coding Theory


Slide ٢

١
Introduction

 To construct the generator for a Reed Solomon code, and we


decide that the roots will be from i to i+2t-1, the generator
polynomial will be

    
g x   X   i X   i 1  X   i 2t 2 X   i  2t 1 
 Example:
Suppose we wish to construct a double-error correcting, length 7
RS code;
we first construct GF(8) using the primitive polynomial X3 + X + 1 as
shown. We decide to choose i = 0, placing the roots from 0 to 3.
The generator polynomial is
  
g x   X   0 X   1 X   2 X   3  
g x   X 4   2 X 3   5 X 2   5 X   6

Channel Coding Theory


Slide ٣

Time Domain Encoding

 The encoding of a Reed Solomon code can be done by a long


division method similar to that of Chapter 4

 Example
 For the Reed Solomon code above, encode the data sequence
111001111.

 The data maps to the symbols 5 0 5.

 Four zeros are appended, corresponding to the four parity


checks to be generated, and the divisor is the generator
sequence.

Channel Coding Theory


Slide ٤

٢
Time Domain Encoding

 The remainder is 6  5 0 1 so that


 the codeword is 5 0 5 6 5 0 1 . Expressed as a binary
sequence this is 11101111101111001010.

Channel Coding Theory


Slide ٥

Time Domain Encoding

The encoder circuit for a Reed Solomon code is shown

g1 g0
gn-k-1 g2

+ + + +

U(X)

Channel Coding Theory


Slide ٦

٣
Time Domain Encoding

For our example the encoder will be

2 5 5 6

+ + + +

U(X)

Channel Coding Theory


Slide ٧

Decoding Reed Solomon Code

 The frequency domain algebraic decoding method explained in


Chapter 6.

 Error value calculation can be done using the Forney algorithm.


 Where we found that

Az E z   f z z 2t  z  0  k  2t  1

 Where (z) is the connection polynomial, E (z) is syndrome in


frequency domain and (z) is t - 1 order evaluator polynomial

Channel Coding Theory


Slide ٨

٤
Decoding Reed Solomon Code

 We calculate the error evaluator polynomial and also '(z), the


formal derivative of the connection polynomial. This is found to
be

even t   t 1 z t 2   t 3 z t 4    1

odd t   t z t 1   t 2 z t 3    1

 In other words, get rid of the zero coefficient of A and then


set all the odd terms in the resulting series to zero.
 The error value in position m is now

em  z  / z 1i '  z 

 evaluated at z = m. The parameter i is the starting location of


the roots of the generator polynomial.
Channel Coding Theory
Slide ٩

Decoding Reed Solomon Code

 Example Consider the codeword 5 0 5 6 5 0 1 previously


generated for the double-error correcting (7, 3) RS code. We
create errors in positions 5 and 3, assuming that we receive
5 4 5 3 5 0 1 . The frequency domain syndrome of this
sequence is
S0   5   4   5   3   5   0   1   0
S1   5 . 6   4 . 5   5 . 4   3 . 3   5 . 2   0 .   1   1
S 2   5 . 5   4 . 3   5 . 1   3 . 6   5 . 4   0 . 2   1   0
S3   5 . 4   4 . 1   5 . 5   3 . 2   5 . 6   0 . 3   1  0

Channel Coding Theory


Slide ١٠

٥
Decoding Reed Solomon Code

 Now we form the key equation for which the solution is

 0  2   1 1   0  0
 1 2   0 1  0
 Which leads to

1   2 2  1
 And the connection polynomial is

 z    1 z 2   2 z  1  0

 The roots for the connection polynomial is 4 and 2

Channel Coding Theory


Slide ١١

Decoding Reed Solomon Code

 Having found two roots for a connection polynomial of degree 2


indicates successful error correction with errors located at
positions -4 and -2, i.e. positions 3 and 5. We now calculate the
error evaluator polynomial, taking the powers from 0 to t — 1 of
S(z)A(z).
z   S01  S1 0 z  S0  0
 z    4 z   0
 Therefore

 z   4z  0
em  
z' z  z  m  2z z   m

 Evaluating at m = 3 and 5

Channel Coding Theory


Slide ١٢

٦
Decoding Reed Solomon Code

 This leads to
 4 3   0
e3  2 3
4


 4 5   0
e5  5
 2 5

 The received symbol 3 at position 3 is therefore corrected to


6. The received symbol 4 at position 5 is corrected to 0. This
successfully completes the decoding.

Channel Coding Theory


Slide ١٣

Frequency domain encoding of RS Code

 As the Fourier transform of a Reed Solomon code word contains


n — k consecutive zeros, it is possible to encode by considering
the information to be a frequency domain vector, appending the
appropriate zeros and inverse transforming.

 Example
 We will choose again a (7, 3) double-error correcting RS code
over GF(23). Let the information be 2, 5, 0
 The frequency domain code word is 2500000, and the inverse
is 5056501
 We now create a two-symbol error, say 5 in position 5 and 4 in
position 3, as in our previous example. The received sequence is
5453501

Channel Coding Theory


Slide ١٤

٧
Frequency domain encoding of RS Code

 The decoding proceed with finding the Fourier transform of the


sequence which gives 5230010 with syndrome being
0010

We now form the key equation with t = 2 and A0 = 1 :


 0  2   1 1   0  0
 1 2   0 1  0  0

The solution is

1   2 2  1

Channel Coding Theory


Slide ١٥

Frequency domain encoding of RS Code

 We use the shift register shown to generate the code sequence


in the frequency domain

 In our example 0 = 1, 1 = 2, and 2 = . E3 = 0, E2 = .


 Cyclic the shift register generates 133, which are the
frequency domain error at locations 4,5 and 6.

Channel Coding Theory


Slide ١٦

٨
Frequency domain encoding of RS Code

 The next two values generates 01 which are the syndrome
components S0 and S1. so the code will repeat

 The complete error sequence in the frequency domain is


3310010 .

 Adding this to the Fourier transform of the received sequence


which is 5230010 .

 The result is 2500000, which is the original codeword without


errors with four zeros syndrome

Channel Coding Theory


Slide ١٧

Frequency domain encoding of RS Code

 Example 2
 For the previous example consider three errors have occurred,
and the received sequence is 6 4 5 3 5 0 1.
 The Fourier transform is

R z    3 z 6   5 z 5   6 z 4   3 z 3   2 z 2   3 z   3

 The key equations are found to be

 3  2   3 1   2  0
 3 2   21   3  0

 Or 0 = 1, 1 = 0, and 2 = 2.

Channel Coding Theory


Slide ١٨

٩
Frequency domain encoding of RS Code

 The shift register become

 After initializing the shift register with 3 2 . The output is 2


6 5 followed by 5  which is not S0. this means that there is
an error which we cannot correct.

Channel Coding Theory


Slide ١٩

Frequency domain encoding of RS Code

 Example 3
 For the previous example consider single errors have occurred,
and the received sequence is 5 4 5 6 5 0 1.
 The Fourier transform is

R z    6 z 6   3 z 5   5 z 4   6 z 3   1 z 2   3 z   5

 The key equations are found to be

 5  2   3 1   1  0
 3 2   11   6  0

 Or 0 = 1, 1 = 5, and 2 = 0.

Channel Coding Theory


Slide ٢٠

١٠
Frequency domain encoding of RS Code

 The shift register become

 After initializing the shift register with 6 . The output is 4 2


0 followed by 5 which is the value of s0.

 The complete error sequence is 420 6 5 0 1 .

 Adding this to 5 4 5 6 5 0 1.The result is 2500000,


Channel Coding Theory
Slide ٢١

Erasure Decoding

 Reed-Solomon has the ability to recover event known as erasure

 Erasure is a symbol which is more likely to be in error

 Example
 Consider the same previous example but with one error a
position 5 and two erasures in positions 6 and 1
 The received sequence will be taken as 0 4 5 6 5 0 1.
 The Fourier transform is

R z    6 z 6   6 z 5   3 z 4   1 z 3   6 z 2   5 z   0

Channel Coding Theory


Slide ٢٢

١١
Erasure Decoding

 The lower terms of R forms the syndrome


 The erasure polynomial is

  
 z    6 z  1  1 z  1  z 2   5 z  1
 The error locator polynomial is
 z   1 z  1

 and the product is


   
 z z   1 z 3   0   5 1 z 2   5  1 z  1

 By convolution with the syndrome polynomial


 0 1   5   3 1   4   6 1   1  0

Channel Coding Theory


Slide ٢٣

Erasure Decoding

 Which means that 1 = 5. which leads to


 z  z    5 z 3   1 z 2  1

 The following circuit can be used for recursive extension

Channel Coding Theory


Slide ٢٤

١٢
Erasure Decoding

 Loading with values 5 6 1 and shifting gives the sequence 1 1


0 and then regenerating the syndrome 0 5 6. The decoding is
successful.

 The terms 0 1 1 are added to component 6 6 3 from the


Fourier transform of the received sequence yo give the
recovered information 2 5 0

 If we choose Forney algorithm to correct errors in time domain

z   S z z  z  mod z 4   5 z 2   5 z   0

 We need also the formal derivative of (z)(z) which is 5 z2

Channel Coding Theory


Slide ٢٥

Erasure Decoding

 Therefore at position i the error value is


 5z2   5z   0
ei  z  i
 5 z3

 Evaluating this at -6 and -1 which are the roots of (z) and -5
which is root of (z) and found by Chien search. The results are
e1   0 , e5   5 , e6   5

 The received sequence then is 5056501, corresponding to


the original codeword.

Channel Coding Theory


Slide ٢٦

١٣
Welch-Berlekamp Algorithm

 Consider the previous double error –correction examples we


transmit a codeword from a (7,3) RS code with roots 3,2 , 1 ,
and 0.

 To start with, we need to calculate some values needed as input


for the algorithm

n  k 1
gX 
 gx i i     
 X  0 X 1 X  2  X 3  5 X 2  6 X  3
j 0 X   nk 1
 Therefore g3 = 3 , g2= 3 , g1= 3, and g0 = 3

 For error value calculation, we compute

   
C   0 1  nk 1  0   1  0   2   0   nk 1 
Channel Coding Theory
Slide ٢٧

Welch-Berlekamp Algorithm

 For our example C = 6. we now need for each data location to
find the value hi = C /g(i) . The values are found to be
h6   6 /  4   2
h5   6 /  1   5
h6   6 /  0   6

 Assume now we receive 5453501,. The first step is to compute


the syndrome by long division.

 This found to be s3 = 0 , s2= 2 , s1= 0, and s0 = 6

 The input to WB algorithm is the set of point (Sj, j ) where


 Sj = sj/gj
Channel Coding Theory
Slide ٢٨

١٤
Welch-Berlekamp Algorithm

 The input points are therefore (0, 3),(4, 2),(1, 1),(3, 0).
 We need to find two polynomials Q(X) and N(X) for which

   
Q  j Sj  N  j for 0  j  n  k  1

 And the length L[Q(X) ,N(X)], defined as the maximum of


deg[Q(X)] and deg[N(X)]+1 has the minimum possible value

Channel Coding Theory


Slide ٢٩

Welch-Berlekamp Algorithm

 The steps of the algorithms are now


1. Set Q0(X ) = 1, N0(X ) = 0, W0(X ) = X, V0(X ) = 1 and d = 0.
2. Evaluate D1 = Qd(d )Sd + Nd(d )
3. If D1 = 0, set Wd+1 = Wd(X+ d ), Vd+1 = Vd(X+ d ) and go to step
6. otherwise, set D2 = Wd(d )Sd + Vd(d )
4. Set Qd+1 = Qd(X+ d ), Nd+1 = Nd(X+ d ) , Wd+1 = Wd + QdD2/D1,
Vd+1 = Vd + NdD2/D1,
5. Check whether L[Wd , Vd] was less than or equal to L[Qd , Nd];
if it was then swap Qd+1 , Nd+1 with Wd+1 , Vd+1
6. increment d
7. If d < n – k, return to step 1; otherwise, Q(X) = Qd(X), N(X)=
Nd(X).

Channel Coding Theory


Slide ٣٠

١٥
Welch-Berlekamp Algorithm

 For our example

 The error locator polynomial is X2 + 2 X+ 1 which has roots 3


and 5 . The error values in the data positions are

ek  hk
 
N k
 
Q'  k

Channel Coding Theory


Slide ٣١

Welch-Berlekamp Algorithm

 Where Q’(X) is the formal derivative of Q(X). In this case Q’(X)


= 2 .
 
e5   5  5   3 /  2   5

 The received information therefore is 5 0 5.

Channel Coding Theory


Slide ٣٢

١٦

You might also like