You are on page 1of 32

CONVOLUTIONAL CODES

& VITERBI ALGORITHM
Ade Irawan
Coding Theory (Office Hour), 31 Oct 2012

Objectives

Convolutional Code

Viterbi Algorithm
?

source

encoder

mapping
BPSK
1  -1
0 1

channel

demaping

decoder

sink

1 Hard Decoding
Received samples :
r = (1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1)
?
decoder

sink

2 Soft Decoding
r = (-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5)

Convolutional Code
Generator Polynomial: (7,5)

+
source

S1

P/S

S2
+

Example

Convolutional Code

+
S1

S2
+

Convolutional Code

+
S1

S2
+

Code Representations
State Transition Diagram

+
0

source bit
(input)

0
+

codeword
(output)

S(10)

S(00)

Code Representations
State Transition Diagram

+

source bit
(input)

S(11)

1

0
+

S(10)

S(01)

S(00)

codeword
(output)

Code Representations
State Transition Diagram

+

source bit
(input)

S(11)

1

1
+

S(10)

S(01)

S(00)

codeword
(output)

Code Representations
State Transition Diagram

+

source bit
(input)

S(11)

0

1
+

S(10)

S(01)

S(00)

codeword
(output)

Code Representations
State Transition Diagram

Trellis Diagram
Output (c0c1):

+
S(11)

S1

S(11)

S2
+

S(10)

S(01)

S(11)

S(01)

S(01)

S(10)

S(10)

S(00)
S(00)

10

00

S(00)

Input (b) : 1
Input (b) : 0

Trellis Diagram

10

10

10

10

10

10

10

10

S(11)
S(01)
S(10)

00

00

00

00

00

00

00

00

S(00)

Input (b) : 1
Input (b) : 0

Trellis Diagram, Start From State (00)

10

10

10

10

10

S(11)
S(01)
S(10)

00

00

00

00

00

00

00

S(00)
Input (b) : 1
Input (b) : 0

Trellis Diagram for Tail Transmission
+
Flush The Memory :

S1

S2

+
10

10

S(11)
S(01)
S(10)

00

00

00

00

00

00

S(00)
Input (b) : 1
Input (b) : 0

Viterbi Algorithm
Initialization

Time = Time + 1
BM Computation

BM : Branch Metric

BM (r,c) = dH(r,c) , hard BM
BM (r,c) = dE(r,c) , soft BM

PM Update (ACS*) PM : Path Metric

End of
Trellis ?
Output Decode
Sequence

*ACS : Add-Compare-Select

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1 Initialization

1, 0,

0, 1,

0, 0,

1, 1

Use hard BM : dH(c,r)

10

S(11)
S(01)
S(10)

0

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

2 Time 1, BM Computation

0, 1,

0, 0,

1, 1

Use hard BM : dH(c,r)

10

S(11)
S(01)

BM : dH(c,r) = dH[(11),(10)] = 1

S(10)

0

1
BM : dH(c,r) = dH[(00),(10)] = 1

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

3 PM Update

0, 1,

0, 0,

1, 1

Use hard BM : dH(c,r)

10

S(11)
S(01)

PM = 0+1 = 1

S(10)

1

0

1

1
PM = 0+1 = 1

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

3

1

0

1

1

1

0, 1,

0, 0,

1, 1

Use hard BM : dH(c,r)

10

S(11)

1

S(01)

2

S(10)

2

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

3

1

0

1

1

1

0

0, 1,

0, 0,

1, 1

3 PM = min{(3+0),(2+2)}

10

S(11)

1

2 PM = min{(3+2),(2+0)}

S(01)

2

2 PM = min{(1+1),(2+1)}

S(10)

2

1

2 PM = min{(1+1),(2+1)}

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

3

1

0

1

1

1

0

0, 1,

3

2

0, 0,

2

1, 1
10

S(11)

1

2

3

S(01)

2

2

3

S(10)

2

1

2

1

3

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

3

1

0

1

1

1

0

0, 1,

3

2

0, 0,

2

3

2

2

3

1

2

1

10

2

1

2

1, 1

3

S(11)
S(01)

3

S(10)
0

3

2

3

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Hard Decision
Received samples :
1, 0,
1, 0,

1, 0,

3

1

0

1
1

1

1
0

0

0, 1,

3

2

0, 0,

2

3

2

2

3

1
1

2

1
1

10

2

1

2

1, 1

3

S(11)
S(01)

3

S(10)
0
0

3

2

3

0 : Decode Output

00

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
-1,1

S(11)
S(01)
S(10)

1,1
Path Metric




0

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
-1,1
Use soft BM : dE(c,r)

S(11)
S(01)

BM = (-0.8-(-1))2 + (0.1-(-1))2

S(10)
4.05
Path Metric




0

BM = (-0.8-1)2 + (0.1-1)2

1,1

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
-1,1

S(11)
S(01)
S(10)

1,1

4.05


1.25
4.05

Path Metric




0

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
-1,1

S(11)
S(01)
S(10)



1.25
4.05

7.53
1.93
5.53
9.53

Path Metric




0

1,1

5.48

4.05

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
0.82

5.48

4.05


1.25
4.05

7.53
1.93
5.53
9.53

-1,1

S(11)

PM = min{(7.53+4.82),(5.53+0.82)}

S(01)

PM = min{(1.93+1.22),(9.53+4.42)}

S(10)

PM = min{(1.93+4.42),(9.53+1.22)}
8.35
6.35
3.15
6.35

Path Metric




0

1.22

PM = min{(7.53+0.82),(5.53+4.82)}

1,1

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
0.82

6.37

-1,1

S(11)
S(01)
S(10)

5.48

4.05


1.25
4.05

7.53
1.93
5.53
9.53

1,1

4.77
8.35
6.35
3.15
6.35

3.52
8.72
8.32
8.32

Path Metric




0

1.22

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
0.82

6.37

-1,1

S(11)
S(01)
S(10)

5.48

4.05


1.25
4.05

7.53
1.93
5.53
9.53

4.77
8.35
6.35
3.15
6.35

1,1

1.13
3.52
8.72
8.32
8.32

5.85
9.45

Path Metric




0

1.22

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
0.82

6.37

-1,1

S(11)
S(01)
S(10)

5.48

4.05


1.25
4.05

7.53
1.93
5.53
9.53

4.77
8.35
6.35
3.15
6.35

1.13
3.52
8.72
8.32
8.32

5.86
5.85
9.45

Path Metric




0

1.22

1,1

S(00)

Input (b) : 1
Input (b) : 0

Viterbi Algorithm, Soft Decision
Received samples :
-0.8, 0.1, -1.2, 0.2, -0.1, 0.9, 0.4, -1.1, 0.2, 0.3, -0.9, -0.5
0.82

6.37

-1,1

S(11)
S(01)
S(10)

5.48

4.05


1.25
4.05
1

7.53
1.93
5.53
9.53
0

4.77
8.35
6.35
3.15
6.35

1

1.13
3.52
8.72
8.32
8.32

1

5.85
9.45
0

1,1

5.86
Path Metric




0

1.22

0

S(00)

Input (b) : 1
Input (b) : 0

: Decode Output

Thank You
Ade Irawan

ade.irawan@jaist.ac.jp