Вы находитесь на странице: 1из 7

S5.

Hamming Group Codes


A code word of length n which has k information symbols and m control (check) symbols can be
written as a vector:

v a1

a2 an

Determining the number of information symbols k: for a binary code which is used to transmit N
symbols of the information source S, k information symbols are required, which respect the following
relation:

2k N
Determining the number of control symbols m: for correcting a number of t errors, the number
of control symbols is determined using the following relations:
- The Hamming margin (necessary condition, but not sufficient)

b.
ro

2m Cni
i 0

The Varsamov-Gilbert margin (sufficient condition, but not necessary)


2 t 1

up

2m Cni 1

i 1

ea

Constructing the Hamming codes:


Control (check) matrix H

h1n
h2 n
h1

hmn

.fl

an

h12
h22

hm 2

gd

u1 h11
u h
H 2 21


um hm1

or

The control matrix H is formed of the base vectors of the space V, in total m vectors, which form
the columns of the control matrix H.

h2 hn

bo

The rule is that the columns which have only one symbol of 1 correspond to control symbols in
the code word, while the rest of the columns correspond to information symbols. If the control
symbols are not clearly delimited from the information symbols, the code is said to be nonsystematic.
Using elementary transformations, the control matrix can be written in the systematic form,
where the control and information symbols are clearly delimited.

H ' Q I m
H '' I m

One way to form the control matrix H when we know the code parameters is to have on every
column the binary representation of the column number.
The code word is determined by using the following relation:

H vT 0

The generator matrix G

The base vectors of size n of the space V, in number of k, determine the rows of the generator
matrix G.

v1 g11
v g
G 2 21


vm g k1

g12
g 22

gk 2

g1n
g 2 n

g kn

Similarly, the generator matrix G can be written in its systematic form:

G ' Ik

G '' P I k
v i G
-

The relation between G and H

up

Between the two matrices we have the following relation:

b.
ro

The code word is determined using the following relation:

H GT 0

Considering the systematic forms defined above, we have:

ea

P QT
Q PT

or

Transmission and decoding

.fl

The code word v is transmitted through noisy channels and the received code word will be:

an

v' v

gd

where is the channel error.


The decoder computes the syndrome using the relation:

s H v 'T H (v )T H T

bo

In the case of a single error, the syndrome gives the position of the error as the column number
of the control matrix H. If s=0, the transmission was successful.
In order for a code to correct or detect a number of transmission errors, we must have a
minimum distance between code words:
- For correcting t errors:

d min 2t 1
-

For detecting t errors:

d min t 1
Exercises:
1. A number of 20 symbols is transmitted through a noisy channel using a Hamming group code
which can correct a single error.
a. Determine the code parameters n, m and k
b. Write the control matrix H of the code and its systematic (canonical) forms H and H

c. Write the canonical forms of the generator matrix G and G


d. Code the following information word: i 1 1 0
e. Considering the error 0

0 1

0 1 0 0 0 0 0 0 , decode the received code

word and determine the position of the error


2. For the code H(7,3,4) we have the generator matrix G

0 0 1 0 1 1 1
G 0 1 0 1 1 1 0
1 0 1 1 1 0 0

c. Code the information word i 0

b.
ro

a. Determine the systematic form of the generator matrix G


b. Determine the systematic form of the control matrix H

0 1 using both the systematic form of the

generator matrix G and the control matrix H

0 1 0 0

up

d. Calculate the syndrome for the error 0 1 0

3. For the code H(6,3,6) we have the generator matrix G

.fl

or

ea

0 1 1 0 1 0
G 1 1 0 0 0 1
1 1 0 1 1 0

a. Determine the systematic form of the generator matrix G

an

b. Code the information word i 1 1 0 using both the systematic and non-systematic
forms of the generator matrix G

gd

c. Calculate the syndrome for the error 0

0 0 0 0 1 using the systematic

Solutions:
1. a.

bo

code word

2k N 2k 20 k 5
t

i 0

i 0

2m Cni 2m Cni 2m 1 n 2m 1 m k 2m 1 m 5 m 4
n mk 9
b.

0
0
1
1

0
1
0
0

v c1 c2

i3

c4

i5

0
0
H ' Q I m
1

0
1
0
1

0
1
1
0

0
1
1
1

1
0
0
1

1
0
0
0

0
1
0
0

0
0
1
0

0
0
0

1
0
Q
0

0
1
0
0

0
0
1
0

0
0
0
1

0
0
1
1

0
1
0
1

0
1
1
0

0
1
1
1

1
0
0

0
1
1
0

0
1
1
1

i6

1
0
0
0

i7

i9

c8

c.

1
0
1
1
0

bo

d.

i 1 1 0 0 1

0
0
0
0
1

1
0
0
0
1

1
1
0
1
1

1
0
0
0
0

0
1
0
0
0

0
1
1
1
0

1
0
1
1
0

1
1
0

1
1

0
0
1
0
0

0
0
0
1
0

0
0
0

0
1

or

0
1
1
1
0

0
0
0
1
0

.fl

0
0
1
0
0

gd

1
0

G '' P I k 0

0
1

0
1
0
0
0

an

1
0

P 0

0
0

ea

P QT

G ' Ik

b.
ro

H '' I m

0
1
0
1

1
0
0

0
0
1
0

up

0
0
H
0

0
0
H vT 0
0

0
0
1
0

0
0
1
1

0
1
0
0

0
1
0
1

0
1
1
0

0
1
1
1

1
0
0
0

c1
c
2
i3
1
c8 i9
c8 1
c4
c i i i

0
c 1
i5 0 4 5 6 7
4
0
c2 i3 i6 i7
c2 1
i6
c1 i3 i5 i7 i9
c1 1
1
i7

c8
i
9

v 1 1 1 1 1 0 0 1 1

b.
ro

e.

v ' v 1 1 0 1 1 0 0 1 1

0
1
1
0

0
1
1
1

1
0
0
0

an

2. a.

gd

1 0 0 0 1 1 1
G ' 0 1 0 1 1 1 0 I k
0 0 1 1 1 0 1

bo

b.

up

0
1
0
1

0
1
0
0

ea

0
0
1
1

or

0
0
1
0

.fl

0
0
z H v 'T
0

1
1

0
1 0
1
0 0
1
h3
0 1
0
1 1
0

1
1

Q PT

0
1
H ' Q I m
1

1
1
1
0

1
1
0
1

1
0
0
0

0
1
0
0

0
0
1
0

0
0
0

c.
Using the generator matrix G

1 0 0 0 1 1 1
v i G ' 0 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 1
0 0 1 1 1 0 1

Using the control matrix H

0
1
T
H v 0
1

v i1 i2

i3

1
1
1
0

c4

i1
i
2
0
c4

i
c
3

0
5
c4 0
0
c6
c5
c7
1
c
6
c
7

0
0
1
0

i2 i3

c4
i1 i2 i3 c5

i1 i2
c6
c7
i1 i3

1
1
0
1

1
0
0
0

0
1
0
0

c5

c6

c7 0 0 1 1 1 0 1

1
1
0
1

d.

up

1 1 0 1 0
1 0 0 0 1
0 1 0 0 0

1 1 1 0 0

ea

T 1
z H v'
1

0
1
0 1
1
0 0
1
0 1
0
1 0
0
1

b.
ro

v ' v 0 1 1 1 0 0 1

.fl

or

The syndrome is not equal to any column in H and is different from 0. This is due to the fact
that there is more than one error in the received code word. Note that the syndrome is equal to the
sum between the 2nd and the 5th columns in H (the positions of the errors).

an

3. a.

bo

b.

gd

1 0 0 0 1 1
G ' 0 1 0 1 0 1 I 3
0 0 1 1 1 1

0 1 1 0 1 0
v i G 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1
1 1 0 1 1 0
1 0 0 0 1 1
vs i G ' 1 1 0 0 1 0 1 0 1 1 1 0 1 1 0
0 0 1 1 1 1
c.

Q PT

0 1 1 1 0 0
H ' Q I m 1 0 1 0 1 0
1 1 1 0 0 1

v 's vs 1 1 0 1 1 1

bo

gd

an

.fl

or

ea

up

b.
ro

1
1
0
1
1
1
0
0

0
0
z H ' v 'Ts 1 0 1 0 1 0 0 h7
1
1 1 1 0 0 1 1
1

1

Вам также может понравиться