Friday, April 12, 2013

Efficient implementation of a Viterbi decoder

Since there is already a lot of material available on the web explaining Viterbi decoder, I will not waste time explaining it again. The Viterbi Algorithm has mainly 3 units:

  1. Branch Metric Unit (BMU)
  2. Path Metric Unit (PMU)
  3. Traceback Unit (TU)
The most time-consuming operation is the Add-Compare-Select operation which is part pf PMU. Traceback is comparatively less time-consuming.

I wrote a small C program for a hard-decision Viterbi decoder for a 1/2 rate Convolutional code. This code is written optimally so that the porting can be done for available DSP processors which have parallel instruction support (like doing add and subtract in the same cycle) or those who have in-built instruction support to carry out the ACS and traceback.

For soft-decision decoder there can be more optimization possible in the calculation of the branch-metrics for which I will discuss in the next issue. To summarize, this code has optimal implementation for the PMU and TU parts of Viterbi decoder.

The C code is uploaded here.