A Viterbi decoder uses the
Viterbi algorithm
The Viterbi algorithm is a dynamic programming algorithm for obtaining the maximum a posteriori probability estimate of the most likely sequence of hidden states—called the Viterbi path—that results in a sequence of observed events, especiall ...
for decoding a bitstream that has been
encoded using a
convolutional code
In telecommunication, a convolutional code is a type of error-correcting code that generates parity symbols via the sliding application of a boolean polynomial function to a data stream. The sliding application represents the 'convolution' of t ...
or
trellis code.
There are other algorithms for decoding a convolutionally encoded stream (for example, the
Fano algorithm Recognised by John Wozencraft, sequential decoding is a limited memory technique for decoding tree codes. Sequential decoding is mainly used as an approximate decoding algorithm for long constraint-length convolutional codes. This approach may ...
). The Viterbi algorithm is the most resource-consuming, but it does the
maximum likelihood
In statistics, maximum likelihood estimation (MLE) is a method of estimation theory, estimating the Statistical parameter, parameters of an assumed probability distribution, given some observed data. This is achieved by Mathematical optimization, ...
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
Andrew James Viterbi (born Andrea Giacomo Viterbi, March 9, 1935) is an American electrical engineer and businessman who co-founded Qualcomm Inc. and invented the Viterbi algorithm. He is the Presidential Chair Professor of Electrical Engineeri ...
and published in the paper
There are both hardware (in modems) and software implementations of a Viterbi decoder.
Viterbi decoding is used in the
iterative Viterbi decoding Iterative Viterbi decoding is an algorithm that spots the subsequence ''S'' of an observation ''O'' = having the highest average probability (i.e., probability scaled by the length of ''S'') of being generated by a given hidden Markov model ''M'' w ...
algorithm.
Hardware implementation
A hardware Viterbi decoder for basic (not punctured) code usually consists of the following major blocks:
*Branch metric unit (BMU)
*Path metric unit (PMU)
*Traceback unit (TBU)
Branch metric unit (BMU)
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
In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number of ''substitutions'' required to chan ...
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
In mathematics, the Euclidean distance between two points in Euclidean space is the length of a line segment between the two points.
It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefor ...
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 (Add-Compare-Select)'' 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 (not shown on the image) 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
(n-1) 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 (almost) maximum-likelihood path from the decisions made by PMU. Since it does it in inverse direction, a viterbi decoder comprises a FILO (first-in-last-out) 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
Naturally occurring radioactive materials (NORM) and technologically enhanced naturally occurring radioactive materials (TENORM) consist of materials, usually industrial wastes or by-products enriched with radioactive elements found in the envi ...
(
) 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 code
In telecommunication, a convolutional code is a type of error-correcting code that generates parity symbols via the sliding application of a boolean polynomial function to a data stream. The sliding application represents the 'convolution' of t ...
, which generates 2 bits (''00'', ''01'', ''10'' or ''11'') for every input bit (''1'' or ''0''). These ''Return-to-Zero'' signals are translated into a ''Non-Return-to-Zero'' form shown alongside.
Each received symbol may be represented in vector form as v
r = , where r
0 and r
1 are soft decision values, whose magnitudes signify the ''joint reliability'' of the received vector, v
r.
Every symbol in the code alphabet may, likewise, be represented by the vector v
i = .
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 v
i = may be computed as
:
Thus, the energy term of all symbols in the code alphabet is constant (at (''normalized'') value 2).
The ''Add-Compare-Select'' (''ACS'') operation compares the metric distance between the received symbol , , v
r, , and any 2 symbols in the code alphabet whose paths merge at a node in the corresponding trellis, , , v
i(0), , and , , v
i(1), , . This is equivalent to comparing
:
and
:
But, from above we know that the ''energy'' of v
i is constant (equal to (normalized) value of 2), and the ''energy'' of v
r is the same in both cases. This reduces the comparison to a minima function between the 2 (middle) ''
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
'' terms,
:
since a operation on negative numbers may be interpreted as an equivalent operation on positive quantities.
Each ''
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
'' term may be expanded as
:
where, the signs of each term depend on symbols, v
i(0) and v
i(1), 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 (5 (''K'' - 1)), 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 (constraint length ''K''-1) of a convolutional code is accurate only for rate 1/2 codes. For an arbitrary rate, an accurate rule of thumb is 2.5(''K'' - 1)/(1−''r'') where ''r'' is the code rate.
However, computing the node which has accumulated the largest cost (either the largest or smallest integral path metric) involves finding the ''maxima'' or ''minima'' of several (usually 2
''K''-1) 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
The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
/
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
pattern either at the beginning or/and at the end of the data packet. By using the known
bit
The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
/
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
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 1 dB 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.
[
Curry, S. J.; Harmon, W. D]
"A bound on Viterbi decoder error burst length"
Single-error-correcting codes alone can't correct such bursts, so either the
convolutional code
In telecommunication, a convolutional code is a type of error-correcting code that generates parity symbols via the sliding application of a boolean polynomial function to a data stream. The sliding application represents the 'convolution' of t ...
and the Viterbi decoder must be designed powerful enough to drive down errors to an acceptable rate, or
burst error-correcting code
In coding theory, burst error-correcting codes employ methods of correcting burst errors, which are errors that occur in many consecutive bits rather than occurring in bits independently of each other.
Many codes have been designed to correct rand ...
s must be used.
Punctured codes
A hardware viterbi decoder of ''
punctured codes'' is commonly implemented in such a way:
* A depuncturer, which transforms the input stream into the stream which looks like an original (non punctured) stream with ERASE marks at the places where bits were erased.
* A basic viterbi decoder understanding these ERASE marks (that is, not using them for branch metric calculation).
Software implementation
One of the most time-consuming operations is an ACS butterfly, which is usually implemented using an
assembly language
In computer programming, assembly language (or assembler language, or symbolic machine code), often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence be ...
and appropriate instruction set extensions (such as
SSE2
SSE2 (Streaming SIMD Extensions 2) is one of the Intel SIMD (Single Instruction, Multiple Data) processor supplementary instruction sets first introduced by Intel with the initial version of the Pentium 4 in 2000. It extends the earlier Streamin ...
) to speed up the decoding time.
Applications
The Viterbi decoding algorithm is widely used in the following areas:
*Radio communication: digital TV (
ATSC
Advanced Television Systems Committee (ATSC) standards are an American set of standards for digital television transmission over terrestrial, cable and satellite networks. It is largely a replacement for the analog NTSC standard and, like that ...
,
QAM
Quadrature amplitude modulation (QAM) is the name of a family of digital modulation methods and a related family of analog modulation methods widely used in modern telecommunications to transmit information. It conveys two analog message signa ...
,
DVB-T
DVB-T, short for Digital Video Broadcasting – Terrestrial, is the DVB European-based consortium standard for the broadcast transmission of digital terrestrial television that was first published in 1997 and first broadcast in Singapore in Febr ...
, etc.),
radio relay
Radio stations that cannot communicate directly due to distance, terrain or other difficulties sometimes use an intermediate radio relay station to relay the signals. A radio relay receives weak signals and retransmits them, often in a different di ...
,
satellite communications
A communications satellite is an artificial satellite that relays and amplifies radio telecommunication signals via a transponder; it creates a communication channel between a source transmitter and a receiver at different locations on Earth. C ...
,
PSK31
PSK31 or " Phase Shift Keying, 31 Baud", also BPSK31 and QPSK31, is a popular computer-sound card-generated radioteletype mode, used primarily by amateur radio operators to conduct real-time keyboard-to-keyboard chat, most often using frequenci ...
digital mode for
amateur radio
Amateur radio, also known as ham radio, is the use of the radio frequency spectrum for purposes of non-commercial exchange of messages, wireless experimentation, self-training, private recreation, radiosport, contesting, and emergency communic ...
.
*Decoding
trellis-coded modulation (TCM), the technique used in telephone-line modems to squeeze high
spectral efficiency
Spectral efficiency, spectrum efficiency or bandwidth efficiency refers to the information rate that can be transmitted over a given bandwidth in a specific communication system. It is a measure of how efficiently a limited frequency spectrum is ut ...
out of 3 kHz-bandwidth analog telephone lines.
*Computer storage devices such as
hard disk drive
A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
s.
*
Automatic speech recognition
Speech recognition is an interdisciplinary subfield of computer science and computational linguistics that develops methodologies and technologies that enable the recognition and translation of spoken language into text by computers with the ...
References
External links
*{{cite arXiv , eprint=cs/0504020 , title=The Viterbi Algorithm: A Personal History , first=G. David, Jr , last=Forney , date=29 Apr 2005
Details on Viterbi decoding, as well as a bibliographyViterbi algorithm explanation with the focus on hardware implementation issues''r''=1/6 ''k''=15 coding for the Cassini mission to Saturn
*
ttp://www.ka9q.net/code/fec/ GPL Viterbi decoder software for four standard codesDescription of a ''k''=24 Viterbi decoder, believed to be the largest ever in practical useGeneric Viterbi decoder hardware (GPL)
Data transmission
Error detection and correction
High-importance articles