Cyclic Linear Codes

Cyclic Linear Codes
OUTLINE

[1] Polynomials and words

[2] Introduction to cyclic codes

[3] Generating and parity check matrices for cyclic codes

[4] Finding cyclic codes

[5] Dual cyclic codes
p2.
Cyclic Linear Codes

[1] Polynomials and words

1. Polynomial of degree n over K
K [x ]  {a0  a1x  a2x 2  a3x 3  ....  an x n }
a0 ,...., an  K , deg(f (x ))  n

2. Eg 4.1.1
Let f (x )  1  x  x 3  x 4 g (x )  x  x 2  x 3 h (x )  1  x 2  x 4 then
(a ) f (x )  g (x )  1  x 2  x 4
(b ) f (x )  h (x )  x  x 2  x 3
(c ) f (x )g (x )  (x  x 2  x 3 )  x (x  x 2  x 3 )  x 3 (x  x 2  x 3 ) 
x 4 (x  x 2  x 3 )  x  x 7
p3.
Cyclic Linear Codes

3. [Algorithm 4.1.8]Division algorithm
Let f ( x ) and h ( x ) be in K [x ] with h (x )  0. Then there exist
unique polynomial q (x ) and r (x ) in K [x ] such that
f (x )  q (x )h (x )  r (x ),
with r ( x )  0 or deg(r ( x ))  deg(h ( x ))

4. Eg. 4.1.9
f (x )  x  x 2  x 6  x 8 , h (x )  1  x  x 2  x 4
q (x )  x 3  x 4 , r (x )  x  x 2  x 3
f ( X )  h (x )(x 3  x 4 )  (x  x 2  x 3 )
deg(r ( x ))  deg(h ( x ))  4
p4.
Cyclic Linear Codes

5. Code represented by a set of polynomials

A code C of length n can be represented as a set of
polynomials over K of degree at most n-1



f (x )  a 0  a1x  a2x 2  ....  an 1x n 1 over K
c  a0a1a2...an 1 of length n in K n
6. E.g 4.1.12
Codeword c
0000
1010
0101
1111
Polynomial c(x)
0
1+x2
x+x3
1+x+x2+x3
p5.
Cyclic Linear Codes

7. f(x) and p(x) are equivalent modulo h(x)
f (x ) mod h (x )  r (x )  p (x ) mod h (x )
ie .
f (x )  p (x )(mod h (x ))

8.Eg 4.1.15
f (x )  1  x 4  x 9  x 11 , h (x )  1  x 5 , p (x )  1  x 6
f (x )mod h (x )  r (x )  1  x  p (x )mod h (x )
=>f(x) and p(x) are equivalent mod h(x)!!

9. Eg 4.1.16
f (x )  1  x 2  x 6  x 9  x 11 , h (x )  1  x 2  x 5 , p (x )  x 2  x 8
f (x )mod h (x )  x  x 4 , p (x )mod h (x )  1  x 3
=>f(x) and p(x) are NOT equivalent mod h(x)!!
p6.
Cyclic Linear Codes

10. Lemma 4.1.17
If f ( x )  g ( x )(mod h ( x )), then
f ( x )  p (x )  g (x )  p (x )(mod h ( x ))
and
f ( x ) p (x )  g (x )p (x )(mod h ( x ))

11. Eg. 4.1.18
f (x )  1  x  x 7 , g (x )  1  x  x 2 , h (x )  1  x 5 , p (x )  1  x 6
so f (x )  g ( x )(mod h ( x )), then
f (x )  p (x ) and g ( x )  p ( x ) :
((1  x  x 7 )  (1  x 6 )) mod h ( x )  x 2  ((1  x  x 2 )  (1  x 6 )) mod h ( x )
f (x )p (x ) and g ( x ) p ( x ) :
((1  x  x 7 )(1  x 6 )) mod h ( x )  1  x 3  ((1  x  x 2 )(1  x 6 )) mod h ( x )
p7.
Cyclic Linear Codes

[2]Introduction to cyclic codes


1. cyclic shift π(v)
 V: 010110,
 (v ): 001011
v
10110
111000
0000
 (v )
1011
01011
011100
0000
1101
2.cyclic code



A code C is cyclic code(or linear cyclic code) if (1)the cyclic shift of
each codeword is also a codeword and (2) C is a linear code
C1=(000, 110, 101, 011} is a cyclic code
C2={000, 100, 011, 111} is NOT a cyclic code

V=100,  (v ) =010 is not in C2
p8.
Cyclic Linear Codes

3. Cyclic shiftπis a linear transformation

Lemma 4.2.3  (v  w )   (v )   (w ),
and  (av )  a  (v ), a  K  {0,1}
Thus to show a linear code C is cyclic
it is enough to show that  (v )  C
for each word v in a basis for C

S={v, π(v), π2(v), …, π n-1(v)}, and C=<S>,
then v is a generator of the linear cyclic code C
p9.
Cyclic Linear Codes

4. Cyclic Code in terms of polynomial
v   (v ), v (x )  xv (x )
Eg 4.2.11 v=1101000, n=7, v(x)=1+x+x 3
word
polynimial(mod 1+x 7 )
-----------
-----------------------------
0110100
xv ( x )  x  x 2  x 4
0011010
x 2v ( x )  x 2  x 3  x 4
0001101
x 3v ( x )  x 3  x 4  x 6
1000110
x 4v ( x )  x 4  x 5  x 7  1  x 4  x 5 mod(1  x 7 )
0100011
x 5v ( x )  x 5  x 6  x 8  x  x 5  x 6 mod(1  x 7 )
1010001
x 6v ( x )  x 6  x 7  x 9  1  x 2  x 6 mod(1  x 7 )
p10.
Cyclic Linear Codes


5. Lemma 4.2.12
Let C be a cyclic code let v in C. Then for any polynomial a(x),
c(x)=a(x)v(x)mod(1+xn) is a codeword in C
6. Theorem 4.2.13
C: a cyclic code of length n,
g(x): the generator polynomial, which is the unique nonzero
polynomial of minimum degree in C.
degree(g(x)) : n-k,



1. C has dimension k
2. g(x), xg(x), x2g(x), …., xk-1g(x) are a basis for C
3. If c(x) in C, c(x)=a(x)g(x) for some polynomial a(x)
with degree(a(x))<k
p11.
Cyclic Linear Codes

7. Eg 4.2.16
the smallest linear cyclic code C of length 6 containing
g(x)=1+x3 <-> 100100 is
{000000, 100100, 010010, 001001, 110110,
101101, 011011, 111111}

8. Theorem 4.2.17
g(x) is the generator polynomial for a linear cyclic code of
length n if only if g(x) divides 1+xn (so 1+xn =g(x)h(x)).
p12.
Cyclic Linear Codes

9. Corollary 4.2.18
The generator polynomial g(x) for the smallest cyclic code
of length n containing the word v(polynomial v(x)) is
g(x)=gcd(v(x), 1+xn)

10. Eg 4.2.19
n=8, v=11011000 so v(x)=1+x+x3+x4
g(x)=gcd(1+x+x3+x4 , 1+x8)=1+x2
Thus g(x)=1+x2 is the smallest cyclic linear code containing
v(x), which has dimension of 6.
p13.
Cyclic Linear Codes

[3]. Generating and parity check matrices for
cyclic code

1. Effective to find a generating matrix

The simplest generator matrices (Theorem 4.2.13)
 g (x )

 xg ( x ) 
 , n: length of codes, k=n-deg(g(x))
G 
 :

 k-1

x
g
(
x
)


p14.
Cyclic Linear Codes
2. Eg 4.3.2

C: the linear cyclic codes of length n=7 with generator
polynomial g(x)=1+x+x3, and deg(g(x))=3, => k = 4
g (x )  1  x  x 3
xg ( x )  x  x 2  x 4
x 2g (x )  x 2  x 3  x 5
x 3g (x )  x 3  x 4  x 6

1101000 
 0110100

G= 
 0011010


0001101


p15.
Cyclic Linear Codes
3. Efficient encoding for cyclic codes
Let C be a cyclic code of length n and dimension k
(so the generator polynomial g(x) has degree n - k).
message polynomial a ( x )  a0  a1 x    ak 1 x k 1
( representi ng source message ( a0 , a1 ,, ak 1 ))
Encoding algorithm : c(x)  a (x) g (x)
more time efficient compared with that of
a general linear code ( c  aG )
p16.
Cyclic Linear Codes

4. Parity check matrix


H : wH=0 if only if w is a codeword
Symdrome polynomial s(x)

c(x): a codeword, e(x):error polynomial, and w(x)=c(x)+e(x)

s(x) = w(x) mod g(x) = e(x) mod g(x), because c(x)=a(x)g(x)

H: i-th row ri is the word of length n-k
=> ri(x)=xi mod g(x)

wH = (c+e)H => c(x) mod g(x) + e(x) mod g(x) = s(x)
p17.
Cyclic Linear Codes

5. Eg 4.3.7

n=7, g(x)=1+x+x3, n-k = 3
r0 (x )  1mod g (x )  1
r1 (x )  x mod g (x )  x
r2 (x )  x mod g (x )  x
2
   100
   010
2
   001
r3 (x )  x 3 mod g (x )  1  x
   110
r 4 (x )  x 4 mod g (x )  x  x 2
   011
r5 (x )  x 5 mod g (x )  1  x  x 2
   111
r6 (x )  x 6 mod g (x )  1  x 2
   101

100 
 010 


 001 


H  110 
 011 


111


101 
p18.
Cyclic Linear Codes

[4]. Finding cyclic codes

1. To construct a linear cyclic code of length n

Find a factor g(x) of 1+xn, deg(g(x)) = n-k

Irreducible polynomials



f(x) in K[x], deg(f(x)) >= 1
There are no a(x), b(x) such that f(x)=a(x)b(x),
deg(a(x))>=1, deg(b(x))>=1
For n <= 31, the factorization of 1+xn
(see Appendix B)

Improper cyclic codes: Kn and {0}
p19.
Cyclic Linear Codes

2. Theorem 4.4.3
s 2r
if n=2 s then 1+x  (1  x )
r

n
3. Coro 4.4.4
Let n  2 r s, where s is odd and let 1  x s be
the product of z irreducibl e polynomial s.
Then there are (2 r  1) z  2 proper linear
cyclic codes of length n.
p20.
Cyclic Linear Codes

4. Idempotent polynomials I(x)

I(x) = I(x)2 mod (1+xn) for odd n

Find a “basic” set of I(x)
Ci= { s=2j i (mod n) | j=0, 1, …, r}
where 1 = 2r mod n
k
I (x )   ai c i (x ), ai  {0,1}
i 0
where ci ( x)   x j
jCi
p21.
Cyclic Linear Codes

5. Eg 4.4.12
For n=7,
C 0  {0}, so c 0 ( x )  x 0  1
C1  {1, 2, 4} = C 2  C 4 , so c1 ( x )  x 1  x 2  x 4
C 3  {3, 5, 6} = C 5 = C 7 , so c 2 ( x )  x 3  x 6  x 5

I(x)=a0c 0 ( x )  a1c1 ( x )  a3c 3 ( x ), ai  {0,1},
I(x)  0

6. Theorem 4.4.13
Every cyclic code contains a unique idempotent
polynomial which generates the code.(?)
p22.
Cyclic Linear Codes

7. Eg. 4.4.14 find all cyclic codes of length 9
C 0  {0}, C1  {1,2, 4, 8,7,5}, C3  {3, 6}

==>
c 0 (x )  1, c1 ( x )  x  x 2  x 4  x 5  x 7  x 8 , c 3 (x )  x 3  x 6
I(x)=a0c 0 ( x )  a1c1 ( x )  a3c 3 ( x )
Idempotent polynomial
I(x)
1
The generator polynomial
g(x)=gcd(I(x), 1+x9)
1
x+x2+x4+x5+x7+x8
x3+x6
1+x+x3+x4+x6+x7
1+x3
1+x+x2+x4+x5+x7+x8
1+x+x2
:
:
p23.
Cyclic Linear Codes

[5].Dual cyclic codes

1. The dual code of a cyclic code is also cyclic

2. Lemma 4.5.1
a > a(x), b > b(x) and b’ > b’(x)=xnb(x-1) mod 1+xn
then
a(x)b(x) mod 1+xn = 0 iff πk(a).b’=0
for k=0,1,…n-1

3. Theorem 4.5.2
C: a linear code, length n, dimension k with generator g(x)
If 1+xn = g(x)h(x) then
C⊥: a linear code , dimension n-k with generator xkh(x-1)
p24.
Cyclic Linear Codes

4. Eg. 4.5.3
g(x)=1+x+x3, n=7, k=7-3=4
h(x)=1+x+x2+x4
h(x)generator for C⊥ is
g⊥ (x)=x4h(x-1)=x4(1+x-1+x-2+x-4 )=1+x2+x3+x4

5. Eg. 4.5.4
g(x)=1+x+x2, n=6, k=6-2=4
h(x)=1+x+x3+x4
h(x)generator for C⊥ is g⊥ (x)=x4h(x-1)=1+x+x3+x4
p25.