Part III Cyclic Codes CHAPTER 3
Total Page:16
File Type:pdf, Size:1020Kb
CHAPTER 3: CYCLIC CODES, CHANNEL CODING, LIST DECODING Cyclic codes are very special linear codes. They are of large interest and importance for several reasons: Part III They posses a rich algebraic structure that can be utilized in a variety of ways. They have extremely concise specifications. Cyclic codes Their encodings can be efficiently implemented using simple machinery - shift registers. Many of the practically very important codes are cyclic. Channel codes are used to encode streams of data (bits). Some of them, as Concatenated codes and Turbo codes, reach theoretical Shannon bound concerning efficiency, and are currently used very often. List decoding is a new decoding mode capable to deal, in an approximate way, with cases of many errors, and in such a case to perform better than classical unique decoding. prof. Jozef Gruska IV054 3. Cyclic codes 2/71 IMPORTANT NOTE BASIC DEFINITION AND EXAMPLES Definition A code C is cyclic if In order to specify a non-linear binary code with 2k codewords of length n one may need (i) C is a linear code; to write down (ii) any cyclic shift of a codeword is also a codeword, i.e. whenever k a0,... an 1 C, then also an 1a0 ... an–2 C and a1a2 ... an 1a0 C. 2 − ∈ − ∈ − ∈ Example codewords of length n. (i) Code C = 000, 101, 011, 110 is cyclic. { } (ii) Hamming code Ham(3, 2): with the generator matrix In order to specify a linear binary code of the dimension k with 2k codewords of length n 1 0 0 0 0 1 1 0 1 0 0 1 0 1 it is sufficient to write down G = 20 0 1 0 1 1 03 k 60 0 0 1 1 1 17 6 7 codewords of length n. is equivalent to a cyclic code. 4 5 (iii) The binary linear code 0000, 1001, 0110, 1111 is not cyclic, but it is equivalent to { } a cyclic code. k In order to specify a binary cyclic code with 2 codewords of length n it is sufficient to (iv) Is Hamming code Ham(2, 3) with the generator matrix write down 1 0 1 1 1 0 1 1 2 » – codeword of length n. (a) cyclic? (b) or at least equivalent to a cyclic code? prof. Jozef Gruska IV054 3. Cyclic codes 3/71 prof. Jozef Gruska IV054 3. Cyclic codes 4/71 FREQUENCY of CYCLIC CODES AN EXAMPLE of a CYCLIC CODE Is the code with the following generator matrix cyclic? 1 0 1 1 1 0 0 Comparing with linear codes, cyclic codes are quite scarce. For example, there are 11 811 G = 0 1 0 1 1 1 0 2 3 linear [7,3] binary codes, but only two of them are cyclic. 0 0 1 0 1 1 1 4 5 Trivial cyclic codes. For any field F and any integer n 3 there are always the following ≥ cyclic codes of length n over F : It is. It has, in addition to the codeword 0000000, the following codewords No-information code - code consisting of just one all-zero codeword. c2 = 0101110 Repetition code - code consisting of all codewords (a, a, . ,a) for a F . c1 = 1011100 c3 = 0010111 ∈ c1 + c3 = 1001011 Single-parity-check code - code consisting of all codewords with parity 0. c1 + c2 = 1110010 c2 + c3 = 0111001 c1 + c2 + c3 = 1100101 No-parity code - code consisting of all codewords of length n and it is cyclic because the right shifts have the following impacts For some cases, for example for n = 19 and F = GF (2), the above four trivial cyclic codes are the only cyclic codes. c2 c3, c1 c2, → c3 c1 + c3 → c1 + c3 c1 + c2 + c3, → c1 + c2 c2 + c3, → c2 + c3 c1 → c1 + c2 + c3 c1 + c2 → → prof. Jozef Gruska IV054 3. Cyclic codes 5/71 prof. Jozef Gruska IV054 3. Cyclic codes 6/71 POLYNOMIALS over GF(q) NOTICE A codeword of a cyclic code is usually denoted a0a1 ... an 1 − and to each such a codeword the polynomial A code C of the words of length n 2 n 1 a0 + a1x + a2x + ... + an 1x − − will be associated – am ingenious idea!!. is a set of codewords of length n NOTATION: F [x] will denote the set of all polynomials f (x) over GF (q). q a0a1a2 ... an 1 deg(f (x)) = the largest m such that x m has a non-zero coefficient in f (x). − Multiplication of polynomials If f (x), g(x) FQ[x], then ∈ deg(f (x)g(x)) = deg(f (x)) + deg(g(x)). or C can be seen as Division of polynomials For every pair of polynomials a(x), b(x) = 0 in Fq[x] there exists 6 a unique pair of polynomials q(x), r(x) in F [x] such that a set of polynomials of the degree (at most) n 1 q − a(x) = q(x)b(x) + r(x), deg(r(x)) < deg(b(x)). 2 n 1 Example Divide x 3 + x + 1 by x 2 + x + 1 in F [x]. a0 + a1x + a2x + ... + an 1x − 2 − Definition Let f (x) be a fixed polynomial in Fq[x]. Two polynomials g(x), h(x) are said to be congruent modulo f (x), notation g(x) h(x) (mod f (x)), ≡ if g(x) h(x) is divisible by f (x). − prof. Jozef Gruska IV054 3. Cyclic codes 7/71 prof. Jozef Gruska IV054 3. Cyclic codes 8/71 RINGS of POLYNOMIALS FIELD R , R = F [x]/(xn 1) n n q − For any polynomial f (x), the set of all polynomials in Fq[x] of degree less than deg(f (x)), with addition and multiplication modulo f (x), forms a ring denoted F [x]/f (x). q n n Computation modulo x 1 in the field Rn = Fq[x]/(x 1) 2 2 Example Calculate (x + 1) in F2[x]/(x + x + 1). It holds − − Since x n 1 (mod (x n 1)) we can compute f (x) mod (x n 1) by replacing, in f (x), 2 2 2 2 ≡ − − (x + 1) = x + 2x + 1 x + 1 x (mod x + x + 1). x nby1, x n+1 by x, x n+2 by x 2, x n+3 by x 3,... ≡ ≡ How many elements has Fq[x]/f (x)? Replacement of a word deg(f (x)) Result Fq[x]/f (x) = q . w = a0a1 ... an 1 | | − Example Addition and multiplication tables for F [x]/(x 2 + x + 1) 2 by a polynomial + 0 1 x 1+x 0 1 x 1+x n 1 • p(w) = a0 + a1x + ... + an 1x − 0 0 1 x 1+x 0 0 0 0 0 − 1 1 0 1+x x 1 0 1 x 1+x x x 1+x 0 1 x 0 x 1+x 1 is of large importance because 1+x 1+x x 1 0 1+x 0 1+x 1 x Definition A polynomial f (x) in Fq[x] is said to be reducible if f (x) = a(x)b(x), where multiplication of p(w) by x in Rn corresponds to a single cyclic shift of w a(x), b(x) Fq[x] and ∈ n 1 2 n 1 x(a0 + a1x + ... an 1x − ) = an 1 + a0x + a1x + ... + an 2x − deg(a(x)) < deg(f (x)), deg(b(x)) < deg(f (x)). − − − If f (x) is not reducible, then it is said to be irreducible in Fq[x]. Theorem The ring Fq[x]/f (x) is a field if f (x) is irreducible in Fq[x]. prof. Jozef Gruska IV054 3. Cyclic codes 9/71 prof. Jozef Gruska IV054 3. Cyclic codes 10/71 An ALGEBRAIC CHARACTERIZATION of CYCLIC CODES CONSTRUCTION of CYCLIC CODES Notation For any f (x) Rn, we can define ∈ Theorem A binary code C of words of length n is cyclic if and only if it satisfies two f (x) = r(x)f (x) r(x) Rn conditions h i { | ∈ } (with multiplication modulo x n 1) to be a set of polynomials - a code. (i) a(x), b(x) C a(x) + b(x) C − ∈ ⇒ ∈ Theorem For any f (x) Rn, the set f (x) is a cyclic code (generated by f ). (ii) a(x) C, r(x) Rn r(x)a(x) C ∈ h i ∈ ∈ ⇒ ∈ Proof We check conditions (i) and (ii) of the previous theorem. Proof (i) If a(x)f (x) f (x) and also b(x)f (x) f (x) , then ∈ h i ∈ h i (1) Let C be a cyclic code. C is linear ⇒ a(x)f (x) + b(x)f (x) = (a(x) + b(x))f (x) f (x) (i) holds. ∈ h i (ii) If a(x)f (x) f (x) , r(x) Rn, then (ii) ∈ h i ∈ n 1 r(x)(a(x)f (x)) = (r(x)a(x))f (x) f (x) If a(x) C, r(x) = r0 + r1x + ... + rn 1x − then ∈ h i ∈ − 2 n 1 Example let C = 1 + x , n = 3, q = 2. r(x)a(x) = r0a(x) + r1xa(x) + ... + rn 1x − a(x) h i 2 − In order to determine C we have to compute r(x)(1 + x ) for all r(x) R3. is in C by (i) because summands are cyclic shifts of a(x). ∈ 2 2 2 2 R3 = 0, 1, x, 1 + x, x , 1 + x , x + x , 1 + x + x . (2) Let (i) and (ii) hold { } Taking r(x) to be a scalar the conditions (i) and (ii) imply linearity of C. Result Taking r(x) = x the conditions (i) and (ii) imply cyclicity of C.