Vite Rbi

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

‫استخداماته الحالية‬

the Viterbi Algorithm, are currently used in about one billion cellphones, which is
probably the largest number in any application. However, the largest current consumer of
Viterbi algorithm processor cycles is probably digital video broadcasting. A recent
estimate at Qualcomm is that approximately 1015 bits per second are now being decoded
by the Viterbi algorithm in digital TV sets around the world, every second of every day.
Nowadays, they are also used in Bluetooth implementations.

Basic Idea of Viterbi Algorithm


 There are 2rm code sequences in Cm .
 This number of sequences approaches infinity as m
becomes large
 Instead of searching through all possible sequences,
find the best code sequence "one stage at a time"

The Viterbi Algorithm


• Walk through the trellis and compute the
Hamming distance between that branch of r and
those in the trellis.
• At each level, consider the two paths entering the
same node and are identical from this node
onwards. From these two paths, the one that is
closer to r at this stage will still be so at any time
in the future. This path is retained, and the other
path is discarded.
• Proceeding this way, at each stage one path will
be saved for each node. These paths are called
the survivors. The decoded sequence (based on
MDD) is guaranteed to be one of these survivors.
• Each survivor is associated with a metric of the
accumulated Hamming distance (the Hamming
distance up to this stage).
• Carry out this process until the received
sequence is considered completely. Choose the
survivor with the smallest metric.
• The viterbi algorithm is used to decode
convolutional codes and any structure or system
that can be described by a trellis.
• It is a maximum likelihood decoding algorithm
that selects the most probable path that
maximizes the likelihood function.
• The algorithm is based on add-compare-select
the best path each time at each state
7convolutionalcode.ppt slide10

The Viterbi algorithm



 It processes the demodulator outputs in an iterative
manner.
 At each step in the trellis, it compares the metric of all
paths entering each state, and keeps only the path with the
largest metric, called the survivor, together with its metric.
 It proceeds in the trellis by eliminating the least likely
paths.
 Viterbi algorithm:
A. Do the following set up:
 Fora data block of L bits, form the trellis. The trellis
has L+K-1 sections or levels and starts at time and
ends up at time .
 Label all the branches in the trellis with their
corresponding branch metric.
 For each state in the trellis at the time which is
denoted by , define a parameter
B. Then, do the following:

1. Set and
2. At time , compute the partial path metrics for
all the paths entering each state.
3. Set equal to the best partial path metric
entering each state at time .
Keep the survivor path and delete the dead
paths
from the trellis.
4. If , increase by 1 and return to step 2.
C. Start at state zero at time . Follow
the
surviving branches backwards through
the trellis. The path thus defined is
unique and correspond to the ML
codeword.
Maximum Likelihood and Viterbi decoding
The Viterbi decoder examines an entire received sequence of a given length. The decoder
computes a metric for each path and makes a decision based on this metric. All paths are
followed until two paths converge on one node. Then the path with the higher metric is kept and
the one with lower metric is discarded. The paths selected are called the survivors.
For an N bit sequence, total numbers of possible received sequences are 2 N. Of these only 2kL are
valid. The Viterbi algorithm applies the maximum-likelihood principles to limit the comparison
to 2 to the power of kL surviving paths instead of checking all paths.
The most common metric used is the Hamming distance metric. This is just the dot product
between the received codeword and the allowable codeword. Other metrics are also used and we
will talk about these later.

Table 5 . Each branch has a Hamming metric depending on what was received and the valid
codewords at that state

These metrics are cumulative so that the path with the largest total metric is the final winner.

But all of this does not make much sense until you see the algorithm in operation.

Let.s decode the received sequence 01 11 01 11 01 01 11 using Viterbi decoding.

1. At t = 0, we have received bit 01. The decoder always starts at state 000. From this point it has
two paths available, but neither matches the incoming bits. The decoder computes the branch
metric for both of these and will continue simultaneously along both of these branches in contrast
to the sequential decoding where a choice is made at every decision point. The metric for both
branches is equal to 1, which means that one of the two bits was matched with the incoming bits.

2. At t = 1, the decoder fans out from these two possible states to four states. The branch metrics
for these branches are computed by looking at the agreement with the codeword and the incoming
bits which are 11. The new metric is shown on the right of the trellis.

3. At t = 2, the four states have fanned out to eight to show all possible paths. The path metrics
calculated for bits 01 and added to pervious metrics from t = 1.
At t = 4, the trellis is fully populated. Each node has at least one path coming into it. The metrics
are as shown in the figure above.
At t = 5, the paths progress forward and now begin to converge on the nodes. Two metrics are
given for each of the paths coming into a node. Per the Maximum likelihood principle, at each
node we discard the path with the lower metric because it is least likely. This discarding of paths
at each node helps to reduce the number of paths that have to be examined and gives the Viterbi
method its strength

Now at each node, we have one or more path converging. The metrics for all paths are given on
the right. At each node, we keep only the path with the highest metric and discard all others,
shown in red. After discarding the paths with the smaller metric, we have the following paths left.
The metric shown is that of the winner path.
At t = 5, after discarding the paths as shown, we again go forward and compute new metrics. At
the next node, again the paths converge and again we discard those with lower metrics.

At t= 6, the received bits are 11. Again the metrics are computed for all paths. We discard all
smaller metrics but keep both if they are equal.
The 7-step trellis is complete. We now look at the path with the highest metric. We have a
winner. The path traced by states 000, 100, 010, 101, 110, 011, 001, 000 and corresponding to
bits 1011000 is the decoded sequence.

The length of this trellis was 4bits + m bits. Ideally this should be equal to the length of the
message, but by a truncation process, storage requirements can be reduced and decoding need not
be delayed until the end of the transmitted sequence. Typical Truncation length for convolutional
coders is 128 bits or 5 to 7 times the constraint length.
Viterbi decoding is quite important since it also applies to decoding of block codes. This form of
trellis decoding is also used for Trellis-Coded Modulation (TCM).
Soft-decision decoding
The spectrum of two signals used to represent a 0 and 1 bit when corrupted by noise makes the
decision process difficult. The signal spreads out and the energy from one signal flows into the
other. Fig 13 b, c, shows two different cases for different S/N. If the added noise is small, i.e. its
variance is small (since noise power = variance), then the spread will be smaller as we can see in
c as compared to b. Intuitively we can see from these pictures that we are less likely to make
decoding errors if the S/N is high or the variance of the noise is small.

Making a hard decision means that a simple decision threshold which is usually between the two
signals is chosen, such that if the received voltage is positive then the signal is decoded as a 1
otherwise a 0. In very simple terms this is also what the Maximum likelihood decoding means.
We can quantify the error that is made with this decision method. The probability that a 0 will be
decoded, given that a 1 was sent is a function of the two shaded areas you see in the figure above.
The area 1 represent that energy belonging to the signal for 1 that has landed in the opposite
decision region and hence erroneously leads to the decoding of bit as a 0 and area 2 which is the
energy from the bit 0 that has landed in the region of interest. It subtracts from the voltage
received hence it too potentially causing an error in decision.
Given that a 1 was sent, the probability that it will be decoded as 0 is

vt = decision threshold voltage, which is 0 for our case.


= Variance of noise or its power.
We can rewrite this equation as a function of S/N

This is the familiar bit error rate equation. We see that it assumes that hard-decision is made. But
now what if we did this; instead of having just two regions of decision, we divided the area into 4
regions as shown below.

I have picked four regions as follows:


Region 1 = if received voltage is greater than .8 v
Region 2 = if received voltage is greater than 0 but less than .8 v
Region 3 = if received voltage is greater than -.8 v but less than 0 v
Region 4 = if received voltage is less than -.8 v
Now we ask? If the received voltage falls in region 3, then what is probability of error that a 1
was sent?
With hard-decision, the answer is easy. It can be calculated from the equation above. How do we
calculate similar probabilities for a multi-region space?
We use the Q function that is tabulated in many books. The Q function gives us the area under the
tail defined by the distance from the mean to any other value. So Q(2) for a signal the mean of
which is 2 would give us the probability of a value that is 4 or greater.

I have assumed a vt of .8 (this is a standard sort of number for 4-level) but it can be any number.
The equations can be written almost by inspection, they are so obvious.
Pe1 (probability that a 1 was sent if the received voltage is in Region 1) = 1 . Q(A- v t /)
Pe4 (probability that a 1 was sent if the received voltage is in Region 4) = Q(2(A+v t)/ )
Pe2 (probability that a 1 was sent if the received voltage is in Region 2) = 1- Pe1-Q(A/ )
Pe3 (probability that a 1 was sent if the received voltage is in Region 3) = 1- Pe1- Pe2 . Pe4
I have computed these for S/N = 1 assuming that vt is .8A and A = 1.0. We have also assumed
that both bits 0 and 1 are equiprobable. This is also called the apriori probabilities for bits 0 and 1
and these are nearly always assumed to be equal in communications except in Radar applications,
where apriori probabilities are usually not known.
So the area of Region 4 or Pe4 is equal to Q(1.8) which we can look up from the Tables.
The area of Region 1 is then equal to 1-Q(.2). The others can be quickly calculated in this
manner. We can show the conditional probabilities calculated in a graphically manner.

This process of subdividing the decision space into regions greater than two such as this 4-level
example is called soft-decision. These probabilities are also called the transition probabilities.
There are 4 different values of voltage for each signal received with which to make a decision. In
signals, as in real life, more information means better decisions. Soft-decision improve the
sensitivity of the decoding metrics and improves the performance by as much as 3 dB in case of
8- level soft decision.
Now to compute soft decision metric we make a table of the above probabilities.

Now take the natural log of each of these and normalize so that one of the values is 0. After some
number manipulation, we get

In the decoding section, we calculated a Hamming metric by multiplying the received bits with
the codewords. We do the same thing now, except, instead of receiving 0 and 1, we get one of
these voltages. The decoder looks up the metric for that voltage from a table such as above it has
in its memory and makes the following calculation.
Assume voltage pair (v3, v2) are received. The allowed codewords are 01, 10.
Metric for 01 = p(0|v3) + p(1|v2) = -4 + -4 = -8
Metric for 10 = p(1|v3) + p(0|v2) = -1 + -1 = -2
We can tell just by looking at these two that 01 is much more likely than 10. When these metric
add, they exaggerate the differences and help the decoding results.

You might also like