Viterbi decoder


A Viterbi decoder uses the Viterbi algorithm for decoding a bitstream that has been
encoded using a convolutional code or trellis code.
There are other algorithms for decoding a convolutionally encoded stream. The Viterbi algorithm is the most resource-consuming, but it does the maximum likelihood decoding. It is most often used for decoding convolutional codes with constraint lengths k≤3, but values up to k=15 are used in practice.
Viterbi decoding was developed by Andrew J. Viterbi and published in the paper
There are both hardware and software implementations of a Viterbi decoder.
Viterbi decoding is used in the iterative Viterbi decoding algorithm.

Hardware implementation

A hardware Viterbi decoder for basic code usually consists of the following major blocks:
A branch metric unit's function is to calculate branch metrics, which are normed distances between every possible symbol in the code alphabet, and the received symbol.
There are hard decision and soft decision Viterbi decoders. A hard decision Viterbi decoder receives a simple bitstream on its input, and a Hamming distance is used as a metric. A soft decision Viterbi decoder receives a bitstream containing information about the reliability of each received symbol. For instance, in a 3-bit encoding, this reliability information can be encoded as follows:
Of course, it is not the only way to encode reliability data.
The squared Euclidean distance is used as a metric for soft decision decoders.

Path metric unit (PMU)

A path metric unit summarizes branch metrics to get metrics for paths, where K is the constraint length of the code, one of which can eventually be chosen as optimal. Every clock it makes decisions, throwing off wittingly nonoptimal paths. The results of these decisions are written to the memory of a traceback unit.
The core elements of a PMU are ACS units. The way in which they are connected between themselves is defined by a specific code's trellis diagram.
Since branch metrics are always, there must be an additional circuit preventing metric counters from overflow. An alternate method that eliminates the need to monitor the path metric growth is to allow the path metrics to "roll over"; to use this method it is necessary to make sure the path metric accumulators contain enough bits to prevent the "best" and "worst" values from coming within 2 of each other. The compare circuit is essentially unchanged.
It is possible to monitor the noise level on the incoming bit stream by monitoring the rate of growth of the "best" path metric. A simpler way to do this is to monitor a single location or "state" and watch it pass "upward" through say four discrete levels within the range of the accumulator. As it passes upward through each of these thresholds, a counter is incremented that reflects the "noise" present on the incoming signal.

Traceback unit (TBU)

Back-trace unit restores an maximum-likelihood path from the decisions made by PMU. Since it does it in inverse direction, a viterbi decoder comprises a FILO buffer to reconstruct a correct order.
Note that the implementation shown on the image requires double frequency. There are some tricks that eliminate this requirement.

Implementation issues

Quantization for soft decision decoding

In order to fully exploit benefits of soft decision decoding, one needs to quantize the input signal properly. The optimal quantization zone width is defined by the following formula:
where is a noise power spectral density, and k is a number of bits for soft decision.

Euclidean metric computation

The squared norm distance between the received and the actual symbols in the code alphabet may be further simplified into a linear sum/difference form, which makes it less computationally intensive.
Consider a 1/2 convolutional coder, which generates 2 bits for every input bit. These Return-to-Zero signals are translated into a Non-Return-to-Zero form shown alongside.
code alphabetvector mapping
00+1, +1
01+1, −1
10−1, +1
11−1, −1

Each received symbol may be represented in vector form as vr =, where r0 and r1 are soft decision values, whose magnitudes signify the joint reliability of the received vector, vr.
Every symbol in the code alphabet may, likewise, be represented by the vector vi =.
The actual computation of the Euclidean distance metric is:
Each square term is a normed distance, depicting the energy of the symbol. For ex., the energy of the symbol vi = may be computed as
Thus, the energy term of all symbols in the code alphabet is constant.
The Add-Compare-Select operation compares the metric distance between the received symbol ||vr|| and any 2 symbols in the code alphabet whose paths merge at a node in the corresponding trellis, ||vi|| and ||vi||. This is equivalent to comparing
and
But, from above we know that the energy of vi is constant, and the energy of vr is the same in both cases. This reduces the comparison to a minima function between the 2 dot product terms,
since a operation on negative numbers may be interpreted as an equivalent operation on positive quantities.
Each dot product term may be expanded as
where, the signs of each term depend on symbols, vi and vi, being compared. Thus, the squared Euclidean metric distance calculation to compute the branch metric may be performed with a simple add/subtract operation.

Traceback

The general approach to traceback is to accumulate path metrics for up to five times the constraint length, find the node with the largest accumulated cost, and begin traceback from this node.
The commonly used rule of thumb of a truncation depth of five times the memory of a convolutional code is accurate only for rate 1/2 codes. For an arbitrary rate, an accurate rule of thumb is 2.5/ where r is the code rate.
However, computing the node which has accumulated the largest cost involves finding the maxima or minima of several numbers, which may be time consuming when implemented on embedded hardware systems.
Most communication systems employ Viterbi decoding involving data packets of fixed sizes, with a fixed bit/byte pattern either at the beginning or/and at the end of the data packet. By using the known bit/byte pattern as reference, the start node may be set to a fixed value, thereby obtaining a perfect Maximum Likelihood Path during traceback.

Limitations

A physical implementation of a viterbi decoder will not yield an exact maximum-likelihood stream due to quantization of the input signal, branch and path metrics, and finite traceback length. Practical implementations do approach within 1dB of the ideal.
The output of a Viterbi decoder, when decoding a message damaged by an additive gaussian channel, has errors grouped in error bursts.
Single-error-correcting codes alone can't correct such bursts, so either the convolutional code and the Viterbi decoder must be designed powerful enough to drive down errors to an acceptable rate, or burst error-correcting codes must be used.

Punctured codes

A hardware viterbi decoder of punctured codes is commonly implemented in such a way:
One of the most time-consuming operations is an ACS butterfly, which is usually implemented using an assembly language and appropriate instruction set extensions to speed up the decoding time.

Applications

The Viterbi decoding algorithm is widely used in the following areas: