DC Unit4
DC Unit4
00 0 0 1 1 1 0 1 11 0
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 1
The n-k bits are computed from the message bits,
these n-k bits are referred to parity bits.
Block codes in which the message bits are
transmitted in unaltered form are called systematic
code.
Let m0, m1, ………mk-1 constitute a block of k
arbitrary message bits. Thus we have 2k distinct
message blocks.
sequence of message bits be applied to a linear
block encoder, producing an n-bit code word whose
elements are denoted by c0, c1, …..,cn-1 .
Let b0, b1, ……. Bn-k-1 denote the (n-k) parity bits in
the code word.
code word is divided into two parts, one is message
bits and other by the parity bits.
m m0, m1 .............., mk 1
b b0, b1 .............., bn k 1
c c0, c1 .............., c n 1 3
Defining the Parity bits in the compact matrix form
b mP
Where P is the k-by(n-k) coefficient matrix
p 00 p 01 .......... .p 0, n - k - 1
p 10 p 11 .......... p 1, n - k -1
Pk
p k 1 , 0 p k - 1,1 .......... p k -1, n - k -1
c b m (or) c mP I k
c mG 4
Generator Matrix
1 0 ......... 0
0 1 .......... 0
Ik
0 0 ........ 1
1 0 0 0 1 0 1
0 1 0 0 1 1 1
G
0 0 1 0 1 1 0
0 0 0 1 01 1
c0 = m0
c1 = m1
c2 = m2
c3 = m3
c4 = m0 m1 m2
c5 = m1 m2 m3
c6 = m0 m1 m3
1 0 0 0 1 0 1
0 1 0 0 1 1 1
c 1111
0 0 1 0 1 1 0
0 0 0 1 01 1
C= ( 1 1 1 1 1 1 1)
c i c j mi G mi G
mi mi G
The modulo-2 sum of mi and mj represents a new message
vector. Correspondingly, the modulo-2 sum of ci and cj
represent a new code vector.
Another way of expressing the relationship between the
message bits and parity-check bits of a linear block code
using Parity Check matrix H.
Let H denote an (n-k)- by-n matrix, defined as
H I n -k P T
11
Where PT is an (n-k)-by k matrix, representing the
transpose of the coefficient matrix P, and In-k is the (n-
k)-by-(n-k) identity matrix.
PT
T
HG I n k P T
Ik
P P T T
HG 0 T
0
The matrix H is called the parity-check matrix of the code
Block diagram representations of the code vector
d min 2t 1
t 1
3 2t 1
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 15
The parity check matrix of a particular (7,4) linear block
Code is given by,
1 1 1 0 1 0 0
H 1 1 0 1 0 1 0
1 0 1 1 0 0 1
(i)Find the generator matrix G
(ii) List the all the code vectors
(iii) What is the minimum distance between the code vectors
(iv) How many errors can be detected ? How many errors
can be corrected
H P T
I n -k
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 16
The transpose matrix PT
1 1 1 0
P T
1 1 0 1
1 0 1 1
1 1 1
1 1 0
P
1 0 1
0 1 1
P Ik
The encoding equation for this code is
c7 = m0 m1 m2
c6= m0 m1 m3
c5 = m0 m2 m3
c4 = m0
c3 = m1
c2 = m2
c1 = m3
d min e 1
3 e 1
e 2
Hence is the most two errors can be detected
d min 2t 1
t 1
3 2t 1
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 20
Syndrome Decoding
The generator matrix G is used in the encoding operation
at the transmitter. The parity-check matrix H is used in
the decoding operation at the receiver.
The received vector ‘r’ as the sum of the original code
vector ‘c’ and a error vector ‘e’.
r ce
The ith element of e equals 0 if the corresponding element
of r is the same as that of c. On the other hand the ith
element of e equals 1 if the corresponding element of r is
different from that of c.
s (c e) H cH eH
T T T
s eH T
1 1 1 0 1 0 0
H 1 1 0 1 0 1 0
1 0 1 1 0 0 1
1 1 1 0
P T
1 1 0 1
1 0 1 1
1 1 1 1 1 1 1 0 0 0
1 (i)
1 0 1 1 0 0 1 0 0
P G
1 0 1 1 0 1 0 0 1 0
0 1 1 0 1 1 0 0 0 1
d min e 1 3 e 1
e 2
(iii)
Number of errors that can be corrected is given by
d min 2t 1
t 1
3 2t 1
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 26
(iv) 1 1 1
1 1 0
b m 0 m 1 m 2 m 3 b0 m 0 m 1 m 2
1 0 1
0 1 1
b1 m 0 m 1 m 3 b2 m 0 m 2 m 3
Message bits
Input m3 m2 m1 m0
sequence
Modulo-2
Code bits
adders
parity bits
b2 b1 b0
Syndrome is given by s eH T
1 0 1
P T
0 1 1
1 1 0
1 0 1
P 0 1 1
1 1 0
Define the k-by-n generator matrix G = [P I k ]
1 0 1 1 0 0
G 0 1 1 0 1 0
1 1 0 0 0 1
1 0 0 0 1 1
G 0 1 0 1 0 1
0 0 1 1 1 0
The message block size k for this code is 3, and the length
of the code vector n is 6.
1 0 0 0 1 1
c mG 1 1 1 0 1 0 1 0 1
0 0 1 1 1 0
c 1 1 1 0 0 0
The remaining code vector
Message vector Code word
000 000000
001 001110
010 010101
011 011011
100 100011
101 101101
110 110110 33
**The generator matrix for (7,4) linear block code is given
below
1 0 0 0 1 1 1
0 1 0 0 0 1 1
G
0 0 1 0 1 1 0
0 0 0 1 1 0 1
1 0 0 1 0 1 1
H 0 1 0 1 1 1 0
0 0 1 1 1 0 1
(ii) CHT= mGHT
1 1 1
0 0 0 0
1 0 0 0 1 1 1 1 1 0
0 0 1 1
0 0
GH T
1 0 0 1 1 0
0 0 0 0
0 1 0 1 1 0 1 0 1
0 0 0
0 0 01 10 1 1 0 0
0 1 0
0 0 1
∴ CH T
= 0
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 35
**A (7,4) linear block code of which generator matrix is
given by
1 0 0 0 1 0 1
0 1 0 0 1 1 1
G
0 0 1 0 1 1 0
0 0 0 1 0 1 1
(i) Find the code vectors of this code
(ii) Find the parity check matrix of this code
(iii) Find the minimum weight of this code
(iv) If the received code word is 0001110, find the
transmitted code word
1 0 1
b 0 = m 0 ⊕ m 1 ⊕ m 2 b = mP 1 1 1
P
b1 = m 1 ⊕ m 2 ⊕ m 3 1 1 0
b2 = m 0 ⊕m 1 ⊕m 3 0 1 1
36
Message vector Code word
0000 0000000
0001 0001011
0010 0010110
0011 0011101
0100 0100111
0101 0101100
0110 0110001
0111 01 1 1 0 1 0
1000 1 0 0 0 1 01
1001 1001110
1010 1010011
1011 1011000
1100 1 1 0 0 010
1101 1 1 0 1 0 01
1110 1110100
1111 1111111
37
The transpose matrix PT
1 1 1 0
P T
0 1 1 1
1 1 0 1
1 0 0 1 1 1 0
H 0 1 0 0 1 1 1
0 0 1 1 1 0 1
d min = 3
1 0 0 1 0 1
G 0 1 0 0 1 1
0 0 1 1 1 0
Modulo-2
adders
parity bits
p2 p1 p0
d min 2t 1
t 1
3 2t 1
Thus at the most one error can be corrected
1 0 1
P T
0 1 1
1 1 0
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 43
1 0 1 | 1 0 0
H I n -k P T
H 0 1 1 | 0 1 0
1 1 0 | 0 0 1
1 0 1 1 0 1
0 0 1
1 1 1
1 1 0 1 1 0
H T
s 1 0 0 0 1 1
1 0 0 1 0 0
0 1 0 0 1 0
0 0 1 0 0 1
s 1 1 0
c4 m1 m 2 m 3
c5 m1 m 2
c6 m1 m 3
(i) Construct generator matrix
(ii) Construct code generated by this matrix
(iii) Determine error correcting capability
1 1 1 1 0 0
G 1 1 0 0 1 0
1 0 1 0 0 1
d min e 1
3 e 1 e 2
Hence is the most two errors can be detected
Number of errors that can be corrected is given by
d min 2t 1
t 1
3 2t 1
c 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0
p1 = m 1 + m 2 + m 4
p 2 = m1 + m 3 + m 4
p3 = m1 + m 2 + m 3
p4 = m2 + m3 + m4
Where mi are message digits and pi are check digits
(a) Find the generator matrix and parity check matrix
for this code
(b) How many errors can the code correct
(c) Is the vector 10101010 a codeword
(d) Is the vector 01011100 a codeword
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 53
(a)
1 0 0 0 1 1 1 0
0 1 0 0 1 0 1 1
G =
0 0 1 0 0 1 1 1
0 0 0 1 1 1 0 1
1 0 0 0 1 1 0 1
0 1 0 0 1 0 1 1
H =
0 0 1 0 1 1 1 0
0 0 0 1 0 1 1 1
d min = 4
(c) s = rH T s = 0011
It is not a codeword
(d) s = rH T s = 0000
Yes it is a codeword
G 1 1 1 1 1
1 0 0 0 1
0 1 0 0 1
H
0 0 1 0 1
0 0 0 1 1
0 0 0 1
1 1 1 1
57
Double error pattern
58
Consider the (7,4) hamming code has the following
generator matrix
X 2 c ( X ) cn - 2 cn 1 X . . . . . . . c n -3 X n 1
c ( X ) m( X ) g ( X )
m(X) is message signal a polynomial degree ≤ k.
g(X) is generator polynomial degree n- k.
X n k m( X ) b( X )
a( X )
g( X ) g( X )
3. Add b(X) to Xn-k m(X), obtaining the code polynomial
c(X).
m( X ) (m0 m1 m 2 m 3 ) (1 0 1 0)
Message polynomial is given by
m( X ) m0 m1 X m2 X m3 X
2 3
m( X ) 1 X 2
71
The non-systematic cyclic code is given by
c( X ) m( X ).g ( X )
c( X ) (1 X )(1 X X )
2 3
c( X ) 1 X X X X X 3 2 3 5
c( X ) 1 X X 0 X 0 X X 0 X
2 3 4 5 6
c( X ) 111 0 0 1 0
73
The systematic cyclic code
nk
X m( X ) X (1 X ) 3 2
X3 X 5
nk
X m( X ) X X 3 5
g( X ) 1 X X 3
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 74
X2
3 5 3
X + X +1 X + X
5 3 2
X +X +X
_________________
2
X
2
remainder polynomial b(X) = X
= X3 + X 5 ⊕ X 2
2 3 5
= X +X + X
001 1010
g(X) 1 X X 3
X g(X) X X X 2 4
X g(X) X X X
2 2 3 5
X g(X) X X X
3 3 4 6
1 1 0 1 0 0 0
0 1 1 0 1 0 0
G
1 1 1 0 0 1 0
1 0 1 0 0 0 1
i 1
2 4
= 1+ X + X + X
4 2 3 4
X h(X) = 1 + X + X + X
5 -1 3 4 5
X h(X ) = X + X + X + X
6 -1 2 4 5 6
X h(X ) = X + X + X + X
1 0 0 1 0 1 1
H 0 1 0 1 1 1 0
0 0 1 0 1 1 1
L L M
r= b/s
n( L + M )
1
r bits/symbol
n
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 87
The constraint length of a convolution code expressed in
terms of message bits, is defined as the number of shifts
over which a single message bit can influence the encoder
output.
In an encoder with an M-stage shift register, the
memory of the encoder equals M message bits and K=M+1
shifts are required for a message bit to enter the shift
register and finally come out.
Hence the constraint length of the encoder is K.
Example
g (1) ( D ) 1 D D 2
g ( 2) ( D) 1 D 2
For the message sequence (10011) we have the polynomial
representation
m ( D) 1 D 3 D 4
c ( 2 ) ( D ) g ( 2 ) ( D ) m( D )
c ( 2) ( D) 1 D 2 D 3 D 4 D 5 D 6
the output sequence of path 2 is ( 1011111).
Finally multiplexing the two output sequences of path 1
and 2 we get encoded sequence
c=(11,10,11,11,01,01,11)
91
state diagraM
State diagram of the encoder shown in
figure.
The nodes of the figure represent the
four possible states of the encoder,
with each node having two incoming
branches and two outgoing branches.
A transition from one state to another
in response to input 0 is represented
by a solid branch, where as a transition
in response to input 1 is represented
by a dashed branch.
The binary label on each branch
represents the encoder’s output as it
moves from one state to another.
92
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication
Code Tree,
93
trellis diagraM rePresentation
In drawing the trellis diagram, we use he same convention
that we introduce with the state diagram.
A solid line denotes the output generated by an input bit
zero, and a dashed line denotes the output generated by an
input bit one.
The nodes of the trellis characterize the encoder states the
first row nodes correspond to the state a=00 the second
and subsequent rows correspond to the states b=10, c=01
and d=11
a= 00
b= 10
c= 01
d= 11
99
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 100
101
Dr J. Ravindranadh/ Professor / ECE Dept / Digital Communication 102
Consider the generator polynomial g(x)= 1 +X2 + X3
1 0 1 1 0 0 0
0 1 0 1 0 1 0
G
0 0 1 0 1 1 0
0 0 0 1 0 1 1