Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Applied Algebra: Codes & Ciphers - Matrix Codes and Decoding Algorithms - Prof. Julie M. C, Assignments of Mathematics

An overview of matrix codes and decoding algorithms used in error correction for binary codes. It includes the decoding algorithm for a parity check matrix, a theorem on decoding single errors, and the concept of dual codes. The document also includes examples of encoding and decoding using maple.

Typology: Assignments

Pre 2010

Uploaded on 08/16/2009

koofers-user-giw
koofers-user-giw 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 350: Applied Algebra: Codes & Ciphers Spring 2009
Matrix Codes
1
100110
010011
001111
G
⎡⎤
⎢⎥
=⎢⎥
⎢⎥
⎣⎦
1
101100
111010
011001
H
=
Decoding algorithm:
1) Compute syn(r) = Hr t.
2) If syn(r) = 0, assume no errors in transmission and peel off the first k digits of r as the
correct information digits.
3) If syn(r) 0 and syn(r) = column i of H, then assume a single error in transmission,
and it must be in position i. Correct that position, and then peel off the correct
information digits.
4) If syn(r) 0 and syn(r) any column of H, then assume at least 2 errors in
transmission - so you cannot decode correctly.
Theorem 3: An (n-k)×k parity check matrix H will correctly decode all single errors if
and only if the columns of H are all non-zero and distinct.
Proof: <== Assume the columns of H are non-zero and distinct. Let ei = the row vector
with a 1 in position i and 0's everywhere else.
Let r = c + ei (a received word with a single error)
Then Hrt = H[c+ei]t = Hct + Heit
= 0 + ith column of H so we will correctly decode the single error.
Proof: ==> (by contradiction):
Assume either the j th column of H is zero. (1)
Then Hrt = H[c + ej]t = Hct + Hejt
= 0 + 0 = 0
which means we will not correct the single error.
or assume column i = column j [in H] (2)
Then H]c+ej]t = Hct + Hejt
= 0 + j th column of H
= 0 + i th column of H = Hct + Heit
= H[c + ei]t
So we cannot tell if the single error is in position i or j.
Dual Codes:
Let C be an (n,k)-code with generator matrix G = (Ik | A) and parity check matrix H = (At
| In-k). Then H = G = G perp is a generator matrix for the dual code C = C perp.
Page 1
pf3
pf4
pf5

Partial preview of the text

Download Applied Algebra: Codes & Ciphers - Matrix Codes and Decoding Algorithms - Prof. Julie M. C and more Assignments Mathematics in PDF only on Docsity!

Matrix Codes

1

G

1

H

Decoding algorithm:

  1. Compute syn( r ) = H• r

t .

  1. If syn( r ) = 0, assume no errors in transmission and peel off the first k digits of r as the

correct information digits.

  1. If syn( r ) ≠ 0 and syn( r ) = column i of H, then assume a single error in transmission,

and it must be in position i. Correct that position, and then peel off the correct

information digits.

  1. If syn( r ) ≠ 0 and syn( r ) ≠ any column of H, then assume at least 2 errors in

transmission - so you cannot decode correctly.

Theorem 3: An ( n-kk parity check matrix H will correctly decode all single errors if

and only if the columns of H are all non-zero and distinct.

Proof: <== Assume the columns of H are non-zero and distinct. Let e (^) i = the row vector

with a 1 in position i and 0's everywhere else.

Let r = c + ei (a received word with a single error)

Then H• r

t = H•[c+ e (^) i ]

t = H•ct + H• e (^) i

t

= 0 + i

th column of H so we will correctly decode the single error.

Proof: ==> (by contradiction):

Assume either the j

th column of H is zero. (1)

Then H• r

t = H•[c + e (^) j ]

t = H•c

t

  • H• e (^) j

t

which means we will not correct the single error.

or assume column i = column j [in H] (2)

Then H•]c+ e (^) j ]

t = H•c

t

  • H• e (^) j

t

= 0 + j

th column of H

= 0 + i

th column of H = H•c

t

  • H• e (^) i

t

= H•[c + e (^) i ]

t

So we cannot tell if the single error is in position i or j.

Dual Codes :

Let C be an (n,k) -code with generator matrix G = (I k | A) and parity check matrix H = (A

t

| I n-k ). Then H = G┴ = G perp is a generator matrix for the dual code C┴ = C perp.

Maple and Matrix Codes:

restart: with(linalg): with(LinearAlgebra):

We define a generating matrix G1 for generating a (6,3) linear binary code C 1 :

G1:=matrix(3,6,[1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,1,1]):

Now we want to use this matrix to encode every combination of 3-information digits.

So - we list all the possible information sets:

Info3:=matrix(8,3,[0,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1,1,0,1,0,

1,1,1,1]);

Info3 :=

and then multiply each information triple by the generating matrix ‐ mod 2 to obtain our

list of codewords:

C1:=map(modp,multiply(Info3,G1),2);

C1 :=

Now – to decode with the parity check matrix, we define H 1 (the parity check matrix for

C 1 ) by:

H1:=matrix(3,6,[1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,0,0,1]);

H1 :=

Now for each received word r, define its syndrome, syn(r) to be H 1 *c^t.

Let's compute the syndrome for a received vector r:

r:=matrix(1,6,[0,1,1,0,1,1]);

r :=[ 0 1 1 0 1 1 ]

C2perp :=

Now we check that G 2 is a parity check matrix for C 2 ┴ by computing the syndromes for

all codewords in C 2 ┴:

C2perpsyndrones:=map(modp,multiply(G2,transpose(C2perp)),2)

C2perpsyndrones :=

Homework Exercises #5:

due 3/24/09 ~ 5:00 pm

  1. Find the parity check matrix (H 1 – H 4 ) for codes (C 1 – C 4 ) generated by the

following generator matrices:

a) 1 b)

1 0 0 1 1 1

0 1 0 0 1 1

0 0 1 1 1 0

G

⎡ ⎤

⎢ ⎥

⎢ ⎥ ⎣ ⎦

2

1 0 0 0 1 1

0 1 0 1 1 1

0 0 1 1 1 0

G

⎡ ⎤

⎢ ⎥

⎢ ⎥

⎢ ⎥ ⎣ ⎦

c) d) 3

G

4

1 0 0 0 1 1 0

0 1 0 0 0 1 1

0 0 1 0 1 0 1

0 0 0 1 1 1 1

G

⎡ ⎤

⎢ ⎥

⎢ ⎥

⎢ ⎥

⎢ ⎥ ⎢⎣ ⎥⎦

  1. Determine the number of errors that can be

a) detected b) corrected by each of the matrix codes C 1 – C 4 defined in #1.

  1. Use the parity check matrices H 1 – H 3 you found in #1 to determine the location

of any errors in the following received vectors. (If there are double-errors, do not

try to correct). Report the correct information digits for each received vector.

a) C 1 : r 1 = [1 0 0 1 0 1]; r 2 = [1 0 0 1 0 0]; r 3 = [1 1 1 0 1 0 ]

b) C 2 : r 1 = [0 1 0 0 1 1]; r 2 = [1 1 1 0 0 1]; r 3 = [1 0 0 1 0 1 ]

c) C 3 : r 1 = [0 1 1 0 1 1 0]; r 2 = [1 1 1 0 0 0 0]; r 3 = [1 0 0 1 1 1 0 ]

  1. Let C┴ 5 – C┴ 8 be the codes generated by the parity check matrices H 5 – H 8

shown below.

i) List all the codewords in each code.

ii) Find a parity check matrix for each code.

iii) Use the parity check matrix to determine whether or not the code can correct a

single error. Explain.

a) b) 5

1 1 0 1 0 0

1 0 0 0 1 0

1 1 1 0 0 1

H

⎡ ⎤

⎢ ⎥

⎢ ⎥

⎢ ⎥ ⎣ ⎦

6

1 1 0 1 0 0

1 1 1 0 1 0

1 0 0 0 0 1

H

⎡ ⎤

⎢ ⎥

⎢ ⎥

⎢ ⎥ ⎣ ⎦

c) d) 7

1 1 0 1 0 0

1 1 1 0 1 0

1 0 1 0 0 1

H

⎡ ⎤

⎢ ⎥

⎢ ⎥

⎢ ⎥ ⎣ ⎦

8

1 1 1 1 1 0 0 0

1 1 0 1 0 1 0 0

1 0 1 1 0 0 1 0

0 0 0 1 0 0 0 1

H

⎡ ⎤

⎢ ⎥

= ⎢^ ⎥ ⎢ ⎥

⎢ ⎥ ⎢⎣ ⎥⎦