advantage by priyaalagar


More Info
									 Appendix F                                                    Suboptimum Viterbi decoding

F.1 Introduction

Referring to Chapter 8 results, it can be seen that the delay experienced with the Viterbi decoder
can be reduced, but it is desirable to eliminate the delay entirely.

From the results obtained in Figures 8.x, it was found that total elimination of the delay cannot
be achieved in certain line codes, as these line codes will lose their accuracy when a small values
of the delay length is reached. Among the line codes that were found not to lose much accuracy
when the length of the Viterbi decoding delay was minimized is the AMI line code.

A C++ program to run Viterbi decoding without delay can be found in Appendix G. In the
following section, the advantages and disadvantages will be presented, and the possibility of
generating this method to other line codes will be investigated.

F.2 Viterbi decoding: AMI
                                   Figure F.1: AMI trellis diagram

 Appendix F                                                     Suboptimum Viterbi decoding

As mentioned in the previous chapter, the Viterbi Algorithm starts decoding only after a time
delay, so it is necessary to store the survivor path in a shift register from the start. The delay is
generally represented by a shift register, but in our simulation, we used a mathematical formula,
which converts binary to decimal and can be described in pseudocode as follows:
              Decimal = Decimal + (int) pow(2 lengt
In our example:
              tsp = (int) pow(2 5k) bit +
       tsp: temporary survivor path,
        sp: survivor path.

When we use the (sp/2) operation, we can shift the register to the right. Both tsp and sp are
binary, and their values will be stored in the memory of the computer. The value of sp is in fact
tsp after the selected path has been chosen and this can be done only after the selection of the
smallest metric smi from the trellis, as explained before. The values of smi will be the same as tmi
after the selection of the smallest value.

In the following sub-sections, we try to emphasize the difference between the two variants of
Viterbi decoding with and without the survivor path.
F.2.1 Viterbi decoding with a survivor path

Figure F.2 is a flow chart of Viterbi decoding with a survivor path.

                     Figure F.2: Flow chart of Viterbi decoding with delay

From the previous flow chart, it is clear that at each state j, we calculate the temporary smallest
metrics to be used in the calculation of the smallest metric. The same will be done with the
temporary survivor path as shown in box number 1. After saving the previous results in the
memory, we check if the counter of our program reaches the value of the length of the delay. If
not, the program repeats the same previous sequences and accumulates the results in the
memory. When we reach the delay value, our Viterbi decoder starts decoding (box 2). The first
step done by our decoder is the search for the smallest metric between all the states. Then from
the data of the survivor path saved in the memory through the mathematical formula, we
calculate the decoded value by means of a simple logic AND operation. If our message stream of
data does not reach the end, we continue from the beginning as shown in the flow chart. So, as
depicted in the flow chart, our Viterbi decoding is formed by three steps, which are:

   Testing the counter until the length of the delay is reached.

   Searching for the smallest metric between all states.

   Logic operation to calculate the selected path.

F.2.2 Viterbi decoding without a survivor path

 Appendix F                                                    Suboptimum Viterbi decoding

This method was used with AMI, with the idea of having a Viterbi decoder simpler than the one
using the delay in decoding. In fact, the elimination of the delay seems to imply that z equals
zero. If we use the same program used for decreasing the values of z, and we make z equal to
zero, then the Viterbi decoder with the same steps is obtained. But starting from the basic idea
that z can be eliminated, we are obliged to change the procedure of the program to make it
suitable to our purpose, which is what will be explained next:

Figure F.3 is a flow chart of Viterbi decoding without survivor path.

                     Figure F.3: Flow chart of Viterbi decoding without delay
It is clear from the flow chart of Viterbi decoding without a survivor path that the main changes
compared to the one with delay are in boxes 1 and 2.

In the previous method, we stored our survivor path in the memory through the mathematical
formula because of the delay length that does not allow us to decode our message at the
corresponding time. Now, while we do not have this delay, there is no reason to store it in the
memory. What will happen here, as explained in box number 1, is that we calculate and select
the smallest metric and we save our path with the right value at the same time. Box number 2
now represents the Viterbi decoding sequences for the new method. It is clear here that we do
not use the logic operation to obtain the selected path that is saved in the memory, but just after
finding the smallest metric among all the metrics of all states, the decoded value will be the same
value chosen at box number 1. We see from our flow chart how short it is compared to the
previous one.

As depicted in the flow chart, our Viterbi decoding is formed by two steps only, which are:

   Searching the smallest metric between all states.

   Calling up the value of hj.

F.2.3 Results

Both programs for the Viterbi decoding (with and without the delay) where used for the hard and
soft decisions. The results are shown in the following figures:

Figure F.4 shows the hard- and soft-decision simulations for AMI without delay.

                                Figure F.4: AMI: without delay
Figure F.5 shows the hard-decision simulation for AMI with and without delay.
                      Figure F.5: AMI: Hard decision with/without delay

Figure F.6 shows the soft-decision simulation for AMI with and without delay.

                       Figure F.6: AMI: Soft decision with/without delay

 Appendix F                                                      Suboptimum Viterbi decoding

It can be seen from Figure F.5 that Viterbi decoding for the hard decision is the same for both
without and with delay. In view of the precision of the soft decision, we see from Figure F.6 that
we lose gain if we decrease the length of the Viterbi decoding.

F.3 Implementation of Viterbi decoding on a DSP

The advantage of shortening the Viterbi delay and the results of its total elimination for the AMI
code, using a high level language, have been observed. It is clear how the advantages of
shortening the delay can affect the memory and the speed of Viterbi decoding. To exploit this
benefit and investigate it further, we used the TMS320C541 DSP [52], a Texas instrument
product, to program our Viterbi decoding with Assembly language and see the mapping of its
memory as a result of the shortening of its delay.

A program in Assembly was written to compare the two programs of Viterbi decoding for the
AMI, with and without delay. The results were very clear from the number of code lines in both
programs and the space reserved for the memory to run the Viterbi decoding. The results show
how Viterbi decoding without delay has less Assembly instructions and memory spaces used
than Viterbi decoding with delay.

Hence, the VD without delay will be faster than the VD with delay, as it has less program
instructions that lead to shorter execution time (TMS320C541 DSP has 9 ns execution time for
each instruction). From this we can deduce that minimizing the number of program instructions
will result in a faster decoder.

The elimination of certain instructions of read and write also leads us to a reduction of the power
used to run our Viterbi decoding.

Finally, from our results (more details in Appendix H), it is clear that the elimination or the
reduction of the Viterbi decoding delay has the following advantages:

•      Less memory used by the Viterbi decoding
•      Speeding up the Viterbi decoding
•      Less power required to run the Viterbi decoding

F.4 Viterbi decoding: HDB3

F.4.1 Problem statement

We have chosen the HDB3 line code to study this method because we know it is based on AMI.
It is also used in South Africa. Furthermore, it has a much larger number of states than AMI.
From the previous results obtained for the HDB3 line code, when we shortened the delay length,
we could see the smaller values of z could not be reached. From the previous curve, we saw how
the decoder lost its accuracy from z = 6 to z = 1. Thus, it will be difficult to reach the same result
as achieved with the AMI. As explained previously with the AMI program, a mathematical
inequality test is used to find the smallest metric in the two states of the AMI encoder. The

 Appendix F                                                    Suboptimum Viterbi decoding

question here is: does this mathematical test have the same validity and does it yield the same
results if we use more than two states?
In our case, we are going to use 32 states for HDB3. From a mathematical point of view,
whatever we are going to use: a strict inequality or large inequality, we are going to find
ourselves jumping many states, which have the same values of metrics but with different paths,
as will be explained in the following example:

Let us say we have the smallest metric at every state:

sm. is the smallest metric at state      0
sm. is the smallest metric at state      1
sm. is the smallest metric at state      2
.       .     .      .       .       .
.       .     .      .       .       .
.       .     .      .       .       .
sm31 is the smallest metric at state     31

At time t, we will test all these metrics to find out which is the smallest one among them to select
its corresponding path. Suppose that sm0 = sm1 = sm20 = sm30, and those metrics are the smallest
among all the others.

What is going to happen?

From the state diagram of HDB3, we can see which are the corresponding inputs for each state.

State 0: the path comes from state 1 and the corresponding input is 0.

State 1: the paths come from states 2 and 3, and the corresponding input is 0.

State 20: the paths come from states 00, 08, 24 and 25, and the corresponding inputs are 0, 0, 1
and 1.

State 25: the paths come from states 26 and 27, and the corresponding inputs are the same: 0.

Let us take as an example state 20, and the temporary metrics corresponding to each path are as

Path from state 0…………….tm0
Path from state 8…………….tm8
Path from state 24…………….tm24
Path from state 25…………….tm25

After testing the smallest one, we find for example that tm8 is the smallest so the corresponding
input that we have to save is related to our program: 1. So when our mathematical inequality test
starts comparing them, our test is going to stop at sm0 or sm25, depending on the kind of
inequality used: large or strict, and in both results, we skip a result different to what we have,

 Appendix F                                                    Suboptimum Viterbi decoding

which is corresponding to input 1. So when we obtain more states as shown for HDB3, we have
a greater probability of obtaining incorrect results. This is why incorrect results will be obtained
with this method if used with the HDB3 line code.

F.4.2 Results

The results of our simulations confirmed the expected. The decoder loses its accuracy when we
eliminate its delay.

Figure F.7 shows the results of the simulation for HDB3 with and without a delay.

                    Figure F.7: HDB3: Soft/hard decision with/without delay

F.5 Conclusion

We can conclude with the following comparison between the VD with a delay and without a
delay. For more details on the use of memories, see Appendix H.

                                        Advantages                     Disadvantages
   VD without delay                  No delay in decoding.          Not useful for more than
                                     Decoding starts at the     state diagrams with more than
                                first bit and ends at the       two states, like HDB3 (32
                                     last                       states)

Appendix F                                           Suboptimum Viterbi decoding

                             AMI results in hard
                         decisions for VD with or       Less precision than VD
                         without delay are           with delay in soft decision

                            Less memory spaces

                            Less power use

                            Faster decoder
    VD with delay
                             In general, more            Starts decoding at 5k
                         precision than VD without       k: constraint length
                         delay for soft decisions
                                                          Sends zeros at the end of
                                                      the input to recover the last
                                                      input bits

             Table F.1: Comparison between VD with and without delay


To top