Reed-Muller and Preparata Codes
Jan 28, 2016
Reed-Muller and Preparata Codes
p2.
OUTLINE
[1] Reed-Muller codes
[2] Decoding Reed-Muller codes [3] Extended Preparata Codes
[4] Encoding Extended Preparata Codes
[5] Decoding Extended Preparata Codes
p3.
Chap 3 Perfect and Related Codes
Recall [3.8]. Reed-Muller codes
1. r-th order, length 2m, 0≦r≦m, RM(r, m)
RM(0, m)={00…0, 11…1}, RM(m, m)=
RM(r, m) =
2. Eg 3.8.1
{( , ) | ( , 1), ( 1, 1)},0x x y x RM r m y RM r m r m
2m
K
2
4
(0,0) {0,1}
(0,1) {00,11} (1,1) {00,01,10,11}
(0,2) {0000,1111} (2,2)
(1,2) {( , ) | {00,01,10,11}, {00,11}}
RM
RM RM K
RM RM K
RM x x y x y
p4.
Perfect and Related Codes
3. Generator matrix G of RM(r, m)
4. Eg 3.8.4 Find G(1,3)
( , 1) ( , 1)i) 0<r<m ( , )
0 ( 1, 1)
ii) r=0, (0, ) [11....1]
( 1, )iii)r=m, ( , )
0........01
G r m G r mG r m
G r m
G m
G m mG m m
11 11
(1,2) 01 01
00 11
1111 1111
(1,2) (1,2) 0101 0101(1,3) (1,3)
0011 0011 0 (0,2)
0000 1111
G
G GG G
G
p5.
Perfect and Related Codes
5. The properties of RM(r,m)
m
m-r
r
i=0
(1) length n=2
(2) distance d=2
(3) dimension k= ( )
(4) RM(r-1,m) is contained in RM(r,m), r>0
(5) dual code RM(m-1-r, m), r<m
mi
p6.
Reed-Muller Codes
[1] Reed-Muller codes RM(r,m) linear (n, k, d) code with
n = 2m
Dimension k = Min. distance d = 2m-r
Standard ording of Km
Label position i with binary representation ui Km in reverse
order (low order digit first) Eg. 9.1.1
Standard ordering for K2 = (00, 10, 01, 11)
Standard ordering for K3 = (000, 100, 010, 110, 001, 101, 011, 111)
r
i i
m0
0 1 2 3 4 5 6 7
0 1 2 3
p7.
Reed-Muller Codes
Any function f : Km {0, 1} has a unique vectorv = (f(u0), f(u1), …, f(u2
m-1)) Kn , n=2m
where ui Km and follows standard ordering
Consider fI : Km {0, 1} as follow Given I {0, 1, …, m-1}
<def> vI is the corresponding vector form of fI
I if ,1
I if ),1(),...,,( 110
Ii imI
xxxxf
f v
p8.
Reed-Muller Codes
Eg. 9.1.2Let m = 3, so n = 23
(a) If I = {1, 2} then fI(x0, x1, x2) = (x1+1) (x2+1)
under standard ordering f{1,2}(0,0,0) = 1 f{1,2}(0,0,1) = 0
f{1,2}(1,0,0) = 1 f{1,2}(1,0,1) = 0
f{1,2}(0,1,0) = 0 f{1,2}(0,1,1) = 0
f{1,2}(1,1,0) = 0 f{1,2}(1,1,1) = 0
so vI = 11000000
(b) If I = {0} then fI(x0, x1, x2) = (x0+1)
so vI = 10101010
(c) If I = then fI(x0, x1, x2) = 1
so vI = 11111111
x0x1x2 (a) (b) (c) 0 0 0 1 1 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1
p9.
Reed-Muller Codes
Two facts about fI
fI(x0, x1,…, xm-1) = 1 iff xi=0 for all iI wt(vI)=2m-|I|
For each ui Km
fI(ui)fJ(ui) = fIJ(ui) and
2) (mod )(
)(
)()(
12
0
12
0
JI
iiJI
iJi
iIJI
vwt
uf
ufufvv
m
m
x0x1x2 (a) (b) (c) (d) (e) 0 0 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 0 0
(a) I={1,2}(b) I={0}(c) I=(d) I={1,2}{0}(e) I={1,2}
I if ,1
I if ),1(),...,,( 110
Ii imI
xxxxf
p10.
Reed-Muller Codes
The Reed-Muller code RM(r,m) can be defined as the linear code <{vI | I Zm, |I| r}>
S = {vI | I Zm, |I| r} : linearly indep. and thus a basis for RM(r,m)
Generating matrix Gr,m in canonical form
Eg. 9.1.8The generating matrix for RM(4,4) in canonical
form (see next page)
Encodingm
I II Z ,|I| r
c mv
3,2,1,0
2,1,0
3,1,0
3,2,0
3,2,1
1,0
2,0
2,1
3,0
3,1
3,2
0
1
2
3
4,4
0000001000000000
0000001000000010
0000001000100000
0000001010000000
0000001100000000
0010001000100010
1000001010000010
0000001100000011
0000001010101000
0000001100110000
0000001111000000
1010101010101010
0011001100110011
1100001111000011
0000001111111100
1111111111111111
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
G
Canonical formvI comes before vJ if (1) |I|<|J| or (2) |I|=|J|, j such that fI(uj)<fJ(uj) and fI(ui)=fJ(ui) i > j
Eg. 9.1.11Encoding the following m using G2,4
(a) If m = 1 0000 001000 (so m = m0,3 = 1) then
c = v + v0,3 = 0101010111111111 (b) If m = 0 0101 001001 (so m2 = m0 = m0,3 = m0,1 = 1) then
c = v2 + v0 + v0,3 + v0,1 = 0111100011010010
p12.
Reed-Muller Codes
[2] Decoding Reed-Muller codes <Def>
IC = Zm\I : the complement of I in Zm
Eg. I = {1, 3, 5} Zm , then IC = {0, 2, 4, 6, 7}
HI = {uKm | fI(u)=1}
Eg. If I = {1, 2} then fI(x0, x1, x2) = (x1+1) (x2+1)
f{1,2}(0,0,0) = 1 f{1,2}(0,0,1) = 0
f{1,2}(1,0,0) = 1 f{1,2}(1,0,1) = 0
f{1,2}(0,1,0) = 0 f{1,2}(0,1,1) = 0
f{1,2}(1,1,0) = 0 f{1,2}(1,1,1) = 0
so HI = {000, 100}
fI(x0, x1,…, xm-1) = 1 iff xi=0 for all iI
HI is a subspace of Km
pf: x, y HI
xi=yi=0 xi+yi=0 x+y HI
p13.
Reed-Muller Codes
For u = (x0, x1, …, xm-1) Km , t = (t0, t1, …, tm-1) Km
Define fI,t(x0, x1, …, xm-1) = fI(x0+t0, x1+t1, …, xm-1+tm-1)
= fI(x+t)
Eg. If I = {1, 2} then fI(x0, x1, x2) = (x1+1) (x2+1)
Assume t = 010 fI,t(0,0,0) = fI(0+0, 0+1, 0+0) = 0
fI,t(1,0,0) = fI(1+0, 0+1, 0+0) = 0
fI,t(0,1,0) = fI(0+0, 1+1, 0+0) = 1
fI,t(1,1,0) = fI(1+0, 1+1, 0+0) = 1
fI,t(0,0,1) = fI(0+0, 0+1, 1+0) = 0
fI,t(1,0,1) = fI(1+0, 0+1, 1+0) = 0
fI,t(0,1,1) = fI(0+0, 1+1, 1+0) = 0
fI,t(1,1,1) = fI(1+0, 1+1, 1+0) = 0 so vI,t = 00110000
p14.
Reed-Muller Codes
Lemma 9.2.1Let I, J Zm and |I||J|, for any sHI
C and tHJ
vI,s vJC
,t = 1 iff I = J
pf:c
cI ,s i i j jJ ,t
i I j J
f (u)f (u) (x s 1) (x t 1)
c
cm |I J |
I ,s J ,tso |{u| f (u)f (u) 1}| 2
x0x1x2 f{1},010 f{2},001 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1
I={1} s=010J={0,1} Jc={2} t=001
is even unless IJc=Zm
x0x1x2 f{1},010 f{0,2},101 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1
I={1} s=010J={1} Jc={0,2} t=101
p15.
Reed-Muller Codes
Corollary 9.2.2If c is a codeword in RM(r,m) and if |J| = r , then
mJ = c vJC
,t , tHJ
pf:
( In above, we choose s = (0,0,…,0) since (0,0,…,0) HJ
C for any J, |J| = r )
c c c
m
I I J J JJ ,t J ,t J ,tI Z ,|I| r
c v mv v mv v m
m
I II Z ,|I| r
c mv
p16.
Reed-Muller Codes
Lemma 9.2.3Let J Zm, for any word e (of length 2m)
e vJC
,t = 1
for at most wt(e) values of tHJ
pf:if t1,t2HJ , t1t2
then (HJc + t1) (HJ
c + t2)=
so vJc,t1 and vJ
c,t2 have no position
where both digits are 1Thus each 1 in e affects at most one of the values of e vJ
C,t
x0x1x2x3 v{2,3},0010 v{2,3},0001
0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 0
J={0,1}HJ={00xx} HJ
c={xx00}
p17.
Reed-Muller Codes
Idea of decoding algorithmLet w=c+e where c is a codeword in RM(r,m)Let |J|=rby lemma 9.2.3, e vJ
C,t = 0 for at least |HJ|-wt(e) values of tHJ
for such t we have w vJ
C,t = c vJ
C,t + e vJ
C,t
= c vJC
,t
= mJ (by cor. 9.2.2)
So if 2wt(e) < |HJ|, more than half of the w vJC
,t will be mJ
(i.e. more than |HJ|/2 will be mJ and less than |HJ|/2 will be mJ +1)
Now we can partially decode w by w(r-1) = w + |J|=rmJvJ
and apply similar method to w(r-1)
p18.
Reed-Muller Codes
Lemma 9.2.4The minimum distance of RM(r,m) is 2m-r
pf:The decoding algorithm can correct error
patterns of weight < |HJ|/2 where |J| r
Thus RM(r,m) has min. distance at least 2m-r
( |HJ| = wt(vJ) = 2m-|
J| )We know vI with |I|=r is a codeword in RM(r,m)
and wt(vI) = 2m-r
So min. distance of RM(r,m) is 2m-r
p19.
Reed-Muller Codes
Algorithm 9.2.5 (Majority logic decoding)Goal : decode a received word w encoded by RM(r,m)
1. i r, w(r) w 2. J Zm with |J|= i
compute w(i) vJC
,t for each tHJ
determine the majority mJ
3. If i > 0 then w(i-1) w(i) + mJvJ , where |J|=i
if wt(w(i-1)) 2m-r-1-1 then
set mJ=0 for all J with |J| r OUTPUT message m
else i i-1 goto step 2 If i = 0 then
OUTPUT message m
p20.
Reed-Muller Codes
Eg. 9.2.6Decode w = 0101011110100000 that was encoded using G2,4
1. i = r = 2 , w(2) = w m2,3 = 0 m1,3 = 0 m0,3 = 0
m1,2 = 0 m0,2 = 1 m0,1 = 0
Then w(1) = w(2) + v0,2 = 1111011100000000 2. i = 1
m3 = 1 m2 = 0 m1 = 0 m0 = 0 Then w(0) = w(1) + v3 = 0000100000000000
3. Since wt(w(0)) = 1 2m-r-1-1, so m = 0 OUTPUT 0 1000 000010
x0x1x2x3 v{2,3},0000
0 0 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 0
w(1)=1111011100000000
p23.
Preparata Codes
[3] Extended Preparata Codes U GF(2r), is a primitive element of GF(2r)
Define
Eg. 9.3.1 is a primitive element of GF(23)({0})=00000001({2, 5, 6})=00100110()=00000000
r
r
r
( ) be word of length 2 which is
1 in position i if (for 0 i 2 2)
1 in position 2 1 if 0 U
0 otherwise
i
U
U
GF(23) using 1+x+x3
word power of 000 0100 0
010 1
001 2
110 3
011 4
111 5
101 6
p24.
Preparata Codes
U GF(2r) , GF(2r) (1) U + = {u+|u U}(2) U = {u| u U}(3) UV = {x| x UV but xUV }
(U) + (V) = (UV) Eg.9.3.2
U={2, 5, 6} , V={5, 0}
Then U+ 2 = {2 + 2 , 5 + 2 , 6 + 2} = {0, 3, 0} 2 U = {22, 25, 2 6}={4, 0, 1}
(U) + (V) = 00100110 + 00000101= 00100011= ({2, 6, 0})= (UV)
GF(23) using 1+x+x3
word power of 000 0100 0
010 1
001 2
110 3
011 4
111 5
101 6
p25.
Preparata Codes
Def.9.3.3The extended Preparata code P(r) is the set of codewords of the form [(U), (V)], where U and V GF(2r) satisfy
Eg.9.3.4Construct GF(23) using 1+x+x3
U = {1, 2, 5, 0} , V = {0, 1, 2, 3, 6, 0}
[(U), (V)] = 01100101 11110011 is a codeword in P(3)
3 3 3
(i) | | and | | are even
(ii) =
(iii) ( )
(iv) is odd
u U v V
u U u U v V
U V
u v
u u v
r
GF(23) using 1+x+x3
word power of 000 0100 0
010 1
001 2
110 3
011 4
111 5
101 6
p26.
Preparata Codes
Lemma 9.3.5Suppose [(U), (V)] and [(A), (B)] are codewords in P(r).Let . Then [(UA + ), (VB)] is also a codeword
Pf:check (i)(ii)(iii) of Def.9.3.3 (i) |U|, |V|,|A|,|B| are even
|UA + | = |UA| = |U|+|A|-2|UA| is even |VB| = |V|+|B|-2 |VB| is even
(ii)
u U
u
ifor any , , since 2 0
x I J x I x J
I J
x x x
( ) | |
=
x U A y U A y U A
y U y A
y V y B y V B
x y y U A
y y
y y y
3 3 3
(i) | | and | | are even
(ii) =
(iii) ( )
(iv) is odd
u U v V
u U u U v V
U V
u v
u u v
r
p27.
Preparata Codes
(iii)
3 3 3 3
3 3 3
3 2 2 3
( ) ( ) ( ) (by (ii))
= ( ) ( ) ( )
| |
x U A x U A y U A y V B
y U y A y V y B
y U y U y U
x x y y
y y y y
y y y U
3 2 2 3
3 2 2 3
+ | |
+( ) ( ) ( ) ( )( ) ( )
y A y A y A
y V y V y B y V y B y B
y y y A
y y y y y y
2 2
(1)
(2)( )
(3) | | | |
y V y U
y V y V
y y
y y
U and V are even
3 3 3
y V y B y V B
y y y
p28.
Preparata Codes
Def A code is distance invariant if for any pair of codeword c1 and c2, the number of codewords distance i from c1
equals the number of codewords distance i from c2 for 1<=i<n.
Coro.9.3.7P(r) is distance invariant
Pf: Let [(U), (V)] and [(A), (B)] be codewords that are distance i apart.By Lemma 9.3.5 [(UU + ), (VV)] and [(UA + ), (VB)] are both codewords and also distance i apart.Since [(UU + ), (VV)] is the zero word
and [(UA + ), (VB)] has weight i
p29.
Preparata Codes
Lemma 9.3.8Suppose [(U), (V)] is a codeword in P(r) Then P(r) also contains the following codewords:(i) [(V), (U)](ii) [(U + ), (V + )](iii) [(U), (V)] , 0
Pf:Check (i)(ii)(iii) of Def.9.3.3similar as the proof of lemma 9.3.5
p30.
Preparata Codes
Lemma 9.3.13If is a primitive element of GF(2r) then 3 is a primitive element if r is odd and is not primitive if r is even
Pf: i is primitive iff gcd(i, 2r-1)=1and if r is odd then 2r-1 = 1 mod 3
if r is even then 2r-1 = 0 mod 3
Coro.9.3.14If r is odd then for each nonzero element x of GF(2r),there is a unique y such that y3=x
p31.
Preparata Codes
Thm.9.3.15P(r) has min. distance 6
Pf:Since P(r) is distance invariant, it contains a codeword [(U), (V)] of weight dd = wt((U)) + wt((V)) = |U| + |V|d is even, so we only need to show that d2,4 and there is a codeword of weight 6(1) suppose d=2, by lemma 9.3.8(i), assume |U|=2 and |V|=0
By lemma 9.3.8(ii), we can assume U={0, x}, x0 Then Def.9.3.3(ii) does not hold.
(2) suppose d=4, by lemma 9.3.8(i), either |U|=4 and |V|=0 or |U|=2 and |V|=2
p32.
Preparata Codes
(a) |U|=4 and |V|=0, assume U={0, x, y, z}, x,y,z are distinct and non-zero Then Def.9.3.3(iii) gives that 03+x3+y3+z3+(0+x+y+z)3=0 (x+y)(x+z)(y+z)=0 ( impossible !!)
(b) |U|=2 and |V|=2, assume U={0, x} and V={y,z} y,z are distinct Then Def.9.3.3(iii) gives that
03+x3+(0+x)3= y3+z3=0 By coro.9.3.14, if y3=z3 then y=z (-><-)
(3) Find a codeword of weight 6 Let x,y,z are distinct nonzero element
w be the unique element such that w3 = x3+y3+z3
and let u = w+x+y+z
p33.
Preparata Codes
Then w is not equal to x,y or z (since w=x imply y=z)and u0 (since w3 + (x+y+z)3 = (x+y)(x+z)(y+z) 0, so w x+y+z)Now let U={0,u} , V={w, x, y, z}Then [(U), (V)] is a word of weight 6 and we can check that it is a codeword.
p34.
Preparata Codes
Thm.9.3.18P(r) is not a linear code
Pf:we know that [(U), (V)] + [(A), (B)] = [(UA), (VB)]from the proof of thm.9.3.15, we can construct them withU={0, u1} , V={w1, x1, y1, z1}
A={0, u2} , B={w2, x2, y2, z2}
Then by lemma 9.3.5, [(UA + u1), (VB)] is a codeword
Since |UA + u1| 2, so
d ([(UA + u1), (VB)] , [(UA), (VB)]) 4
But min. distance is 6.So [(U), (V)] + [(A), (B)] is not a codeword,P(r) is not a linear code.
p35.
Preparata Codes
[4] Encoding extended Preparata codes Parity-check matrix of 2 error-correcting BCH code
Define
A : the submatrix of H formed by the last 2r rowsH’ : the submatrix of H formed by deleting the last 2r rows from H
0 0
1 3
2 6
2 2 3(2 2)
m m
H
p36.
Preparata Codes
Eg.9.4.1 Construct GF(23) using 1+x+x3,
we have
1 3
2 6
3 2
4 5
5 1
6 4
010 110 001 101
110 001
011 111 111 010 101 011
A
1
001 011
111 010
011 101 and
110 100
101 110
111 001
A
GF(23) using 1+x+x3
word power of 000 0100 0
010 1
001 2
110 3
011 4
111 5
101 6
p37.
Preparata Codes
Let m = mL,mR be any binary word of length 2r+1 - 2r – 2,
where mLis of length 2r - 1
mRis of length 2r- 2r – 1
then by using polynomial notation for mLand mR
we have [mL(),mL(3)] mLH
[mR(),mR(3)] mRH’
Define vR = [mL() + mR(), mL(3) + (mL())3 + mR(3)]A-1
p38.
Preparata Codes
Thm. 9.4.2Let r be odd. For any m of length 2r+1
- 2r – 2,
if (U)=[mL, pL] and (V)=[mR, vR, pR] , where pL and pR are parity check digits.Then [(U), (V)] is a codeword in P(r)
Pf: [mR, vR]H = [mR]H’ + [vR]A
= [mR(), mR(3)] + [mL() + mR(), mL(3) + (mL())3 + mR(3)]
= [mL(), mL(3) + (mL())3]
But [mR, vR]H = [vVv, vVv3]
Similarly, mL() = uUu and mL(3) + (mL())3 = uUu3 + (uUu)3
Therefore Def.9.3.3(ii)(iii) hold, and clearly (i)(iv) hold.
p39.
Preparata Codes
Coro.9.4.3 P(r) has 2^(2r+1
- 2r – 2) codewords.
Algo.9.4.4 (Encoding P(r))
Let mL and mR be words of length 2r-1 and 2r-2r-1 resp.
Let vR be as defined in Thm 9.4.2.
Then [mL, pL, mR, vR, pR] is a codeword of m=[mL, mR]
p40.
Preparata Codes
[5] Decoding extended Preparata codes w = [wL, pL, wR, pR] be a received word
where wL and wR are both of length 2r-1
Then we can compute [wL(), wL(3)] = wLH
[wR(), wR(3)] = wRH
consider 6 cases(1) If error only occurred on parity check digits
wL() = wR()
wL(3) +(wL())3 = wR(3)
and is easily checked
p41.
Preparata Codes
(2) If there are no errors in wL, one error in position i of wR and at most one error in the parity check digitsThen
wL() = wR() + i
wL(3) +(wL())3 = wR(3) + 3i
so (wL() + wR())3 = wL(3) +(wL())3 + wR(3)
and i = wL() + wR()
(3) If there are no errors in wR, one error in position i of wL and at most one error in the parity check digitsBy lemma 9.3.8(i) , we can check that
(wR() + wL())3 = wR(3) +(wR())3 + wL(3)
and i = wL() + wR()
(4) If two errors occur in wR, say in the position i and j
wL() = wR() + i + j
wL(3) +(wL())3 = wR(3) + 3i + 3j
so i + j and 3i + 3j are known.
i and j can be found in the same method in BCH decoding
(5) If two errors occur in wL, say in the position i and j
same as (4)
(6) If one error in wL and one in wR, say in position i and j resp.
Then
wL() + i = wR() + j
wL(3) + 3i +(wL() + i )3 = wR(3) + 3j
First, Let j = wL() + i + wR()
wL(3) + 3i +(wL() + i )3 = wR(3) + (wL() + i + wR())3
so (i + wR())3 = (wL(3) + wR(3)) + (wL() + wR())3 + wL()3 + wR()3 =
Therefore i = wR() + 1/3
j = wL() + 1/3