Channel Coding: Convolutional Codes
Channel Coding: Convolutional Codes
Channel Coding: Convolutional Codes
Convolutional codes
Figure 8-1: An example of a convolutional code with two parity bits per message
bit (r = 2) and constraint length (shown in the rectangular window) K = 3.
The size of the window, in bits, is called the codes constraint length.
If a convolutional code that produces r parity bits per window and slides the window
forward by one bit at a time, its rate (when calculated over long messages) is 1/r.
g0 = 1, 1, 1
g1 = 1, 1, 0
If the message sequence, X = [1, 0, 1, 1, . . .] (as usual, x[n] = 0
n < 0), then the parity bits from Equations 8.1 work out to be
Therefore, the parity bits sent over the channel are [1, 1, 1,
1, 0, 0, 0, 0, . . .].
Table 8-1: Examples of generator polynomials for rate 1/2 convolutional codes
with different constraint lengths.
() () () () () ()
+ +
() () () ()
= + +
Overview of Convolutional Codes (3)
+
c1 First
Data In/ g1 g2 g3 Coded bit
Message
Input Second
c 2 Coded bit
g1 (111)
+
g 2 (101)
Overview of Convolutional Codes (3)
Consider the message sequence: u=(10011)
Generator matrix : = + = 5 2 5 + 2 = 5 14
() () () () () () () () () () () () () ()
() () () () () () () () () () () ()
() () () () () ()
= ()
()
()
()
() () () () () () () ()
() () () () () ()
Overview of Convolutional Codes (3)
(1) = [111] (2) = [101]
() () () () () () () () () () () () () ()
() () () () () () () () () () () ()
() () () () () ()
= ()
()
()
()
() () () () () () () ()
() () () () () ()
=
= = [10011]
= 1 1 10 11 11 01 01 11
Overview of Convolutional Codes (2)
Convolutional encoder
5.7dB
4.7dB
u1 u1
u1 u 2 u1 u 2
t3 1 0 1 0 0
t4 0 1 0 1 0
u2 u2
Reff 3 Rc 1
10 2
p. 22 EEE3321 DATA Communications
Effective Code Rate
L
Reff Rc Example: m=[101]
n L / k (K 1) n=2, K=3, k=1, L=3
Reff=3/[2(3+3-1)]=0.3
p. 23
10 EEE3321 DATA Communications
Encoder Representation (1)
Vector representation:
Define n vectors, each with Kk elements (one vector for each
modulo-2 adder). The i-th element in each vector, is 1 if the
i-th stage in the shift register is connected to the
corresponding modulo-2 adder, and 0 otherwise.
Examples: k=1
u1
Input u1 u 2
u2
U m g1 interlaced with m g2
g1 (100)
g1 (111)
Generator matrix g 2 (101)
g 2 (101) with n vectors g3 (111)
p. 24 EEE3321 DATA Communications
Encoder Representation (2)
m u1 u 2
u2
g ( X ) g (1) g (1) X g (1) X 2 1 X X 2
1 0 1 2
b)Tree Diagram
Representation
Input bit: 10 11
Initial state
Initial state
Input bit: 10 11
Output bits:
111 000
Each path connecting the initial state and the final state
represents a non-zero codeword that diverges from and
re-emerges with state a (all-zero state) only once.
p. 41
20 EEE3321 DATA Communications
Example of Modifying the State Diagram
T ( X ) ad D d
ad represents the number of paths
from the initial state to the final
d state having a distance d.
d free 6
X D X DX
3 T ( X ) X e X a D6 (1 2D 2 )
c a b
D6 2D 8 4D10 8D12
X b DX c DX d
ad D d
X D 2 X D 2 X d6
d c d
2(d 6) / 2 (even d)
X e D2 X b ad
0 (odd d)
Input bit: 10 11 00
Output bits:
111 000 011
Convolutional r Convolutional
Channel
Encoder Decoder
x c c
hard-decision
Received sequence
p. 51
30 EEE3321 DATA Communications
The Viterbi Algorithm (3)
Implementation:
1. Initialization:
Let Mt(i) be the path metric at the i-th node, the t-th stage in
trellis
Large metrics corresponding to likely paths; small metrics
corresponding to unlikely paths
Initialize the trellis, set t=0 and M0(0)=0;
2. At stage (t+1),
Branch metric calculation
Compute the metric for each branch connecting the states at
time t to states at time (t+1)
The metric is related to the likelihood probability between the
received bits and the code bits corresponding to that branch:
p(r(t+1)|c'(t+1))
Implementation (contd):
2. At stage (t+1),
Branch metric calculation
In hard decision, the metric could be the number of same bits
between the received bits and the code bits
Path metric calculation
For each branch connecting the states at time t to states at time
(t+1), add the branch metric to the corresponding partial path
metric Mt(i)
Trellis update
At each state, pick the most likely path which has the largest
metric and delete the other paths
Set M(t+1)(i)= the largest metric corresponding to the state i
Implementation (contd):
3. Set t=t+1; go to step 2 until the end of trellis is reached
4. Trace back
Assume that the encoder ended in the all-zero state
The most probable path leading into the last all-zero state in
the trellis has the largest metric
Trace the path from right to left
Read the data bits from the trellis
Hard-decision
2
p Q b
N0
Correct decoding
Pe a d P2 (d )
d d free
Pb
d d free
f (d )ad P2 (d )