



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
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
1 / 5
This page cannot be seen from the preview
Don't miss anything!
Matrix Codes
1
1
Decoding algorithm:
t .
correct information digits.
and it must be in position i. Correct that position, and then peel off the correct
information digits.
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 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
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
t
= 0 + j
th column of H
= 0 + i
th column of H = H•c
t
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,
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);
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]);
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 :=
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
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
⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥ ⎢⎣ ⎥⎦
a) detected b) corrected by each of the matrix codes C 1 – C 4 defined in #1.
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 ]
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
⎡ ⎤
⎢ ⎥
= ⎢^ ⎥ ⎢ ⎥
⎢ ⎥ ⎢⎣ ⎥⎦