23
WEIGHT ENUMERATORS OF BLOCK CODES AND THE MCWILLIAMS IDENTITIES

Weight enumerators of block codes and the mc williams

Embed Size (px)

Citation preview

Page 1: Weight  enumerators of block codes and  the mc williams

WEIGHT ENUMERATORS OF BLOCK CODES AND THE MCWILLIAMS IDENTITIES

Page 2: Weight  enumerators of block codes and  the mc williams

WEIGHT DISTRIBUTIONS OF BLOCK CODES

Weight of a code vector is number of nonzero elements.

Let Ai is number of codewords of weight l in an (n,k) linear code.

The (n+1)- dimensional vector, with components Al for l=0,…n is called weight distribution of the code.

If minimum distance dmin = d, then A0= 1, A1 …, Ad-1 are all zero.

Ad is not zero.

MacWilliams identity relates the weight distribution of a code to the weight distribution of its dual code.

Page 3: Weight  enumerators of block codes and  the mc williams

WEIGHT DISTRIBUTIONS OF BLOCK CODES

Ai is number of codewords of weight i in C , then

Weight enumerator of C is :

WC(x,y) = ∑n

i=0 Ai x

n-iyi OR

= ∑u€C

xn-wt(u)ywt(u)

x, y are indeterminate and WC(x,y) is homogeneous polynomial of degree n in x and y.

If x=1 then WC(1,y) = WC(y) = ∑n

i=0 Ai y

i

For Dual code: A’i is number of codewords of weight i in C’ , Weight enumerator of C’ is :

WC’(x,y) = ∑n

i=0 A’i xn-iyi OR

= ∑u€C’

xn-wt(u)ywt(u)

Page 4: Weight  enumerators of block codes and  the mc williams

WEIGHT DISTRIBUTIONS -EXAMPLE

EX1: C3= 000, 011, 101, 110 is even weight code.

Dual C’3= 000, 111

Weight enumerators are- For A0 =1, A1 =0, A2 =3.

WC3(x,y) = x3 + 3xy2.

WC’3(x,y) = x3 + y3. A’0 =1, A’1 = A’2 =0, A’3 =1.

Ex2: C3= 000, 111

Dual C’3= 000, 111 self dual

WC2(x,y) = x2 + y2 =WC’2

(x,y)

Ex3: (7,4,3) Hamming code—

A0 =1, A3 =7, A4 =7, A7 =1.

WC16(x,y) = x7 + 7x4y3 +7x3y4 + y7.

WC’16(x,y) = x7 + 7x3y4

Page 5: Weight  enumerators of block codes and  the mc williams

MACWILLIAM’S THEOREM FOR BINARY LINEAR CODES

WC’(x,y) is given by a linear transformation of WC(x,y).

Let Fn be set of all binary vectors of length n.

Vector space of dimension n over binary field F={0,1}.

Theorem: If C is an (n,k) binary linear code with dual C’ then,

WC’ (x,y) = (1/|C |) WC (x+y,x-y)

where |C | is 2k , number of codewords in C .

∑n

k=0 A’k x

n-kyk = (1/|C |) ∑n

i=0 Ai (x+y)n-i(x-y)i

OR

∑u€C’

xn-wt(u)ywt(u) = (1/|C |) ∑u€C

(x+y)n-wt(u)(x-y)wt(u)

True for reverse.

Page 6: Weight  enumerators of block codes and  the mc williams

MACWILLIAM’S THEOREM -EXAMPLE

EX1: C3= 000, 011, 101, 110 is even weight code.

Dual C’3= 000, 111

Weight enumerators are- For A0 =1, A1 =0, A2 =3. |C |=4 WC3

(x,y) = x3 + 3xy2.

¼ WC3(x+y,x-y) = ¼ [(x+y)3 + 3(x+y)(x-y)2

= x3 + y3=WC’3(x,y).

Reverse--A’0 =1, A’1 = A’2 =0, A’3 =1. |C’ |=2 ½ WC’3

(x+y,x-y) = ½ [(x+y)3 + (x-y)3]

=x3 + 3xy2=WC3(x,y).

Page 7: Weight  enumerators of block codes and  the mc williams

MACWILLIAM’S THEOREM -EXAMPLE

Ex2: C3= 000, 111 |C |=2 WC2

(x,y) = x2 + y2

½ [WC2(x+y,x-y)] = ½ [(x+y)2 + (x-y)2] =

= x2 + y2=WC’2(x,y)

Ex3: Verify that 1/16 WC16(x+y,x-y) = x7 + 7x3y4=WC’16

(x,y)

Page 8: Weight  enumerators of block codes and  the mc williams

MACWILLIAM’S THEOREM - Hadamard Transform: Let f be any mapping defined on Fn

allowing addition and subtraction of values f(u).

Hadamard transform f^ of f is given as :

f^(u) = ∑v€F

n(-1)

u.v f(v) u€F

n

Lemma: If C is an n,k binary linear code

∑u€C’

f(u) = (1/|C |) ∑u€C

f^ (u)

Proof: ∑u€C

f^ (u) = ∑u€C

∑v€F

n(-1)

u.v f(v)

If v belongs to C’, then u.v = 0 and inner sum = |C |

∑u€C

f^ (u) = |C | ∑v€C’

f (v)

Page 9: Weight  enumerators of block codes and  the mc williams

MACWILLIAM’S THEOREM - PROOF Let v belongs to C ’.

Let f(u) = xn-wt(u)ywt(u)

Hence f^ (u) = ∑v€F

n(-1)

u.v xn-wt(u)ywt(u)

Let u = (u1,… u

n) and v = (v

1,… v

n)

xn-wt(v) = x1-wt(v1) x1-wt(v2) x1-wt(v3)… n times

ywt(v) = ywt(v1) ywt(v2) … n times

f^ (u) = ∑v€F

n(-1)

u1.v1+ u2.v2+… un.vn Πn

i=1 x1-vi yvi

= ∑ 1

v1

=0 ∑

1

v2

=0 …∑

1

vn

=0 Π

n

i=1 (-1)

ui.vi x1-vi yvi

As aoboco+ aoboc1+ aob1co+ aoblcl+ a1b0co+ a1boc1+ a1b1co+

a1b1c1 = (a0 + a1)(bo + b1)(co + c1)

Page 10: Weight  enumerators of block codes and  the mc williams

MACWILLIAM’S THEOREM - PROOF

= Πn

i=1 ∑

1

w=0 (-1)

ui.w x1-w yw

If u

i = 0, inner sum = x + y

If ui = 1, inner sum = x - y

f^ (u) = (x+y)n-wt(u) (x-y)wt(u)

∑u€C ‘

xn-wt(u) ywt(u) = (1/|C |) ∑u€C

(x+y)n-wt(u) (x-y)wt(u)

Page 11: Weight  enumerators of block codes and  the mc williams

ERRORS IN SYMMETRIC CHANNELS Let p be error probability in a code with n=5.

Prob{e=00000} = (1-p)5.

Prob{e=01000} = p(1-p)4.

Prob{e=10010} = p2(1-p)3.

Let v is fixed vector of weight a.

Prob{e = v} =pa(1-p)n-a. (Errors=wt of v)

As p< ½ , (1-p) > p.

(1-p)5 > p (1-p)4 > p2(1-p)3…

Error vector of weight 1 is more likely than wt 2.

Decoding Strategy: Decode received y as the nearest codeword x , i.e.

Pick error vector e whose weight is least.

Called Nearest Neighbor Decoding.

Page 12: Weight  enumerators of block codes and  the mc williams

ERRORS IN SYMMETRIC CHANNELS Minimum distance of a code dmin is minimum weight of any

nonzero code.

A code with dmin= d = 2t+1 can correct t errors. t = ½ (d-1).

If d is even then it can correct ½ (d-2) and detect d/2 errors.

A sphere of radius r and center u consists of all vectors v such that dist(u,v) ≤ r.

For d=3, if a sphere of radius 1 is drawn around each codeword, the spheres do not overlap.

If single error occurs in codeword u and vector a is received,

a is inside sphere u and is closest to u.

Error is corrected. d=3

u

u

a

v

Page 13: Weight  enumerators of block codes and  the mc williams

ERRORS IN SYMMETRIC CHANNELS

If d=2t+1, spheres of radius t around each codeword do not overlap and code can correct t errors.

If d is even (4), sphere of radius ½ (d-2) around codword are disjoint.

If 2 errors occur, a is midway between 2 codewords.

Decoder can only detect d/2 errors, but can correct only 1 error.

If more than d/2 errors occur, word is closer to other codeword.

Decoding error occurs.

d=4

u

u

a

v

Page 14: Weight  enumerators of block codes and  the mc williams

COSET Definition: Let C be an (n,k) linear code over a field with q

elements. For any vector a, the set,

a + C = { a+x : x ∈C }is called a COSET of C.

a and b can be in same coset if and only if (a-b) ∈ C.

Each coset contains qk vectors.

Coset Leader : The minimum weight vector in a coset is called coset leader.

Page 15: Weight  enumerators of block codes and  the mc williams

COSET – EXAMPLE 1 (4,2) linear hamming code with

G = 1 0 1 1

0 1 0 1

Standard Array—

Message: 00 10 01 11

Code : 0000 1011 0101 1110

Coset : 1000 0011 1101 0110

Coset : 0100 1111 0001 1010

Coset : 0010 1001 0111 1100

Coset Leader

Page 16: Weight  enumerators of block codes and  the mc williams

COSET - EXAMPLE Detection:

Let transmitted data/code is 10/1011

Let received code – 1111

Search in which row 1111 belongs – row 3

Coset of row 3 – 0100

1111 + 0100 = 1011

Decoded to 10

Page 17: Weight  enumerators of block codes and  the mc williams

COSET – EXAMPLE 2 (5,2) linear code with

G = 1 0 1 0 1

0 1 1 1 0

Find 4 codewords and cosets.

00000 10101 01110 11011 Code

00001 10100 01111 11010

00010 10111 01100 11001

00100 10001 01010 11111

01000 11101 00110 10011

10000 00101 11110 01011

11000 01101 10110 00011

10010 00111 11100 01001

When the vectors of V[n,q] are arranged by cosets in this way it is called a standard array for the code.

Page 18: Weight  enumerators of block codes and  the mc williams

ERROR PROBABILITY Decoding is correct if and only if true error vector is a coset

leader.

The probability of error or word error rate Perr for a particular decoding scheme is the probability that the decoder output is the wrong codeword.

If there are M codewords, x(1) …x(M) with equal probability-

Perr = (1/M) ∑M

i=1 Prob { decoder output ≠ x(i) | x(i) was sent.}

Using standard array, decoding error occurs iff error word is not a coset leader.

Perr = Prob { e ≠ coset leader.}

Let there are αi coset leaders of weight i, then

Perr = 1 - ∑n

i=0 αi p

i (1 – p)n-i

Page 19: Weight  enumerators of block codes and  the mc williams

ERROR PROBABILITY -EXAMPLE Previous Ex 1

α0 =1 , α1 =3 , n =4

Perr = 1 - (1 – p)4 - 3p (1 – p)3

If p=0.01, Perr = 0.0103

Find Perr for Ex2 .

Page 20: Weight  enumerators of block codes and  the mc williams

PERFECT CODE If the code has minimum distance d=2t+1 or 2t+2, it can

correct t errors.

So every error vector of weight ≤ t is a coset leader.

αi = nCi for 0 ≤ i≤t.

But for i>t, αi are extremely difficult to calculate.

Perr = 1 - ∑t

i=0 nCi p

i (1 – p)n-i

If αi =0 for i > t = ½ (d-1) then it is called Perfect code.

A perfect t-error correcting code can correct all errors of weight ≤ t and none of weight > t.

Spheres of radius t around the codeword are disjoint and together contain all vectors of length n.

Page 21: Weight  enumerators of block codes and  the mc williams

QUASI-PERFECT CODE If αi =0 for i > t +1

Perr = 1 - ∑t

i=0 nCi p

i (1 – p)n-i + αt+1 pt+1 (1 – p)n-t-1

A quasi-perfect t-error correcting code can correct all errors of weight ≤t, some of weight t+1, and none of weight > t+1.

Spheres of radius t+1 around the codeword may overlap and together contain all vectors of length n.

Page 22: Weight  enumerators of block codes and  the mc williams

WEIGHT DISTRIBUTIONS OF BLOCK CODES -GENERAL

For maximum distance code, to compute number of codewords of weight dmin, choose any set of d components of the codeword where dmin = d.

There are nCd ways of choosing these d components.

Consider all codewords that are zero in the n-d other components.

Any set of k = n-d+1 components of a maximum distance codeword uniquely determines that codeword and n-d components have been set to zero.

One additional component can be specified to take any of q values.

Then values of other d-1 components are determined by structure of code.

Page 23: Weight  enumerators of block codes and  the mc williams

WEIGHT DISTRIBUTIONS OF BLOCK CODES There are exactly q codewords for which a given set of n-d

places is zero.

One of these is the all-zero codeword and remaining q-1 are the weight d.

Hence Ad = nCd (q -1) = ( nd ) (q -1)

To find Al = for l > d = dmin, :

Theorem: The weight distribution of a maximum distance (n,k) code over GF(q), is given by A0 = 1, Al = 0 for l=1,…dmin-1, and for l ≥ d.