ADC22 04 02 Viterbi

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Digital Communication

Electrical & Computer Eng. Dept.


Isfahan University of Technology
Isfahan University
of Technology

Lecture Four:

EQUALIZATION
Viterbi Algorithm

Digital Communications - M.J. Omidi 2


Viterbi Algorithm
Isfahan University
of Technology
Andrew Viterbi
March 9, 1935 (age 82) Bergamo, Italy

Education
Massachusetts Institute of Technology (BS, MS)
University of Southern California (PhD)

Significant advance
Code Division Multiple Access standard for cell phone
networks

Awards
IEEE Alexander Graham Bell Medal (1984)
Marconi Prize (1990)
Claude E. Shannon Award (1991)
National Medal of Science (2007)
IEEE/RSE Wolfson James Clerk Maxwell Award
IEEE Medal of Honor (2010)
John Fritz Medal (2011)

Digital Communications - M.J. Omidi 3


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2 of Technology

 There are MN=4 states.


1 1

Digital Communications - M.J. Omidi 4


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2 of Technology

 There are MN=4 states.


1 1

-1 1
Input
-1/-2 -1/-2
…-1 1 1 -1…
-2 0 2
-1,-1 -1/0 1,-1 …0 2 0… Output

1/0 -1/0
1/0 -2 0 2
Input / Output
-1,1 1,1 Noisy
Output
1/2 1/2
Less Euclidian distance = More Likelihood

Digital Communications - M.J. Omidi 5


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2 of Technology

 There are MN=4 states.

-1/-2
-1,-1 -1,-1
-1/-2 1/0
-1/-2

-1/-2
-1,-1 -1/0 1,-1 -1, 1 -1, 1
1/0

1/0 -1/0 -1/0


1/0
1,-1 1,-1
Input / Output
-1,1 1,1
-1/0 1/2
1/2 1/2

1,1 1/2 1,1

State Diagram Trellis Diagram

Digital Communications - M.J. Omidi 6


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2. of Technology

 There are MN=4 states.


1
0.5

Digital Communications - M.J. Omidi 7


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2 of Technology

 There are MN=4 states.


1
0.5

-1 1

Input
-1/-1.5 -1/-1.5
…-1 1 1 -1…
-1.5 -1 -0.5 0.5 1 1.5

-1,-1 -1/-0.5 1,-1 … 0.5 1.5 -0.5… Output

1/0.5 -1/-0.5
1/0.5 -1.5 -1 -0.5 0.5 1 1.5
Input / Output
-1,1 1,1 Noisy
Output
1/1.5 1/1.5
Less Euclidian distance = More Likelihood

Digital Communications - M.J. Omidi 8


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2 of Technology

 There are MN=4 states.

-1/-1.5
-1/-1.5 -1/-1.5 -1,-1 -1,-1
1/0.5

-1/-1.5
-1/-0.5
-1,-1 1,-1
-1, 1 -1, 1
1/0.5

1/0.5 -1/-0.5
-1/-0.5
1/0.5

Input / Output 1,-1 1/1.5 1,-1


-1,1 1,1
-1/-0.5
1/1.5 1/1.5

1/1.5
1,1 1,1

State Diagram Trellis Diagram

Digital Communications - M.J. Omidi 9


ISI from Channel Impulse Response (CIR)
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=3. of Technology

 There are MN=8 states.


1
0.5

-0.3

Digital Communications - M.J. Omidi 10


ISI from Convolutional Coding
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=2. of Technology

 There are MN=4 states.


0/0
ak ak-1 00 00
Z-1 1/1

1 1 ck 01
0/0
1/1 01
XOR 0/1
1/0 10
10
0/1
Input: 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0 1/0
11 11
Output: 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1
Trellis Diagram

Matlab Code:
a = [1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0];
trellis = poly2trellis([2], [3]); %(11)b=3
b1 = convenc(a, trellis);

Digital Communications - M.J. Omidi 11


ISI from Convolutional Coding
Isfahan University
 Input alphabet is binary (M=2) and size of the channel memory N=4. of Technology

 There are MN=16 states.

ak ak-1 ak-2 ak-3


Z-1 Z-1 Z-1

1 1 0 1 ck
XOR

Input: 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0
Output: 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1

Matlab Code:
a = [1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0];
trellis = poly2trellis([4], [13]); %(1101)b =13
b1 = convenc(a, trellis);

Digital Communications - M.J. Omidi 12


Professor X chooses an optimum
Find optimal path to each bridge
Example-Principle oftoOptimality
path on his trip lunch
Isfahan University
of Technology

River 2
River 1
1.2 N .2
.7
1.3
.5 N
Faculty
1.2 Club
.5

EE Bld Optimal: 6 adds N bridges .3


Brute force:8 adds .5 Optimal: 4(N+1) adds
Brute force: (N-1)2N adds
S
.8 .8 1.0
S .8
Finite State Machine and the Trellis Diagram
Isfahan University
of Technology

 With the assumption of finite memory, the received signal without


noise is generated by a finite-state machine.
 Let’s define the state at time k by the vector of N previous inputs:
Sk= {ak-1, ak-2, …, ak-N} Number of states :L = MN
 Example: BPSK modulation (M=2) and convolutional coding of
ck=ak+ak-1

010011 010011 010011 010011 010011


00

01

10

11

010011

Digital Communications - M.J. Omidi 14


Trellis Diagram and the Shortest Path
Isfahan University
Example: QPSK modulation (M=4) of Technology

a0

a1

a2

a3

a3 a2 a0 a3 a1

 A sequence of branches through the trellis diagram is called a path. Every


path corresponds to a unique input sequence.

 After observing the received noisy signal zk, we can assign a number to
each branch (branch metric) that is low if zk is close to the expected value
on that transition, sk.
Branch metric = |zk-sk|2

 The path metric is the sum of branch metrics, and the preferred path is
the one with lowest path metric (shortest path).
Digital Communications - M.J. Omidi 15
Using VA to find the shortest path
Isfahan University
of Technology

 An exhaustive method is to find all the branch metrics and all the
possible path metrics. This method grows exponentially with time (T).

 Viterbi algorithm uses the structure of the trellis to achieve a complexity


that grows linearly with T (Constant computation rate per unit time).

 VA assigns a value to each node (Node Value) that is the sum of


smallest partial path metrics to the left of that node.

 To find the node value for S0 at Kn+1, we calculate Kn Kn+1


s0 1
the sum of all incoming branch metrics with their 10 9
2
original node values to find the minimum as the s1
8 4
survivor path.
s2
5 5
 In this example (10+1), (8+2), (5+4), and (7+5) are s3
compared and the minimum (5+4) is selected as 7
the survivor path to determine the node value at
the next stage.

Digital Communications - M.J. Omidi 16


Matrix form representation for VA
Isfahan University
of Technology

Digital Communications - M.J. Omidi 17


How to end-up decoding?
Isfahan University
of Technology
 The input register can be finally filled with zeros thus finding the
minimum distance path
 In practice with long code words zeroing requires feeding of long
sequence of zeros to the end of the message bits:
 this wastes channel capacity & introduces delay
 We need to wait to the end of data to be able for detection
 To avoid this path memory truncation is applied:
 Trace all the surviving paths to the
depth where they merge
 Figure shows a common point
at a memory depth J
 J is a random variable whose applicable
magnitude shown in the figure (5L)
has been experimentally tested for
negligible error rate increase
 Note that this also introduces the J  5L stages of the trellis
delay of 5L!
Digital Communications - M.J. Omidi 18
Viterbi Algorithm depth
Isfahan University
of Technology

All paths merge

Digital Communications - M.J. Omidi 19


Isfahan University
of Technology

Digital Communications - M.J. Omidi 20


Viterbi Algorithm depth
Isfahan University
of Technology

 At each stage of the trellis we do not know which node the optimal path
passes through, so we must retain one survivor path for each node.

 The computational complexity of the Viterbi Algorithm is the same at each


time increment, and hence the total computational complexity is proportional
to the length of time T.

 Practical problems:
 To find the optimal path we need to wait to get to the terminal point of the trellis.

 The memory required to store the survivor paths grows linearly with time.

 If the survivor paths at time k merge up to some time k-d, we say they
merged at depth d.

 In practice we have to make a truncation at time k by finding the minimum of


path metrics at t=k and make the decision based on the state transitions of
this surviving path up to k-d.
 There is no need to store the survivor paths beyond the depth of d transitions.
Digital Communications - M.J. Omidi 21
Viterbi Algorithm -1,-1
-1/-1.5 -1,-1
1/-0.5
Isfahan University
of Technology
-1/-1.5 -1, 1
-1, 1
1/-0.5
Input: 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1
Channel Output 1 -0.5 0.5 -0.5 0.5 1.5 -0.5 -1.5 -1.5 0.5 -0.5 0.5 1.5 -1/0.5
1,-1 1/1.5 1,-1
Noisy output: 0.7 -0.3 0.7 -0.7 0.5 1.4 -0.3 -0.9 -1.8 0.4 -0.2 0.5 1.7
-1/0.5

1,1 1/1.5 1,1

22
Isfahan University
of Technology

Digital Communications - M.J. Omidi 23


Viterbi Algorithm
Input: 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 Isfahan University
Channel Output 1 -0.5 0.5 -0.5 0.5 1.5 -0.5 -1.5 -1.5 0.5 -0.5 0.5 1.5 of Technology

Noisy output: 0.7 -0.3 0.7 -0.7 0.5 1.4 -0.3 -0.9 -1.8 0.4 -0.2 0.5 1.7

Digital Communications - M.J. Omidi 24


Isfahan University
of Technology

Digital Communications - M.J. Omidi 25


Convolutional Codes
Isfahan University
of Technology

 Convolutional encoder contains delay lines and modulo-2 adders such that
at each encoding cycle
 k information bits flow in, in parallel

 n coded bits flow out, in parallel

 Each output bit depends on the corresponding input bits and the
previous input bits of maximum
 Usually n > k and it adds redundancy to the data

k bits . . n bits
Code rate k/n
. .

Digital Communications - M.J. Omidi 26


Convolutional Codes
Isfahan University
of Technology

 Example 1: rate 2/3 code

 Example 2: rate ½ code

 trellis = poly2trellis([3], [5]);


 C(1) = convenc( trellis , B) 1 0 1
1 1 1
 trellis = poly2trellis([3], [7]);
 C(2) = convenc( trellis , B)

Digital Communications - M.J. Omidi 27


WiFi Convolutional Coder
Isfahan University
poly2trellis([7], [91]) of Technology

poly2trellis([7], [121])

Rate 3/4 code Rate 2/3 code

Digital Communications - M.J. Omidi 28


Computation of branch metric
Isfahan University
of Technology

 For analog case (ISI from Channel) :

 Branch metric is the Euclidian distance between the received sample


and the expected channel output on the branch:

Received value: 1.7 Branch metric: ||-2 – 1.7|| = 3.7

-1/-2

 For binary case (ISI from Coding):

 Branch metric is the Hamming distance between the received sequence


and the expected channel output on the branch:

Received value: 1101 Branch metric: 2 1/1110

Digital Communications - M.J. Omidi 29

You might also like