Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Convolutional Codes Block Codes Vs Convolutional Codes Interleaving Turbocodes Low Density Parity Check 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 )
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
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 )}
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.
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
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
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
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 ).
Cyclic Codes
Decoding - Meggitt
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
Cyclic Codes
Decoding - Meggitt
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)
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 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
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
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
dmax
63
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 )
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
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
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
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
i S = wH = eH =
3i
= s1 s3
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 ]
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 )
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
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
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)
REED-SOLOMON codes
Introduction
= 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
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
REED-SOLOMON codes
q -ary to binary code transformation
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
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
Introduction Introduction to Block Codes Linear Block Codes Convolutive Codes Block Codes Vs Convolutive Codes Interleaving Turbocodes Low Density Parity Check Codes
86