Efficient Maximum Likelihood Decoding of Linear Block Codes Using A Trellis
Efficient Maximum Likelihood Decoding of Linear Block Codes Using A Trellis
1, JANUARY 1978
Abstract-It is shown that soft decision maximum likelihood Some, if not all, of these results can be deduced from
decoding of any (n,k) linear block code over GF(q) can be accom-
plished using the Viterbi algorithm applied to a trellis with no more
previously published papers. However, the practical sig-
than q (n-k) states. For cyclic codes, the trellis is periodic. When thisnificance of our technique makes it appear worthwhile to
technique is applied to the decoding of product codes, the number present them together here. A comparison between the
of states in the trellis can be muchfewer than q n-k. For a binary decoding complexity of our technique and that of the usual
(n,rz - 1) single parity check code, the Viterbi algorithm is equiv- word correlation decoding should amplify this point.
alent to the Wagner decoding algorithm.
Consider the maximum likelihood decoding of a (31,26)
binary Hamming code using channel measurement in-
I. INTRODUCTION formation. If word correlation decoding is utilized, the
WO DISTINCT error-control techniques exist received data would be compared with each of the 2zscode
T L for the reliable transmission of digital data over noisy words. Using the Viterbi algorithm, a trellis with only 25
communications channels: block codes and convolutional states is utilized. Both the word correlation decoder and
codes.There are many similarities and differences between the Viterbi decoder will decode to the same codeword and
these techniques. One important difference is that much thus give identical performance. In this case,the advantage
more efficient algorithms have been found for using of instrumenting a Viterbi decoder rather than a word-
channel measurement information (i.e., soft decisions) in correlation decoder should be obvious.
the decoding of convolutional codes than in the decoding The concepts presented in this paper have some simi-
of block codes. larity to the work of Bahl et al. [3] and that of Hartmann
This paper is concerned with the maximum likelihood and Rudolph [4]. However, in both of these papers, the
decoding of linear block codes using channel measure- authors were concerned with minimizing the probability
ment information. By maximum likelihood decoding, we of symbol error rather than the probability of word error.
mean a decoding algorithm which results in the minimum Miyakawa and Kaneko [5] have presented a different de-
probability of decoding to an incorrect code word when the coding algorithm for maximum likelihood decoding of
a priori probabilities of all the code words are equal. By linear codes using channel measurement information.
using channel measurement information, we mean that Their algorithm appears to require a decoder with greater
the decoding algorithm can utilize real numbers (e.g., the complexity than that discussed here. For example, for the
analog outputs of filters matched to the signals) associated (31,26) binary Hamming code, their decoder considers
with each component of the code word. The decoding al- 3684 error patterns. Chase [6] and others [7]-[lo] have
gorithm will be of particular use in decoding high-rate given suboptimum decoding algorithms which are rela-
codes, since the complexity of the algorithm will be tively simple to instrument, but which do not always
upper-bounded by a function of the number of parity achieve maximum likelihood decoding.
symbols. The technique described here has been applied to a
The following results are demonstrated in this paper. concatenated coding scheme where constant weight binary
1) Soft decision, maximum likelihood decoding of any block codes are transmitted over a fading channel. The
(n,k) linear block code over GF(q) can be accomplished details will be discussed elsewhere [ 111.
using the Viterbi [l] algorithm applied to a trellis having We first give a general formulation which holds for all
no more than qcnmk)states. linear block codes. We then consider the case of cyclic
2) If the linear code is cyclic, the trellis is periodic. linear codes. Finally, we consider product codes and show
3) If the linear code is a product code, the number of that, for such codes, the number of states in the trellis is
states required can be considerably less than qtnek). greatly reduced over what we might expect from the
4) For a binary (n,n - 1) single-parity check code, the treatment of the general problem.
Viterbi algorithm applied to the trellis is equivalent to
Wagner decoding [2]. II. LINEAR CODESOVER GF(q)
Denote the elements of the finite field GF(q) as ~j, j =
Manuscript received July 26,1976; revised April 29,1977. This research 0,1,2, * - * ,(q - 1). Consider alinear (n,k) code over G&‘(q)
was supported by the Air Force Office of Scientific Research, Air Force with parity check matrix H. Denote the ith column of H
Systems Command, USAF, under Grant AFOSR-74-2601. as hi, so that hi, i = 1,2, -. . ,n are (n - h)-tuples with el-
The author is with the Department of Electrical and Computer Engi-
neering, University of Massachusetts, Amherst, MA 01003. ements from GF(q). The codewords in the code are all the
001%9448/78/0100-0076$00.750 1978 IEEE
WOLF: DECODING OF LINEAR BLOCK CODES 77
n-tuples Xwith elements from GF(q), such that HX= 0. K=O K=I K=2 K=3 K=4 K=5
Here 0 is the all-zero (n - k)-tuple.
We now define a trellis for this code. A trellis is a par-
ticular collection of nodes (or states) interconnected by
unidirectional edges.The nodes will be grouped into sets
indexed by a parameter k, k = 0,1,2, . . - ,n. A node indexed
by a particular value of k will be said to be at depth k.
Edges will be drawn between certain pairs of nodes at
depth k and at depth (k + l), for k = O ,l, * a. ,(n - l), with Fig. 1. Trellis for binary (5,3) code before expurgation.
the direction of the edge going from the node at depth k
to the node at depth (k + 1). At any depth k, there will be
at most qtn-“) nodes. The nodes at depth k will be iden- K=O K=l K=2 K=3 K=4 I(=5
O ,l, * * * ,(q - 1). For an arbitrary depth k, 1 I k 5 n, we For a given received data sequence c, a maximum likeli-
have the states ajl’j,hi + aj,hz + * * - + ajkhk, where + is the hood decoderfinds the codeword X which gives the largest
addition operator defined for vectors with components value of Z(X). A brute force approach would suggesttrying
from the field GF(q). Note that the number of states at any all q k possible codewords.
depth cannot exceed qcnvk), the number of distinct (n - The Viterbi algorithm is a recursive algorithm whereby
k)-tuples with elements from GF(q). many codewords can be discarded from consideration in
We illustrate the construction of a trellis for the binary finding that X which maximizes Z(X). Referring to the
78 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. m24, NO. 1, JANUARY 19%
4) At k = n, the sequenceof aj on the single remaining Fig. 4. Encoder for binary (15,ll) code withg(x) = x4 + x + 1.
path from the all-zero state at depth 0 to the all-zero state
at depth n corresponds to the codeword X which maxi-
mizes Z(X).
It should be noted that this algorithm can be used with
the unexpurgated trellis or the expurgated trellis. toll
0100
IV. DECODING OF CYCLIC CODES OVER GF(q) 0101
0110
011 I
For cyclic codes over GF(q), an alternative (but equiv- ,000
alent) method of forming the trellis is to associate the 1001
1010
nodes with the qcnmk)states of the (n - k) stage shift I01 I
,100
register used for encoding and decoding. For an (n,k) cyclic ,101
code over GF(q) with generator polynomial g(x) = go + glx I I IO
I I II
+ . *. + g,x: gi E GF(q), r = n - k, one form of the encoder
is as shown in Fig. 3. Fig. 5. Trellis for depths h = 0, 1, 2, 3, and 4.
The square boxes are storage devices for elements from
GF(q), the circles enclosing + signs are adders for elements
from GF(g), and the circles enclosing gi’s are multipliers 0000
0001
for elements from GF(q). (g,-i is the multiplicative in- 0010
verse of g,.) We enter the k messagedigits at the input with 001 I
oioo
the switches S1 and Sz in position 1. We then enter (n - 0101
k) O’sat the input with the switches Si and S’sin position 01 IO
01 I I
2. The output is the codeword. ,000
1001
The trellis for this code is built by tracing the possible ,010
states of the storage devices for all possible inputs. Since 101 I
,100
there are r storage devices and each device can contain at 0 01
most Q different elements, there will be at most 4’ states I I IO
, I I I
in the trellis at any depth. For a reasonable code in which
all encoder states are utilized, the number of trellis states Fig. 6. Trellis at depth h and (k t 1) for k = 4,5, . -. ,lO.
at depth j in the expurgated trellis is given by the formu-
la 0 -0
000 0 -0 _ 0
I I I
number of states in trellis at depth j 000 I
0 0
0010 I I
001 I
0100
q j, j = 1,2,. . . ,r - 1 0101 0 b
01 IO
= 4’9 j = r,r + 1, . . . ,n - r 01 I I
I300
L 4 n-j 2 j = n - r + 1, *. . ,n. 100
1010
I 0
101 I
The trellis is repetitive for j = r + 1, . . . ,n - r. I IO0
I IO I
The general procedure for interconnecting nodes of the I I10
trellis is most easily described by associating with each I I I I ~
node at depth k a polynomial s(x;k) in x of degree (r - 1) Fig. 7. Trellis for depths k = 11,12, * - * ,15.
WOLF: DECODING OF LINEAR BLOCK CODES 79
0000
000 I
0010
001 I
0100
0101 i =I i= 2
01 IO
011 I
IO00
I 00 I
1010
101 I
II00
I IO1 i-3
I I IO
III1
0
0
0
I
i=5
are characteristic of Viterbi decoding of arbitrary codes 3) Test if 1 = n2. If so go to step 5);otherwise go to step
and are not limited to just the single-parity check code. 4).
4) Compute, for each (i&, - - - ,i,,)
In all cases discussed heretofore, the number of states = max [V(l-l)(il + hIl j, i2
needed at some depth in the trellis was equal to qn-“, i
where (n - k) was the number of parity symbols in the + h22j, s. . ,irz + h,,d + &j(l)].
code. For some codes, the maximum number of states can
be much less than qnek; such is the situation for product For each state, retain the sequenceof j values that resulted
codes. in the maximum V. Return to step 2).
Consider a product code with symbols from GF(q) where 5) Compute
the row code is an ( nI,k i) linear code and the column code
is an (n2,k2) linear code. The number of parity symbols is
w-)(0,0, - - * 0) = max [Wz-l)(O,O, * - - 0, j) + Qjtn)].
r = nln2 - k1k2 = k1(n2 - k2) + k2(nl - kl) + (nl- kl)(nz i
- kz). In what follows, we give a decoding algorithm for a
product code that requires only qkl(nz-kz) states. By The sequence of j values that led to the maximum V(“)
symmetry, an algorithm exists with q kz(nl-kl) states. If one (O,O,- - - 0) is the decoded codeword.
code is a low-rate code and the other code is a high-rate 6) Stop.
code, the savings in decoder complexity is enormous when A similar algorithm holds for concatenated codes,where
comparing this algorithm to algorithms which require q’ again the number of required states is much reduced over
or q klkz states. what might be expected from considering the total number
For example, consider a binary product code with a of parity digits transmitted.
(15,5) three-error correcting row code and a (15,14) sin-
gle-error detecting column code. The resultant code is a REFERENCES
(225,70) code with minimum distance 14. The algorithm
111A. J. Viterbi, “Error bounds for convolutional codes and an
described in the previous section would seem to require a asymptoticahy optimum decoding algorithm,” IEEE Trans. Inform.
trellis with 2(22”7e)= 2ls5 states. A decoding algorithm for Theory, vol. IT-13, pp. 260-269, Apr. 1967.
such a trellis is outside the realm of possibility. In the al- PI R. A. Silverman and M. Balser, “Coding for a constant data rate
source,” IRE Trans. Inform. Theory, vol. PGIT-4, pp. 50-63, Jan.
gorithm to follow, only 25 = 32 states would be required in 1954.
the trellis. [31 L. R. Bahl, J. Cocke, F. Jelinek, and J. Raviv, “Optimal decoding
of linear codes for minimizing symbol error rate,” IEEE Trans.
Decoding Algorithm (Binary Case): Let Q(l) denote the Inform. Theory, vol. IT-20, pp. 284-287, Mar. 1974.
correlation of the 1th row of the received matrix with the 141 C. R. P. Hartmann and L. E. Rudolnh, _ “On ontimum svmbol-by-
codeword from the row code having the information symbol decoding rule for linear codes,” IEEE Trans. Inform.
Theory, vol. IT-22, pp. 514-517, Sept. 1976.
symbols i = (ji,js, * * * ,jk,); j, E (0,l). Let the hij denote
[51 H. Miyakawa and T. Kaneko, “Decoding algorithm for error-cor-
the element in the ith row and the jth column of the parity recting codes by use of analog weights,“Electron. Commun. Japan,
check matrix of the column code. It is assumedthis matrix vol. 58-A, pp. 18-27,1975.
is in echelon canonical form with a unit matrix on the right: Kl D. Chase, “A class of algorithms for decoding block codes with
channel measurement information,” IEEE Trans. Inform. Theory,
hij E (0,l). Let V(l) (ii, is, * . . , i,,) denote the node value vol. IT-18, pp. 170-182, Jan. 1972.
of state (il,i2, - - - ,i,,) after 1 rows of the received matrix [71 E. J. Weldon, Jr., “Decoding block codes on Q-ary output channels,”
IEEE Trans. Inform. Theory, vol. IT-17, pp. 713-718, Nov. 1971.
have been cross-correlated with the codewords in the
PI S. Wainberg and J. K. Wolf, “Algebraic decoding of block codes over
product code. Here i, (a = 1,2, * * . ,r2) is a binary vector a q-ary input, Q-ary output channel, Q > g,” Informat. Contr., vol.
of dimension kl, so there are (2pl)‘z = 2 klrz states. 22, pp. 23-247, Apr. 1973.
[9] B. Dorsch, “Maximum likelihood decoding of binary group codes
Algorithm: 1) Set 1 = 0, for the Gaussian channel,” presented at IEEE Int. Symp. on Inform.
Theory, Noordwijk, The Netherlands, 1970.
W(i,,
0,
i2, - - - , i,,) = _ oD
il = i2.. . = i,, = 0 [lo] G. D. Forney, Jr., “Generalized minimum distance decoding,” IEEE
Trans. Inform. Theory, vol. IT-12, pp. 125-131, Apr: 1966.
> otherwise. [ll] P. Pieper, J. Proakis, R. Reed, and J. K. Wolf, “Maximum likelihood
decoding of concatenated constant weight block codes over a Ray-
2) z--1+1. leigh fading channel,” in preparation.