Linear Codes: Coding Theory and Its Applications

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Linear Codes

Coding Theory and Its Applications


Binary Block Codes
Definition of Binary Block Code:
A binary block code is a subset of for some n.
Elements of the code are called code words
Definition of Linear Code:
A linear code is a linear subspace of
Definition of Minimum Distance:
The minimum distance of a linear code is the minimum of
the weights of the non-zero code words
B
n
B
n
Example
The following two-dimensional codes in have
minimum distance 1
The code {000, 011, 101, 110} has minimum distance 2
3
B
Binary Block Codes
If L is a k-dimensional subspace of , then we can find a
basis for L consisting of k code words in
Every code word in L is a linear combination of the basis
code words
B
n
1 2
, , ,
k
b b b
B
n
Binary Block Codes
Definition of Generator Matrix:
A generator matrix for a linear code is a binary matrix
whose rows are the code words belonging to some basis
for the code
A generator matrix for a k-dimensional linear code is a
k x n matrix whose rank is k
A rank is the number of linearly independent rows or
column in a matrix
Example 1
The code {0000, 0001, 1000, 1001} is a two-dimensional
linear code in B
4
The basis of this code is {0001, 1000}
To find the code words from the generator matrix
Example 2
The code {0000, 0011, 0110, 1100, 0101, 1111, 1010,
1001} is a three-dimensional linear code in B4
The basis of this code {0011, 0110, 1100}
Thus, the generator matrix is
The code words can be obtained:
Example 2 (Contd)
If we use basis of {0101, 1001, 1010}, the generator matrix
will be
The code words are
Example 3
The generator matrix of rank 3 is given below
The code words are
Binary Block Codes
Definition of Elementary Row Operation:
An elementary row operation on a binary matrix consists
of replacing a row of the matrix with the sum of that row
and any other row
If we have a generator matrix G for a linear code, all
other generator matrices for L can be obtained by
applying a sequence of elementary row operations to G
Binary Block Codes
Definition of Equivalent Codes:
Two codes are equivalent if each can be constructed from the
other by reordering the bits of each code word in the same
way
Definition of Canonical Form:
The generator matrix G of a k-dimensional linear code in B
n
is
in canonical form if it is of the form:
where I is a k x k identity matrix and A is an arbitrary
k x (n k) binary matrix
| |
| G I A =
Example
We have
To make canonical form, we conduct the following steps
The code generated by the canonical form: {0000, 1000,
0100, 1100}
It has minimum distance 1
Binary Block Codes
Definition of Parity Check Matrix:
The parity check matrix of a linear code with k x n
generator matrix G is the k x n matrix H satisfying
where H
T
is the transpose of H and 0 denotes the
k x (n k) zero matrix
0
T
GH =
Binary Block Codes
If G is canonical form, then
If G is not canonical, we can find H by:
reducing G to canonical from
finding the canonical form of H by using the equation above
reversing the column operations used to convert G to
canonical form to convert G the canonical form of H to the
parity check matrix of G
|
T
H A I
(
=

Example 1
The canonical matrix G is given
with
The H is obtained by transposing A and adjoining a 2 x 2
identity matrix to get
By definition
Example 2
The generator matrix for linear code {000, 101, 011, 110}
is
The parity check matrix is
If we calculate all the elements of the B
3
, it results
Binary Block Codes
If L is a k-dimensional linear code in B
n
, and G is a
generator matrix for L, every code word in L can be
obtained by taking some and multiplying it by G,
to get the code word bG.
If we now multiply this by the transpose of the parity
check matrix H, we get
k
b B e
( )
( )
0 0
T T
bG H b GH b = = =
Example
The linear code {0000, 0011, 1100, 1111} has generator
matrix of
The parity check of this matrix is
We can check
Encoding and Decoding
If we assume the corruption occured while transmission
through a BSC and we use ML, it follows that a corrupted
string should be restored to the code word which is
closest to it
Suppose that generator matrix G generates the linear
code L, and the code word w is corrupted by a noise
vector e, the result is x = w + e
If x is not the code word, the decoder must find the
closest code word y (the error vector is smallest)
If x is not a code word, it belongs to the coset x + L,
which is x = e + u where and e is the vector of
least weight in the coset
L e u
Encoding and Decoding
Definition of Syndrome:
If L is a linear code with generator matrix G and parity
check matrix H, the syndrome of x is given by
Procedure for removing noise:
Draw up the syndrome table: list of the cosets, showing the
vector of minimum weight and the syndrome
When a string that is not a code word is received, compute its
syndrome
Add the vector of minimum weight from the corresponding
coset to the corrupted string to recover the uncorrupted code
word
T
s H = x
Example
Suppose that the parity check matrix of the linear code L
To draw up the syndrome table, we start with the
elements of L, which have syndrome 00
syndrome code words Error vector
Example (Contd)
We choose a vector that does not belong to L and
compute its syndrome. If we choose 0001, whose
syndrome is 10, we add this vector to all the code words
If we choose 0110, the syndrome is 11
Example (Contd)
Then, we choose 0100 whose syndrome is 01
If we receive the vector 1010, we compute the syndrome,
which is 11
We add the vector of minimum weight in the coset with
syndrome 11 to 1010, so the corrected code word is
1111

You might also like