21
Viterbi Algorithm - Implementation Lecture 14 6.973 Communication System Design – Spring 2006 Massachusetts Institute of Technology Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/), Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Embed Size (px)

Citation preview

Page 1: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Viterbi Algorithm - Implementation

Lecture 14

6.973 Communication System Design – Spring 2006

Massachusetts Institute of Technology

Vladimir Stojanović

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 2: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Convolutional Codes

� Adding redundancy

D D

+

+

di di-1 di-2

Channel

0110

1+D2

1+D+D2

0111

0100

(00, 11, 10, 10)

� Generators:G1 = 101

G2 = 111

6.973 Communication System Design 2 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 3: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Decisions at Each Step

00

01

10

11

State (path) metrics

Branch metrics

i i+1 i+2 � In Gaussian channel: bm = (yk – sk)2

� In BSC:bm = dH(yk, sk) = |yk –sk|

dH is Hamming distance � If received yk = 10

dH(10, 00) = 1 dH(10, 01) = 2

6.973 Communication System Design 3 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 4: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Trellis Diagram

� Time-indexed state diagram

i i+1 i+2 i+3 i+4

00

01

10

11

0/00

1/11

0/00

1/11

0/11

1/00

6.973 Communication System Design 4 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 5: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

The Viterbi Algorithm

� Illustrated by 2-state trellis sm1n−1 sm1nbm1

bm2 bm3

sm2n−1 bm4 sm2n

tn−1 tn time

sm1n = min (sm1n−1 + bm1, sm2n−1 + bm3) sm2n = min (sm1n−1 + bm2, sm2n−1 + bm4)

Add Add Select Compare

6.973 Communication System Design 5 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 6: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Viterbi Decoder� Implements Viterbi algorithm � Three main components

� Branch metric calculation � Path metric accumulation (add-compare-

select recursion) � Survivor path decode

6.973 Communication System Design 6 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 7: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Viterbi Decoder

D

Branch metrics

unit

Add-Compare-

Select

Survivor path

decode

Inputs Decoded bits

� Branch metrics unit � Calculates the distances between the received signal

and the ideal signals � Add-Compare-Select unit

� Accumulates path metrics � Survivor path decode

� Keeps track of the path through the trellis 6.973 Communication System Design 7

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 8: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Calculating Branch Metrics

� Assume G1 and G2 both output a 0 � Soft decoder inputs are 0.1 and 0.25 instead � Branch metrics:

� bm00 = |0 – 0.1| + |0 – 0.25| = 0.35

� bm01 = |0 – 0.1| + |1 – 0.25| = 0.85

� bm10 = |1 – 0.1| + |0 – 0.25| = 1.15

� bm11 = |1 – 0.1| + |1 – 0.25| = 1.65

6.973 Communication System Design 8

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 9: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Calculating Branch Metrics

� Euclidean distances (AWGN channel) � bmi = (yk – sk)2

� sk are usually integers bmi = yk

2 -2Ciyk + Ci 2

� Since yk terms are common to all branch metrics they drop out in ACS comparison, and can be eliminated.

� Ci 2 are precomputed and 2Ciyk are shifts and

adds.

6.973 Communication System Design 9 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 10: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursion

Eight state trellis Conventional add-compare-select unit

6.973 Communication System Design 10 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 11: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursion

Adder

Adder

Subtractor

2:1 Multiplexer

Register

sm1 sm2

bm1

bm2

MSB

Decision New State Metric

5

5

8 8

8 8

8

6.973 Communication System Design 11

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/)

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

,

Page 12: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursion

bm2 sm2

0

bm1 0

sm1 0

0

sm2 1

bm2 1

sm2 2

bm2 2

sm2 3

bm2 3

sm2 4

bm2 4

sm2 5

sm2 6

sm2 7

+

+

+

+

+

+

+

+

+ −

+

+

+

+

+

+

+

sm1 4

bm1 1

bm1 2

bm1 3

bm1 4

sm1 5

sm1 6

sm1 7

diff

sm 7

sm 6

sm 5

sm 4

sm 3

sm 2

sm 1

sm 0

6.973 Communication System Design 12 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 13: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursion

Time

Bit

1 2 3 4 5 6 70

Select

Register

Register

Add

C C

C C

C C

C C

6.973 Communication System Design 13 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 14: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursion

Radix-4 applied to an eight-state trellis add-compare-select unit

One step lookahead

6.973 Communication System Design 14

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 15: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursionsm3sm1 sm2 sm4

8 8 88

bm1 Adder

5

bm2

5

bm34-way ACS: 5

2 additions + bm4

6 comparisons 5

6.973 Communication System Design Decision 8New State Metric

Adder

Subtractor

4:1 Multiplexer

Register

MSB

Adder

Subtractor

Subtractor

Sele

ct

MSB

MSB

Adder

Subtractor

Subtractor

Subtractor

MSB

MSB

MSB

Inhi

bit s

m3

Inhi

bit s

m48 8 8 8

15 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 16: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

2-state example

6.973 Communication System Design 16 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Figure from Fettweis, G., and H. Meyr. "High-speed Parallel Viterbi Decoding: Algorithm and VLSI-architecture."IEEE Communications Magazine 29 (1991): 46-55. Copyright 1991 IEEE. Used with permission.

Page 17: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

6.973 Communication System Design 17 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Figure from Fettweis, G., and H. Meyr. "High-speed Parallel Viterbi Decoding: Algorithm and VLSI-architecture."IEEE Communications Magazine 29 (1991): 46-55. Copyright 1991 IEEE. Used with permission.

Page 18: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Bit-level view

MSB

LSB

6.973 Communication System Design 18 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Figure from Fettweis, G., and H. Meyr. "High-speed Parallel Viterbi Decoding: Algorithm and VLSI-architecture."IEEE Communications Magazine 29 (1991): 46-55. Copyright 1991 IEEE. Used with permission.

Page 19: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Turn into forward path and pipeline

6.973 Communication System Design 19

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/), Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Figures from Fettweis, G., and H. Meyr. "High-speed Parallel Viterbi Decoding: Algorithm and VLSI-architecture."IEEE Communications Magazine 29 (1991): 46-55. Copyright 1991 IEEE. Used with permission.

Page 20: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

Add-Compare-Select Recursion

Parallel compare-select-add unit 6.973 Communication System Design 20

Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].

Page 21: Lecture 14 Vladimir Stojanović - MIT OpenCourseWare ·  · 2017-12-28Vladimir Stojanović Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring

References

� Slides from Borivoje Nikolic and Bob Brodersen � G. Fettweis and H. Meyr "High-speed parallel

Viterbi decoding: algorithm and VLSI-architecture," Communications Magazine, IEEEvol. 29, no. 5, pp. 46-55, 1991.

6.973 Communication System Design 21 Cite as: Vladimir Stojanovic, course materials for 6.973 Communication System Design, Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/),

Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].