Presentation is loading. Please wait.

Presentation is loading. Please wait.

Information and Coding Theory

Similar presentations


Presentation on theme: "Information and Coding Theory"— Presentation transcript:

1 Information and Coding Theory
Cyclic codes Juris Viksna, 2017

2 Why cyclic codes? We started with restricting our attention to linear codes: Advantages minimal distance h(C) is easy to compute if C is a linear code it is easy to specify a particular code simple enconing and (kind of :) reasonable decoding procedures Disadvantages linearity is heavy restriction, however it is not that clear whether we really could gain that much by abandoning it However, most of known "good" codes are in addition cyclic. Cyclic codes also have a simpler decoding procedures.

3 Relation with shift registers
clock signal + g0 g1 g2 g3 time R = N-K shift registers

4 Cyclic codes -definition
[Adapted from B.Cherowitzo]

5 Cyclic codes - examples
[Adapted from B.Cherowitzo]

6 Rings Actually we will be interested in rings that are even “more similar” to fields, i.e.: are commutative, have multiplicative unit “1”. A commutative ring with unity

7 Rings Why do we need rings?
It seems that a way to do encoding with a cyclic code could be encoding of polynomial m(x) as c(x) = m(x)g(x) mod (xn 1) The set of all polynomials m(x) is a ring, but not a field. Actually we will be interested in rings that are even “more similar” to fields, i.e.: are commutative, have multiplicative unit “1”. A commutative ring with unity

8 Computation within Rn Computation modulo xn – 1
Since xn º 1 (mod xn -1) we can compute f(x) mod xn -1 as follow: In f(x) replace xn by 1, xn +1 by x, xn +2 by x2, xn +3 by x3, … Identification of words with polynomials a0 a1… an -1 « a0 + a1 x + a2 x2 + … + an -1 xn -1 Multiplication by x in Rn corresponds to a single cyclic shift x (a0 + a1 x + … an -1 xn -1) = an -1 + a0 x + a1 x2 + … + an -2 xn -1

9 Ring of polynomials - example
[Adapted from B.Cherowitzo]

10 (x + 1)2 = x2 + 2x + 1 º x2 + 1 º x (mod x2 + x + 1).
Ring of polynomials The set of polynomials in Fq[x] of degree less than deg (f(x)), with addition and multiplication modulo f(x) forms a ring denoted Fq[x]/f(x). Example Calculate (x + 1)2 in F2[x] / (x2 + x + 1). It holds (x + 1)2 = x2 + 2x + 1 º x2 + 1 º x (mod x2 + x + 1). How many elements has Fq[x] / f(x)? Result | Fq[x] / f(x) | = q deg (f(x)). Example Addition and multiplication in F2[x] / (x2 + x + 1) + 1 x 1 + x 1 x 1 + x X

11 Ideals So, this a subspace of a ring that seems to satisfy the requirements of cyclic codes: 1 and 2 (and part of 3) guarantees linearity 3 in addition guarantees cyclicity

12 Ideals and cyclic codes
Rn - a ring of polynomials modulo xn 1 (assume that field GF(q) is fixed) Theorem A set of elements in Rn corresponds to cyclic code C if and only if C is an ideal in Rn. Proof Given an ideal C, linearity guarantees that C is subspace, and property 3 guarantees that all cyclic shifts of codewords also belongs to code. Similarly, if C is a code, its elements have to satisfy the definition of ideal.

13 Principal ideals [Adapted from B.Cherowitzo]

14 Principal ideals Thus, the in the ring of all polynomials any ideal
is principal - i.e. it can be defined by a single generator polynomial. [Adapted from B.Cherowitzo]

15 Principal ideals Generally the proof doesn’t change, if we consider
ring of polynomials modulo some polynomial p(x). We will be generally interested in Rn (rings modulo xn 1). Every cyclic code thus can be defined by providing a single generator polynomial g(x). [Adapted from B.Cherowitzo]

16 Generators of ideals - example
[Adapted from B.Cherowitzo]

17 Cyclic codes - some more definitions

18 Cyclic codes - some examples
The code with the generator matrix has codewords c1 = c2 = c3 = c1 + c2 = c1 + c3 = c2 + c3 = c1 + c2 + c3 = and it is cyclic because the right shifts have the following impacts c1 ® c2, c2 ® c3, c3 ® c1 + c3 c1 + c2 ® c2 + c3, c1 + c3 ® c1 + c2 + c3, c2 + c3 ® c1 c1 + c2 + c3 ® c1 + c2

19 Cyclic codes - some examples
(i) Code C = {000, 101, 011, 110} is cyclic. (ii) Hamming code Ham(3, 2): with the generator matrix is equivalent to a cyclic code. (iii) The binary linear code {0000, 1001, 0110, 1111} is not a cyclic, but it is equivalent to a cyclic code. (iv) Is Hamming code Ham(2, 3) with the generator matrix (a) cyclic? (b) equivalent to a cyclic code?

20 Cyclic codes - how frequent are they?
Comparing with linear codes, the cyclic codes are quite scarce. For, example there are linear (7,3) linear binary codes, but only two of them are cyclic. Trivial cyclic codes. For any field F and any integer n >= 3 there are always the following cyclic codes of length n over F: No-information code - code consisting of just one all-zero codeword. Repetition code - code consisting of codewords (a, a, …,a) for a Î F. Single-parity-check code - code consisting of all codewords with parity 0. No-parity code - code consisting of all codewords of length n For some cases, for example for n = 19 and F = GF(2), the above four trivial cyclic codes are the only cyclic codes.

21 Cyclic codes and generator polynomials

22 Cyclic codes and generator polynomials
We show that all cyclic codes C have the form C = áf(x)ñ for some f(x) Î Rn. Theorem Let C be a non-zero cyclic code in Rn. Then there exists unique monic polynomial g(x) of the smallest degree such that C = ág(x)ñ. g(x) is a factor of xn -1. Proof (i) Suppose g(x) and h(x) are two monic polynomials in C of the smallest degree. Then the polynomial g(x) - h(x) Î C and it has a smaller degree and a multiplication by a scalar makes out of it a monic polynomial. If g(x) ¹ h(x) we get a contradiction. (ii) Suppose a(x) Î C. Then a(x) = q(x)g(x) + r(x) (deg r(x) < deg g(x)) and r(x) = a(x) - q(x)g(x) Î C. By minimality r(x) = 0 and therefore a(x) Î ág(x)ñ.

23 Cyclic codes and generator polynomials
Thus there is 1-to-1 correspondence between cyclic codes and all distinct polynomials that divide xn 1. [Adapted from B.Cherowitzo]

24 Cyclic codes and generator polynomials
We show that all cyclic codes C have the form C = áf(x)ñ for some f(x) Î Rn. Theorem Let C be a non-zero cyclic code in Rn. Then there exists unique monic polynomial g(x) of the smallest degree such that C = ág(x)ñ g(x) is a factor of xn -1. Proof (iii) Clearly, xn –1 = q(x)g(x) + r(x) with deg r(x) < deg g(x) and therefore r(x) º -q(x)g(x) (mod xn -1) and r(x) Î C Þ r(x) = 0 Þ g(x) is a factor of xn -1.

25 How to find cyclic codes?
Theorem 2 gives a recipe to get all cyclic codes of given length n. Indeed, all we need to do is to find all factors of xn -1. Problem: Find all binary cyclic codes of length 3. Solution: Since x3 – 1 = (x + 1)(x2 + x + 1) both factors are irreducible in GF(2) we have the following generator polynomials and codes. Generator polynomials Code in R3 Code in V(3,2) 1 R3 V(3,2) x + 1 {0, 1 + x, x + x2, 1 + x2} {000, 110, 011, 101} x2 + x + 1 {0, 1 + x + x2} {000, 111} x3 – 1 ( = 0) {0} {000}

26 Example - binary cyclic codes in R7
[Adapted from B.Cherowitzo]

27 Example - ternary codes of length 3
The task is to determine all ternary codes of length 4 and generators for them. Factorization of x4 - 1 over GF(3) has the form x4 - 1 = (x - 1)(x3 + x2 + x + 1) = (x - 1)(x + 1)(x2 + 1) Therefore there are 23 = 8 divisors of x4 - 1 and each generates a cyclic code. Generator polynomial Generator matrix 1 I4 x x + 1 x2 + 1 (x - 1)(x + 1) = x2 - 1 (x - 1)(x2 + 1) = x3 - x2 + x - 1 [ ] (x + 1)(x2 + 1) [ ] x4 - 1 = 0 [ ]

28 Some factors of xn-1 All we need to do is factor xn 1. This, however, isn’t necessarily obvious how to do :)

29 Generator polynomials and matrices
The fact that multiplying some vector with G we obtain a codeword from C is a bit obvious. In addition, we need: to show that all rows of G are linearly independent to show all codewords from C can be obtained

30 Generator polynomials and matrices
[Adapted from B.Cherowitzo]

31 Check polynomials

32 Check polynomials Theorem
Let C be a cyclic code in Rn with a generator polynomial g(x) and a check polynomial h(x). Then an c(x) Î Rn is a codeword of C if c(x)h(x) º 0 - this and next congruences are modulo xn - 1. Proof Note, that g(x)h(x) = xn - 1 º 0 (i) c(x) Î C Þ c(x) = a(x)g(x) for some a(x) Î Rn Þ c(x)h(x) = a(x) g(x)h(x) º 0. º 0 (ii) c(x)h(x) º 0 c(x) = q(x)g(x) + r(x), deg r(x) < n – k = deg g(x) c(x)h(x) º 0 Þ r(x)h(x) º 0 (mod xn - 1) Since deg (r(x)h(x)) < n – k + k = n, we have r(x)h(x) = 0 in F[x] and therefore r(x) = 0 Þ c(x) = q(x)g(x) Î C.

33 Check polynomials and dual codes
[Adapted from B.Cherowitzo]

34 Check polynomials and dual codes
Since dim (áh(x)ñ) = n - k = dim (C^) we might easily be fooled to think that the check polynomial h(x) of the code C generates the dual code C^. Reality is “slightly different'': Theorem Suppose C is a cyclic [n,k]-code with the check polynomial h(x) = h0 + h1x + … + hkxk, then (i) a parity-check matrix for C is (ii) C^ is the cyclic code generated by the polynomial i.e. the reciprocal polynomial of h(x).

35 Check polynomials and dual codes
Proof A polynomial c(x) = c0 + c1x + … + cn -1xn –1 represents a code from C if c(x)h(x) = 0. For c(x)h(x) to be 0 the coefficients at xk,…, xn -1 must be zero, i.e. Therefore, any codeword c0 c1… cn -1 Î C is orthogonal to the word hk hk -1…h000…0 and to its cyclic shifts. Rows of the matrix H are therefore in C^. Moreover, since hk = 1, these row-vectors are linearly independent. Their number is n - k = dim (C^). Hence H is a generator matrix for C^, i.e. a parity-check matrix for C. In order to show that C^ is a cyclic code generated by the polynomial it is sufficient to show that is a factor of xn -1. Observe that and since h(x -1)g(x -1) = (x -1)n -1 we have that xkh(x -1)xn -kg(x -1) = xn(x –n -1) = 1 – xn and therefore is indeed a factor of xn -1.

36 Syndromes and generator matrix
[Adapted from B.Cherowitzo]

37 Syndromes and generator matrix - example
[Adapted from B.Cherowitzo]

38 Syndromes and generator matrix
[Adapted from B.Cherowitzo]

39 Syndromes and generator matrix
[Adapted from B.Cherowitzo]

40 Idempotent polynomials

41 Idempotent generators
[Adapted from B.Cherowitzo]

42 Idempotent generators - example
[Adapted from B.Cherowitzo]

43 Idempotent generators - existence
(a,b) denotes just gcd(a,b). If  is a root then xn1= xn n =(x )(xn1 +  xn  n1) If there is another root equal to , then n  n1 =  n1 = 0, and  = 0... [Adapted from B.Cherowitzo]

44 Idempotent generators – Generator matrix
[Adapted from B.Cherowitzo]

45 Idempotent generators – Generator matrix
[Adapted from V.Pless]

46 Idempotent generators - how to find?
This turns out to be quite easy, at least in GF(2) assuming that n is odd. S - set of powers of x that occur with non-zero coefficients in e(x). Notice that e2(x) = e(x) if and only if iS  2iS. Thus S is a union of cyclotomic cosets and we can just look at cyclotomic cosets and write down the coefficients of e(x).

47 Idempotent generators - how to find?
n=7, C0={0}, C1={1,2,4},C3={3,6,5}.

48 Idempotents - summary So, where are we now?
Cyclic codes can be characterized by their idenpotents as well as by their generator polynomials. Idempotents are easier to find. In particular, for GF(2m) cyclotomic cosets allow to write down idempotents immediately. Then it is already not that hard to find generator polynomials - g(x)=gcd(xn–1,e(x)). By knowing generator polynomials, we actually are already quite close to solution to factoring problem. Actually, a similar approach is used in Berlekamp's factoring algorithm.

49 Berlekamp's factoring algorithm
FYI We actually have developed a factoring algorithm for xn–1 in GF(2). There is a general algorithm for factoring p(x) in GF(q). [Adapted from


Download ppt "Information and Coding Theory"

Similar presentations


Ads by Google