chapter 4 cyclic block codes -...

19
١ ١ Chapter Chapter 4 Cyclic Block Cyclic Block Codes Codes Ammar Abu-Hudrouss Islamic University Gaza Spring 2009 Slide ٢ Channel Coding Theory Cyclic Block Codes A cyclic code is characterized as a linear block code B(n, k, d) with the additional property that for each code word All the cyclic shift versions of b is also valid code words (i.e) . All are valid codewords and of course all the linear combinations between them. 0 1 2 2 1 , , , , , g g g g g G n n 1 0 1 3 2 1 , , , , , n n n g g g g g G 2 3 1 0 1 2 , , , , , g g g g g G n n 2 1 0 4 3 2 , , , , , n n n n g g g g g G 1 2 2 1 0 1 , , , , , g g g g g G n n n

Upload: ngoanh

Post on 18-Mar-2018

244 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١

١

Chapter Chapter 44

Cyclic Block Cyclic Block Codes Codes

Ammar Abu-Hudrouss Islamic University Gaza

Spring 2009

Slide ٢Channel Coding Theory

Cyclic Block Codes

A cyclic code is characterized as a linear block code B(n, k, d) with the additional property that for each code word

All the cyclic shift versions of b is also valid code words (i.e)

.

All are valid codewords and of course all the linear combinations between them.

01221 ,,,,, gggggG nn

101321 ,,,,, nnn gggggG

23101

2 ,,,,, gggggG nn

210432 ,,,,, nnnn gggggG

122101 ,,,,, gggggG nn

n

Page 2: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٢

Slide ٣Channel Coding Theory

Cyclic Block Codes

Example if we define a generator codeword as G = 0001011 then all the possible cyclic codewords are

1. All zeros 000000 14. C(5) 01001112. G 0001011 15. C(6) 10011103. G(1) 0010110 16. D =G+C(2) 11111114. G(2) 01011005. G(3) 10110006. G(4) 01100017. G(5) 11000108. G(6) 10001019. C =G + G(1) 001110110. C(1) 011101011. C(2) 111010012. C(3) 110100113. C(4) 1010011

Slide ٤Channel Coding Theory

Encoding by convolution

This property can be formulated by using polynomial. Assume we can represent the code word G as following

For our Example G = 0001011 or

If we take the generator polynomials and its first k -1 left shift, we find that we have k linearly independent sequence.

These can form the generator matrix for the cyclic code, then

21)( XXXg

1101000011010000110100001101

G

11

22

2210)(

nn

nn XgXgXgXggXg

Page 3: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٣

Slide ٥Channel Coding Theory

Encoding by convolution

Going back to the general notations

So that

knggg

ggg

gggggg

G

kn

kn

kn

10

10

0

10

00000000000000

00000000000

1

knkn

knkn XbXgXgXggXg

11

2210)(

Slide ٦Channel Coding Theory

Encoding by convolution

Then the generator matrix can be written as

assume the information bits are given by

Then

)(

)(1

XgXXg

XgX

G

k

XgXiXgXiXXgiXgiIGb kk

11

2210

01221 ,,,,, iiiiiI kk

Page 4: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٤

Slide ٧Channel Coding Theory

Encoding by convolution

But as information vector i can be written as polynomial also

Then

Or

This forms non-systematic way for cyclic coding. But it proves that c(X) divides g(X) and g(X) is of order (n -k )

11

22

2210)(

kk

kk XiXiXiXiiXi

XgXiXc )(

XgXiXiXiic kk

11

2210

Slide ٨Channel Coding Theory

Cyclic Block Codes

The cyclic property can be formulated by using polynomial representation,

If we cycle shift g by one bit. This generates

But as

Or

11

22

2210)(

nn

nn XcXcXcXccXc

12

23

2101

1 )(

n

nn

nn XcXcXcXccXc

nn

nn

nn XcXcXcXcXcXiX 1

12

23

210)(.

XcXcXXc nn

11 1.)(

1111

22

32

10)(.

nnn

nn

nn

n ccXcXcXcXcXcXiX

1mod)(1 nXXXcXc

Page 5: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٥

Slide ٩Channel Coding Theory

Cyclic Block Codes By extension we can write

Example if c = 1101 by using previous equaton find c (3)

Then

i (3) is given by 1110

1mod)( nmm XXcXXc

321)( XXXc 6533 )( XXXXcX

XXXXXcXXc 23433 1mod)(

Slide ١٠Channel Coding Theory

Cyclic Block Codes

But as generator polynomial is valid code word

Or

But as g (X ) = i (X )g (X ). This leads

Which proves that the generator polynomial g (X ) should be a factor of X n + 1

XXgXgX n 11

XgXgXXg nn

11 1.)(

XXgXgXiX n 1 XgXXiX n 1

Page 6: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٦

Slide ١١Channel Coding Theory

Generator Polynomial

The generator sequence/polynomial for cyclic code must have the following properties

1) Generator polynomial is a factor of Xn + 12) Degree of the generator polynomial is n – k

So if we know the generator polynomial we can find 1) Number of the parity bits which is the order of g(X)2) The code length which can be calculated from minimum value of

n; where Xn + 1 divides g(X).

For our example n – k = 3, X 7 + 1 divides g(X) then n = 7;

Slide ١٢Channel Coding Theory

Systematic block code

In systematic encoding the message is part from the code Or

In polynomial format

Or

But as c (X ) divides g (X ) and p (X ) of order n – k -1 then

0110121 ,,,,,,,, pppiiiiC knkk

11

110

1110

n

kknknkn

kn XiXiXiXpXppXc

XiXXpXc kn )(

)(mod xgXiXXp kn

)(XpXcXiX kn

Page 7: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٧

Slide ١٣Channel Coding Theory

Example:The (7,4) Hamming code is defined by the generator polynomial

Encode the following message i = 1001

The nonsystematic encoding will lead to

While the systematic coding will give

Systematic block code

31)( XXXg

31)( XXi

641)( XXXXiXgXc

643

mod)(XXXX

XiXXgXiXXb knkn

Slide ١٤Channel Coding Theory

Time Domain Encoding

Another method of doing long division is by using shift register as shown

+

g1

+ +

g2gn-k-1

+

Xn-ku(X)

Page 8: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٨

Slide ١٥Channel Coding Theory

Example:For our example

To see how this circuit work let us consider the encoding of u = 0110

We start the shift register by initial value of 000The remainder is content of the shift register when the final bit is

shifted

Long Division using Shift Register

+ +Xn-ku(X)

Slide ١٦Channel Coding Theory

The following table gives the shift register after each shift

The codeword is 0110001

Long Division using Shift Register

Register ContentInput 000-0000001101111100111010100010

Page 9: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

٩

Slide ١٧Channel Coding Theory

A possible criticism of the circuit of previous circuit is that after the information has been entered a further n - k shifts are required before the syndrome is formed.

This can be overcome by the following configuration

Long Division using Shift Register

+

U(X)

+

Slide ١٨Channel Coding Theory

The following table gives the shift register after each shift

The codeword is 0110001

Long Division using Shift Register

Register ContentInput 000-0000011110110010

Page 10: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٠

Slide ١٩Channel Coding Theory

It is fairly easy to show that if we divide an error sequence by the generator and take the remainder, the result is the syndrome.

Proof

To do this, consider the received sequence r(X), as consisting of the sum of the code sequence b(X) and an error pattern e(X):

The syndrome equal the remainder resulting from dividing r(X) by g (X ), or

But as b(X) = u(X)g(X) this leads to

SYNDROME OF A CYCLIC CODE

)(XeXbXr

XsXgXqXr

XSXgXiXqXe )(

Slide ٢٠Channel Coding Theory

The same as block codes all possible syndrome can be associated to error patterns. s(X) = e(X) mod g(X)

But as

then

Which means that e(1)(X) mod g(X) equal Xs(X) mod g(X)

Which means cycle shift in the error pattern is equivalent to cyclic shift of the syndrome in the shift register.

SYNDROME OF A CYCLIC CODE

XsXgXaXe

111

nn XeXXeXe

XXsXexgXXaXe nn 11

1

Page 11: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١١

Slide ٢١Channel Coding Theory

The same as block codes all possible syndrome can be associated to error patterns. s(X) = e(X) mod g(X)

For our example this gives the following table

SYNDROME OF A CYCLIC CODE

SeError position

10110000006111010000051100010000401100010003100000010020100000010100100000010

Slide ٢٢Channel Coding Theory

But if we start from 001 and shift the register with feedback, the result is

The relation with the previous table is apparent

SYNDROME OF A CYCLIC CODE

SError position

0010010110020113110411151016

Page 12: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٢

Slide ٢٣Channel Coding Theory

Let us look at some examples of this principle in operation. Let the received sequence equal 0010011.

There are two way to solve for the syndrome 1) S(X) = R(x) mod g(X) = X2+1 or 101

The codeword corresponding to the received information 0010 iscalculated 0010110

the syndrome can then be calculated by as 110 + 011 = 101

In both cases this means the error pattern is 1000000 The original word is 1010

SYNDROME OF A CYCLIC CODE

Slide ٢٤Channel Coding Theory

If we repeat the same for 1110011.

There are two way to solve for the syndrome 1) S(X) = R(x) mod g(X) = X2+1 or 111

The codeword corresponding to the received information 1110 iscalculated 1110100 .. Or s = 111

The error pattern 0100000. If 111 is shifted in the register we get 101. which means he

error is shifted one bit to the left.

SYNDROME OF A CYCLIC CODE

Page 13: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٣

Slide ٢٥Channel Coding Theory

Double error correction can be done by the same method

If an encoder previously discussed is used to generate the syndrome for single error sequence. It gives

SYNDROME OF A CYCLIC CODE

1)( 248 XXXXXg

SyndromeError position

SyndromeError position

00000010800010111000000100900101110100001000100101110020001000011101110003001000001201100111401000000131100111051000000014100101116

00000017

Slide ٢٦Channel Coding Theory

The syndromes to look for are those resulting from an error in bit 14, either on

its own or in combination with one other bit. This gives rise to the list shown in

SYNDROME OF A CYCLIC CODE

SyndromeError position

SyndromeError position

1000001014,81001011114,01000010014,91010111014,11000100014,101101110014,21001000014,110011100014,31010000014,21110011114,41100000014,130100111014,510000000140000101114,6

1000000114,7

Page 14: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٤

Slide ٢٧Channel Coding Theory

Now suppose that the errors are in positions 12 and 5. By adding the syndromes of those single errors we get a syndrome value 11101110 as being computed by the encoder.

It is not on the syndrome list So shift once 11001011 and once again 10000001. Which in the list 14 – 2shift = 12 the error position

We therefore correct bit 12 and invert the leftmost bit of the syndrome to leave 00000001. A further seven shifts, making nine in all, will produce the pattern 10000000 indicateinganother correctable error in bit 5.

SYNDROME OF A CYCLIC CODE

Slide ٢٨Channel Coding Theory

Suppose the errors are in bits 12 and 10. The syndrome calculated by using the encoder will be 00101000.

Two shifts will bring this to 10100000. We correct bit 12 and invert the first bit of the syndrome, leaving 00100000.

Two further shifts produce the syndrome 10000000 indicating an error in bit 10.

SYNDROME OF A CYCLIC CODE

Page 15: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٥

Slide ٢٩Channel Coding Theory

Suppose we have a (n, k) cyclic code shortened to (n — i, k — i).

We receive a sequence r(X) and wish to compute the syndrome of Xjr(X), where j is the sum of i (number of bits removed) and n — k (the usual amount by which the syndrome is pre-shifted).

If s1(X) is the syndrome of r(X) and s2(X) is the syndrome of Xj, then the required syndrome is s1(X)s2(X) mod g(X).

We therefore multiply the received sequence by s2(X) mod g(X) by feeding it into the appropriate points of the shift registers.

Shorted Cyclic Code

Slide ٣٠Channel Coding Theory

Consider, for example, the (15, 11) code generated by X4 + X + 1, shortened to (12, 8). First we compute X7modg(X), which is found to be X3 + X + 1.

Now we arrange the feeding of the received sequence into the shift registers as shown, such that there is a feed into the X3, X and 1 registers.

If a sequence 100000000000 is fed into this arrangement, the syndrome is 1000.

If the first transmitted bit is in error, that fact will therefore be indicated immediately. Any other syndrome will indicate a need to shift until 1000 is obtained or the error is found to be uncorrectable

Shorted Cyclic Code

Page 16: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٦

Slide ٣١Channel Coding Theory

Example Consider (15,11) code generated by X4 + X + 1, shortened to

(12,8) First we compute X7 mod g(X) which is X3 + X + 1 Now we feedback the received sequence as shown

Shorted Cyclic Code

+ +

Received sequence

+

Slide ٣٢Channel Coding Theory

Shorted Cyclic Code

If a sequence 10000000000 is fed into the arrangement the resultant contents of the shift register are

Input Register Content

Input Register Content

- 0000 0 11011 1011 0 10010 0101 0 00010 1010 0 00100 0111 0 01000 1110 0 10000 1111

Page 17: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٧

Slide ٣٣Channel Coding Theory

EXPURGATED CYCLIC CODES

Expurgation is the conversion of information bit into parity bit and keeping the length the same.

If a cyclic code has an odd value of the minimum distance, multiplying the generator polynomial by X +1 has the effect of expurgating the code and increasing dmin by 1

For example1)( 3 XXXg

11)( 34 XXXXXg

Slide ٣٤Channel Coding Theory

EXPURGATED CYCLIC CODES

Any codeword of the new code consist of code word of the original code multiplied by X + 1. (shifted left and added to itself).

For example the sequence 100101 from the original codeword become

1000101 + 0001011 = 1001110

Page 18: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٨

Slide ٣٥Channel Coding Theory

BCH Codes

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

Cyclic Codes for Burst Error Correction

Many of

Page 19: Chapter 4 Cyclic Block Codes - site.iugaza.edu.pssite.iugaza.edu.ps/ahdrouss/files/2010/02/04_Cyclic_Block_Code21.pdf · Cyclic Block Codes A cyclic ... All are valid codewords and

١٩

Slide ٣٧Channel Coding Theory

Fire codes

Fire codes are cyclic codes that can correct single burst errors with syndrome that can be split into two components for faster decoding.

The form of the generator polynomial for Fire code which is capable of correcting burst of length up to l is

Where h (X) is irreducible polynomial of length m l which is not a factor of X 2l – 1 + 1.

I.E the order p of h (X) is not factor of 2l-1. the length of the code will be the lowest common multiple of p and 2l-1.

XhXXg l 1)( 12

Slide ٣٨Channel Coding Theory

Fire codes

An example is h (X) = X 4 + X + 1 is not a factor of X 7 +1 then

This generator polynomial generates (105,94) Fire code which can correct burst of length l or less.

11)( 47 XXXXg