Sei sulla pagina 1di 24

Linear BC

Introduction to Channel Coding

Introduction Introduction to Block Codes Linear Block Codes


Perfect Codes Golay Codes Cyclic Codes

Convolutional Codes Block Codes Vs Convolutional Codes Interleaving Turbocodes Low Density Parity Check Codes

39 Linear BC Cyclic Codes

Cyclic Codes
Introduction

Preliminaries The cyclic code theory relies on the theory of polynomials introduced in annex A. Ring Z2 (x ) polynomials dened on Z2 Ring F (x ) polynomials dened on a eld F Ring F (x )/h(x ) polynomials dened on F modulo h(x ) with a degree < the degree of h(x ) (= n)
F (x ) Rn = F (x )/h(x )

f (x ) = h(x )q (x ) r (x ) deg [r (x )] < n

40

Linear BC

Cyclic Codes

Cyclic Codes
Introduction

Remark We will consider the particular case where h(x ) = x n 1 and F = Z2 . We will note Rn the set F (x )/(x n 1) with a degree < n. In the cyclic codes theory: a word v = a0 a1 a2 . . . an1 of length n where the ai Z2 corresponds to the polynomial v (x ) = a0 a1 x a2 x 2 . . . an1 x n1
n or R every word of n binary moments an element of Z2 n

we dont write the ai = 0

41 Linear BC Cyclic Codes

Cyclic Codes
Introduction

Cyclic permutation If we multiply by x a polynomial f (x ) corresponding to a word v , the obtained polynomial xf (x ) modulo x n 1 corresponds to the word (v ) obtained by a cyclic permutation of v . v f (x ) (v ) xf (x ) modulo x n 1 Example: We consider R5 v = 00101 f (x ) = x 2 x 4 xf (x ) mod x 5 1 = x 3 x 5 mod x 5 1 = 1 x 3 (v ) = 10010 is a linear operation: n (v + w ) = (v ) + (w ) v , w Z2 n (av ) = a (v ) a Z2 and v Z2 42

Linear BC

Cyclic Codes

Cyclic Codes
Denition

Denition A linear code C is said to be cyclic if every cyclic permutation of a codeword is a codeword. C , linear is cyclic if v C : (v ) C Remark As is a linear operator, to demonstrate that a linear code C is cyclic: v {u1 , . . . , uh } a basis of C : (v ) C C cyclic To build a cyclic code, we choose a word v and we form a set S obtained after n 1 permutations: S = {v , (v ), . . . , n1 (v )}

C =< S > and S contains a basis of C


43 Linear BC

Cyclic Codes

Cyclic Codes
Generator Polynomial

Theorem If C is a cyclic code and if v C , then a(x ) R (x ) we have c (x ) = a(x )v (x ) mod x n 1 is also a codeword ( C ). Preliminaries If we consider all the non null codewords of a cyclic code, then ! codeword g for which g (x ) is of minimal degree (= n k ). Every codeword c (x ) of C can be obtained from g (x ) by multiplication with a polynomial a(x ) (of degree < k ). g (x ) is a divisor of all the codewords c (x ) of C . Denition The generator polynomial g (x ) of a cyclic code C is the unique polynomial of minimal degree of C which is non null.
44

Linear BC

Cyclic Codes

Cyclic Codes
Generator Polynomial

How to construct a basis of C? Theorem If C is a cyclic code of length n and if its generator polynomial is of length n k, then: dimension of C = k; the codewords g (x ), xg (x ), . . . , x k 1 g (x ) form a basis of C ; c (x ) C i c (x ) = a(x )g (x ) with a(x ) a polynomial of degree < k. How to nd g(x)? Theorem g (x ) is the generator polynomial of a cyclic code C i it divides 1 x n . 1 x n = g (x )h(x )
45 Linear BC Cyclic Codes

Cyclic Codes
Generator Polynomial

Corollary 1 The generator polynomial g (x ) of the cyclic code build from the n 1 cyclic permutations of a codeword v is the highest common divisor of v (x ) and 1 x n . Corollary 2 A generator matrix of a code C with g (x ) as generator polynomial is: g (x ) xg (x ) G = . . . x k 1 g (x )
46

Linear BC

Cyclic Codes

Cyclic Codes
Generator Polynomial

Remarks As the dimensions of G are (k , n), the generator matrix is written: g0 g1 gnk 00 0 0g0 g1 gnk 0 0 G = . . . 00 g0 g1 gnk To nd all the cyclic codes of length n we have to consider all the generator polynomials divisor of 1 x n , excepted g (x ) = 1 and g (x ) = 0 which generate improper codes.

47 Linear BC Cyclic Codes

Cyclic Codes
Encoding

Two encoding methods can be used Non systematic encoding u = (u0 u1 . . . uk 1 ) g (x ) xg (x ) v = u G = (u0 u1 . . . uk 1 ) . . .

v (x ) = (u0 u1 x . . . uk 1 x k 1 )g (x ) = u (x )g (x )

x k 1 g (x )

48

Linear BC

Cyclic Codes

Cyclic Codes
Encoding

Systematic encoding u = (un1 . . . unk ) u (x ) = un1 x n1 unk x nk u (x ) = q (x ) g (x ) r (x ) u (x ) r (x ) = q (x ) g (x ) = v (x ) Remarks


We transmit u (x ) r (x ) u (x ) r (x ) is a codeword because it is a multiple of g (x ) Maximum degree of r (x ) is n k 1 Minimum degree of u (x ) is n k u (x ) and r (x ) will not mix.
49 Linear BC Cyclic Codes

Cyclic Codes
Decoding - Denition

Syndrome Polynomial Denition If C is a cyclic code of length n and g (x ) is its generator polynomial, we dene the syndrome polynomial s (x ) associated to a received word w (which has w (x ) as corresponding polynomial) as the rest of the division of w (x ) by g (x ). s (x ) = w (x ) mod g (x ) Remarks If degree g (x ) = n k degree s (x ) < n k (length of s is n k ) The syndrome of a received word = the syndrome of its error conguration
v (x ) = q (x ) g (x ) w (x ) = q (x ) g (x ) e (x ) e (x ) mod g (x ) = w (x ) mod g (x ) = s (x )
50

Linear BC

Cyclic Codes

Cyclic Codes
Decoding - Method

The decoding method


1

Establish the table of all the possible error congurations e (x ) and their corresponding syndromes s (x ) Calculate the syndrome of a received word w (x ) Using the table (of step 1) nd the e (x ) corresponding to the calculated syndrome Retrieve the codeword v (x ) : v (x ) = w (x ) e (x )

2 3

51 Linear BC Cyclic Codes

Cyclic Codes
Decoding - Example

Example C Hamming code of length n = 7, correction capacity tc = 1 and with generator polynomial g (x ) = 1 x x 3 n k = 3 The received word: w = 1011001 w (x ) = 1 x 2 x 3 x 6 s (x ) = w (x ) : g (x ) = (1 x 2 x 3 x 6 ) : (1 x x 3 ) = x 1 e (x ) s (x ) 0 0 1 1 x x The table (e (x ), s (x )): x 2 x2 x3 x 1 . . . . . . x6 x2 1 We nd e (x ) = x 3 e = 0001000 v (x ) = w (x ) e (x ) v = 1010001

52

Linear BC

Cyclic Codes

Cyclic Codes
Decoding - Meggitt

Remarks: In the decoding process, the longest operations are: establishing the e (x ), s (x ) table and searching in it. Meggitt decoder reduces the size of the e (x ), s (x ) table which will only contain error congurations (and the corresponding s (x )) of degree n 1. Theorem We consider the linear cyclic code C with generator polynomial g (x ). If the syndrome polynomial of a word w is s (x ) then the syndrome polynomial of (w ) is s1 (x ) = xs (x ) mod g (x ).

53 Linear BC Cyclic Codes

Cyclic Codes
Decoding - Meggitt

The decoding method


1

2 3 4 5 6

Establish the table of all the possible error congurations e (x ) (and their corresponding syndromes s (x )) of degree n 1 Calculate the syndrome of a received word w (x ) If the syndrome is in the table apply the correction given by e (x ) If not, calculate the syndrome s1 (x ) of (w (x )) (rst permutation) If the syndrome is in the table e 1 (x ) = (e (x )) gives e (x ) If not, repeat step 4 and 5, but for s2 (x ) of 2 (w (x )) until n1

54

Linear BC

Cyclic Codes

Cyclic Codes
Decoding - Meggitt

Example We consider the code C of length n = 7, correction capacity tc = 1 and with the generator polynomial g (x ) = 1 x x 3 . The received word: w = 1011001 w (x ) = 1 x 2 x 3 x 6 The table (e (x ), s (x )) is reduced to: e (x ) x6 s (x ) x2 1

w (x ) s (x ) = w (x ) mod g (x ) = 1 x = 1 x 2

(w (x )) s1 (x ) = xs (x ) mod g (x ) = x x 2 = 1 x 2

2 (w (x )) s2 (x ) = x 2 s (x ) mod g (x ) = 1 x x 2 = 1 x 2 e 3 = 0000001 e = 0001000


55 Linear BC Cyclic Codes

3 (w (x )) s3 (x ) = x 3 s (x ) mod g (x ) = 1 x 2 in the table!

Cyclic Codes
Decoding - Meggitt

Remark Meggitt decoding is interesting when n and when tc

For example if we have n = 15 and tc = 2, the standard (e (x ), s (x )) 2 1 0 table should contain C15 + C15 + C15 = 121 lines. With the method of Meggitt, there remain only 14 lines in the table e (x ) s (x ) x 14 ... 14 x 1 ... . . . ... x 14 x 13 ...

56

Linear BC

Cyclic Codes

BCH codes
Introduction

BCH: Bose - Chaudhuri - Hocquenghame Correction capacity can be high Easy decoding Wide class of codes Binary / NON binary (see the Reed-Salomon code)

57 Linear BC Cyclic Codes

BCH codes
Example

Example We consider a primitive element of CG (24 ) build with the primitive polynomial 1 x x 4 The BCH code with tc = 2 and n = 15 is generated by the generator polynomial g (x ) = m (x )m 3 (x ) = m1 (x )m3 (x ) with mi (x ) the minimal polynomial associated to i The minimal polynomials of and 3 give g (x ): m1 (x ) = 1 x x 4 m3 (x ) = 1 x x 2 x 3 x 4 g (x ) = 1 x 4 x 6 x 7 x 8

n k = 8 k = 7 27 codewords

Linear code dmax = wt (g (x )) = 5

n given, to raise d (and tc ) k has to 2 not used because m (x ) = m 2 (x ) !


58

Linear BC

Cyclic Codes

BCH codes
The Hamming codes as cyclic codes

Introduction The Hamming codes were dened on basis of their parity verication matrix H NOT cyclic codes We introduce a new denition of equivalent cyclic codes which lead to the Hamming codes

59 Linear BC Cyclic Codes

BCH codes
The Hamming codes as cyclic codes

Denition We consider an element of order n of a CG (2m ) (n = 1). All the codewords associated to the polynomials w (x ) of order < n such that w () = 0 constitute a cyclic code. C = {w : w () = 0}
CG (2m ) Z2 g (x ) m (x ) Z2(x )

60

Theorem The code C is a cyclic code with g (x ) = m (x ) as generator polynomial.

Linear BC

Cyclic Codes

BCH codes
The Hamming codes as cyclic codes

Special case If = , is a primitive element of CG (2m ) (and of order n = 2m 1), then we get a cyclic code C= of length n = 2m 1 and the generator polynomial is g (x ) = m (x ).
CG (2m )

= Z2 g (x ) m (x ) Z2(x ) n = 2m 1

61

Theorem If is a primitive element of CG (2m ), then the code C = {w : w ( ) = 0} is a Hamming code of length n = 2m 1.
Linear BC Cyclic Codes

BCH codes
The Hamming codes as cyclic codes

Example CG (23 ) Z2 (x )/h(x ) with h(x ) = 1 x x 3 The eld contains 23 = 8 elements: 000 100 010 001 110 011 111 101 0 1 x x2 x 1 x2 x x2 x 1 x2 1 0 0 1 2 3 4 5 6

62

Linear BC

Cyclic Codes

BCH codes
The Hamming codes as cyclic codes

Example cont. h( ) = 0 and m = h(x ) = 1 x x 3


H of length n = 7 is generated by The Hamming code C g (x ) = m (x ) = 1 x x 3

The parity control matrix is:

dmax
63

100 1 010 2 001 3 H= = 110 4 011 5 111 101 6 = wt (g (x )) = 3 tc = 1


Linear BC Cyclic Codes

BCH codes
Binary BCH code with a correction capacity = 2

Introduction We will now consider the codes composed of the polynomials having and i (i > 1) as root. As m (x ) m2 (x ) 2 brings no extra constraint on the selection of the w (x ). We choose and 3

64

Linear BC

Cyclic Codes

BCH codes
Binary BCH code with a correction capacity = 2

Denition We consider an element of order n of a CG (2m ) (n = 1). The BCH code with a correction capacity tc = 2 is dened by all the codewords associated to the polynomials w (x ) of order < n having and 3 as root. C3 = {w : w () = w (3 ) = 0}
CG (2m )

Z2 3 g (x ) m (x )m3 (x ) Z2(x ) m = m2 2 not chosen

65 Linear BC Cyclic Codes

BCH codes
Binary BCH code with a correction capacity = 2

Remarks tc = 2 and n = code length The generated code is cyclic with the generator polynomial g (x ) = m (x )m3 (x ) = m1 (x )m3 (x ) where mi (x ) is the minimum polynomial of i If = , a primitive element of CG (2m ) then
n = 2m 1 H is given by:

H= m 2 2
66

0 2 . . .

0 3 6 . . . 3(2
m

2)

Linear BC

Cyclic Codes

BCH codes
Binary BCH code with a correction capacity = 2

Example We choose = from CG (24 ) Z2 (x )/h(x ) with h(x ) = 1 x x 4 n = 2m 1 = 24 1 = 15 and 15 = 1 w () = w (3 ) = 0 gives: 0 0 3 2 3 2 ( ) w0 w1 . . . w14 = 0 0 . . . . . . 14 ( 3 )14 g (x ) = m1 (x )m3 (x ) = (1 x x 4 )(1 x x 2 x 3 x 4 ) = 1 x4 x6 x7 x8 n k = deg (g (x )) = 8 k = 7 C (15, 7) As dmax = wt (g (x )) = 5 and tc = 2 dmin = 5 d = 5 and C (15, 7, 5)
Linear BC Cyclic Codes

67

BCH codes
Binary BCH code with a correction capacity = 2

Primitive - non primitive BCH codes


NON primitive BCH codes: CG (2m ) and n = 1 n, k = n 2m Primitive BCH codes (most used): = CG (2m ) n = 2m 1, k = 2m 1 2m

The denition of the BCH codes with a tc = 2 presents some uncertainty relative to the choice of the extension of the eld and to the choice of theorem. Theorem If 1 and 2 are two elements of same order n of 2 dierent extensions of 1 2 and C are equivalent. Z2 then the corresponding BCH codes C 3 3
1 1 2 2

68

Linear BC

Cyclic Codes

BCH codes
Binary BCH code with a correction capacity = 2

Remarks odd n a binary BCH code with tc = 2 and length = n (see the Euler-Fermat theorem) Example: n = 7 and p = 2 (n) = 6 CG (26 ) and 7 = 1 We can use indierently the generator polynomial or the parity verication matrix: 0 0 3 6 2 g (x ) = m (x )m3 (x ) H = . . . . . . n1 3(n1) tc = 2 dmin = 5 Design distance.
69 Linear BC Cyclic Codes

The distance of the BCH code is odd use of extended codes

BCH codes
Decoding of binary BCH codes with a correction capacity = 2

Principle We receive the word w = w0 w1 . . . wn1 w (x ) There are maximum 2 errors the errors conguration e contains maximum two 1 located in (lets say) positions i and j The syndrome S of w is known: 1 1 3 2 6 S = wH = w0 w1 . . . wn1 . . . . . . n1 3(n1) =

70

where si are m-uples

w0 w1 . . . wn1 n1 w0 w1 3 . . . wn1 3(n1) = w ( ) w ( 3 ) = s1 s3

Linear BC

Cyclic Codes

BCH codes
Decoding of binary BCH codes with a correction capacity = 2

Principle cont. Case 1: No error S = 0 and s1 = s3 = 0 Case 2: One error in (lets say) position i

e = [0 . . . 010 . . . 0] (where the 1 is in the i th position) e (x ) = x i


3 =s s1 3

i S = wH = eH =

3i

= s1 s3

Case 3: Two errors in positions i and j

e = [0 . . . 010 . . . 010 . . . 0] (where the two 1 are in the i th and j th positions) e (x ) = x i x j


71

S = wH = eH = i j

Linear BC

3i 3j = s1 s3
Cyclic Codes

BCH codes
Decoding of binary BCH codes with a correction capacity = 2

Principle cont. i j = s1 where s1 and s3 are known 3i 3j = s3 If we consider the following factorizations: 3i 3j = ( i j )( 2i i +j 2j ) 2i 2j ( i j )2 =
2 i +j ) i j = s s 1 s 2 s3 = s1 (s1 3 1 1 2 x ( i j )x i +j = 0 i j i , j i , j 1 i j 2 2 x s1 x (s3 s1 s1 ) = 0

72

Linear BC

Cyclic Codes

BCH codes
Decoding of binary BCH codes with a correction capacity = 2

Example The code C15 dened on CG (24 ) with h(x ) = 1 x x 4 Lets suppose that the received word w gives a syndrome S = s1 = 0111 s3 = 1010 ]

We get from the denition of the eld: s1 11 and s3 8


1 2 = 8 11 22 = 12 7 = 2 s3 s1 s1

We form the polynomial x 2 11 x 2 i = 4 and j = 13 e (x ) = x 4 x 13 e = [0000100000000100]


73 Linear BC

We look for the roots on CG (24 ) 4 , 13

Cyclic Codes

BCH codes
Decoding of binary BCH codes with a correction capacity = 2

Algorithm
1 2 3 4 5 6

Calculate S = s1 s3 = wH = w ( ) w ( 3 )
3 = s s = i correct position i of w If s1 3 1

If s1 = s3 , there is no error and the Rx word w is exact If s1 = 0 and s3 = 0: more than 2 errors ask retransmission
1 2) = 0 Else form the equation x 2 s1 x (s3 s1 s1

If there are two distinct roots i and j on CG (24 ) correct positions i , j of w If there are no distinct roots ask retransmission

74

Linear BC

Cyclic Codes

BCH codes
Generalization

Introduction We will now consider the generalized form of the BCH codes: Z2 Fq and tc 2 tc = t
CG (q m ) and m = (n) n = 1 Fq i
2t

g (x ) = LCM(m (x ), . . . , m2t (x )) mi Fq (x )

75 Linear BC Cyclic Codes

BCH codes
Generalization

Denition We consider a eld F of cardinality q and a number n which is prime to q . The q -ary BCH code with a correction capacity equal to t and a length n (n > 2t + 1) is dened by all the codewords associated to the polynomials w (x ) (of degree < n) F (x ) which satisfy: C = {w : w () = w (2 ) = . . . = w (2t ) = 0} where is an element of order n of an extension eld of F . If the chosen is a primitive one (n = 1), n = q m 1 primitive BCH code Fq CG (q m ) where, as example, m = (n) (Euler-Fermat)
76

Linear BC

Cyclic Codes

BCH codes
Generalization

Example 1 Fq = Z2 (binary alphabet) and tc = t = 3 The polynomials associated to the codewords satisfy: w () = w (3 ) = w (5 ) = 0 If we take = , a primitive element of CG (24 ) then the mi (x ) are: m1 (x ) = x 4 x 1 m3 (x ) = x 4 x 3 x 2 x 1 m5 (x ) = x 2 x 1

g (x ) = m1 (x )m3 (x )m5 (x ) = x 10 x 8 x 5 x 4 x 2 x 1 n = 24 1 = 15 and n k = 10 k = 5 tc = t = 3 and wt (g (x )) = 7 d = 7

Primitive binary BCH code C (15, 5, 7)


77 Linear BC

Cyclic Codes

BCH codes
Generalization

Example 2 Fq = Z3 (ternary alphabet) and tc = t = 2 The polynomials associated to the codewords have to satisfy: w () = w (3 ) = w (5 ) = 0 If we take = , a primitive element of CG (33 ) Z3 (x )/x 3 2x 2 1 then the mi (x ) are: m1 (x ) = x 3 2x 2 1 m2 (x ) = x 3 2x 2 2x 2 m4 (x ) = x 3 2x 2

degree(g (x ) = m1 (x )m2 (x )m4 (x ))= 9 Primitive BCH code C (26, 17)


78

n = 33 1 = 26 and n k = 9 k = 17

Linear BC

Cyclic Codes

BCH codes
Generalization

Generator polynomial The generator polynomial g (x ) is given by: g (x ) = LCM [m1 (x ), m2 (x ), . . . , m2t (x )] where the mi (x ) are the minimum polynomials corresponding to the i (i = 1, 2, . . . , 2t ), the element chosen to dene the code. The generator polynomials divide:
x n 1 in case of a binary code x n 1 in case of a mary code (m > 2)

79 Linear BC Cyclic Codes

REED-SOLOMON codes
Introduction

BCH codes: q -ary codes and the zeros i CG (q m )

A Reed-Solomon code is a primitive (n = q 1) BCH code As i F (q ) the minimum polynomial is (x i )


Fq

Reed-Solomon codes: q -ary codes and the zeros i = i F (q )

= i 2t

i = i mi (x ) Fq (x )

80

Linear BC

Cyclic Codes

REED-SOLOMON codes
Denition

Denition A Reed-Solomon code with a correction capacity t is a primitive q -ary BCH code which has a generator polynomial given by: g (x ) = (x )(x 2 ) . . . (x 2t ) where is a primitive element of the eld Fq dening the code alphabet. Degree of g (x ) = n k = 2t

Code dimension k = n 2t = q 1 2t

Minimal distance of the code: dmin = 2t + 1 = n k + 1

81 Linear BC Cyclic Codes

REED-SOLOMON codes
Example

We consider a eld F8 = CG (23 ) constructed using h(x ) = 1 x x 3 The 3 representations of the eld: Z2 CG (23 ) 000 0 100 1 010 x 001 x2 110 x 1 011 x2 x 111 x 2 x 1 101 x2 1
82

F8 0 0 1 2 3 4 5 6

Linear BC

Cyclic Codes

REED-SOLOMON codes
Example cont.

The Reed-Solomon code with an octal alphabet and with a capacity correction t = 1 has the generator polynomial: n k = 2 and n = 23 1 k = 5 C8 (7, 5) 85 codewords The generator matrix is g (x ) xg (x ) G = . . . 0 0 0 1 0 0 4 1 0 3 4 1 0 3 4 0 0 0 0 1 g (x ) = (x )(x 2 ) = 3 4 x x 2

83

given by: 3 4 1 0 3 4 = 0 0 3 0 0 0 k 1 x g (x ) 0 0 0 Word to code: 1 0 0 3 Coded word: 3 0 4 6 1 3


Linear BC Cyclic Codes

REED-SOLOMON codes
q -ary to binary code transformation

q -ary binary code

Reed-Solomon code C dened on the alphabet F = CG (2m ) = CG (q )


m To each alphabet element of Fq corresponds a m-uple of Z2

Example

We can generate a binary code C equivalent to the q -ary code C C8 (7, 5) : 3 0 4 6 1 3 gives

(21, 15) : ( 110 000 011 010 101 100 110 ) C2

84

Linear BC

Cyclic Codes

REED-SOLOMON codes
Packet errors

Introduction Some Tx channels produce errors packets The Reed-Solomon codes and the q -ary to binary code transformation oer a good error correction capacity against error packets Correction capacity We consider the code C with a correction capacity t , based on the eld Fq = CG (2m ) The derived binary code C oers a packet error correction capacity of (t 1)m + 1 binary elements per coded word
(21, 9) t = 2 and F8 = CG (23 ) C8 (7, 3) C2

Example

85

Packets errors correction capacity = (2 1)3 + 1 = 4 binary elements FFF F


Convolutive Codes

Introduction to Channel Coding

Introduction Introduction to Block Codes Linear Block Codes Convolutive Codes Block Codes Vs Convolutive Codes Interleaving Turbocodes Low Density Parity Check Codes

86

Potrebbero piacerti anche