A Turbo Code Tutorial
A Turbo Code Tutorial
A Turbo Code Tutorial
William E. Ryan
New Mexico State University
Box 30001 Dept. 3-O, Las Cruces, NM 88003
[email protected]
Introduction
g
(
D
)
GR(D) = 1 g (D) :
Observe that the code sequence corresponding to the encoder input u(D) for the former code is u(D)GNR(D) =
[u(D)g (D) u(D)g (D)] ; and that the identical code sequence is produced in the recursive code by the sequence
u (D) = u(D)g (D); since in this case the code sequence is
u(D)g (D)GR (D) = u(D)GNR(D): Here, we loosely call
the pair of polynomials u(D)GNR(D) a code sequence, although the actual code sequence is derived from this polynomial pair in the usual way.
Observe that, for the recursive encoder, the code sequence will be of nite weight if and only if the input
sequence is divisible by g (D): We have the following immediate corollaries of this fact which we shall use later.
1
2
1
GR(D) = 1 1 +1D+ D+ D+ D+ D :
Thus, g (D) = 1+ D + D and g (D) = 1+ D + D + D
or, in octal form, (g ; g ) = (31; 27): Observe that g (D)
is primitive so that, for example, u(D) = 1+ D produces
the nite-length code sequence (1+D ; 1+ D + D + D +
D + D + D + D ). Of course, any delayed version of
this input, say, D (1+ D ); will simply produce a delayed
version of this code sequence. Fig. 2 gives one encoder
realization for this code. We remark that, in addition to
elaborating on Corollary 2, this example serves to demonstrate the conventions generally used in the literature for
specifying such encoders.
B. The Permuter
As the name implies, the function of the permuter is
to take each incoming block of N data bits and rearrange
them in a pseudo-random fashion prior to encoding by the
second encoder. Unlike the classical interleaver (e.g., block
or convolutional interleaver), which rearranges the bits in
some systematic fashion, it is important that the permuter
sort the bits in a manner that lacks any apparent order, although it might be tailored in a certain way for weight-two
and weight-three inputs as explained in Example 2 below.
Also important is that N be selected quite large and we
shall assume N 1000 hereafter. The importance of these
two requirements will be illuminated below. We point out
also that one pseudo-random permuter will perform about
as well as any other provided N is large.
C. The Puncturer
While for deep space applications low-rate codes are appropriate, in other situations such as satellite communications, a rate of 1/2 or higher is preferred. The role of
the turbo code puncturer is identical to that of its convolutional code counterpart, to periodically delete selected bits
to reduce coding overhead. For the case of iterative decoding to be discussed below, it is preferrable to delete only
parity bits as indicated in Fig. 1, but there is no guarantee
that this will maximize the minimum codeword distance.
For example, to achieve a rate of 1/2, one might delete all
1
11
15
15
15
even parity bits from the top encoder and all odd parity
bits from the bottom one.
D. The Turbo Encoder and Its Performance
As will be elaborated upon in the next section, a
maximum-likehood (ML) sequence decoder would be far
too complex for a turbo code due to the presence of the
permuter. However, the suboptimum iterative decoding algorithm to be described there oers near-ML performance.
Hence, we shall now estimate the performance of an ML
decoder (analysis of the iterative decoder is much more
dicult).
Armed with the above descriptions of the components of
the turbo encoder of Fig. 1, it is easy to conclude that it
is linear since its components are linear. The constituent
codes are certainly linear, and the permuter is linear since
it may be modeled by a permutation matrix. Further,
the puncturer does not aect linearity since all codewords
share the same puncture locations. As usual, the importance of linearity is that, in considering the performance
of a code, one may choose the all-zeros sequence as a reference. Thus, hereafter we shall assume that the all-zeros
codeword was transmitted.
Now consider
the all-zeros codeword (the 0thN codeword)
th
k 2 f1; 2; :::; 2 1g. The
and the k codeword, for some
ML decoder will choose thekpth codeword over the 0th codeword with probability Q 2dkrEb=N where r is the
code rate and dk is the weight of the kth codeword. The
bit error rate for this two-codeword situation would then
be
Pb(k j 0) = wk (bit errors/cw error)
1 data bits)
N(cw/
p
Q 2rdkEb=N (cw errors/cw)
r
!
w
2
rd
E
k
k
b
= N Q N (bit errors/data bit)
0
k
r
!
N
X wk
2
rd
E
k
b
Q
.
=
2
=1
k=1
N0
N0
2 min
2 min
2 min
2 min
2 min
2 min
2 min
2 min
v=1 N
2 min
N0
N0
()3
N
3
X
v=1
NQ
2rd v Eb
3
N0
0s
' 3Nn3 Q @
rdTC
3;min Eb A
N0
(3)
3 min
u(D) divisible by g1 (D) (e.g., g1(D) itself in the above example), it becomes very unlikely that the permuted input
u (D) seen by the second encoder will also be divisible by
g1(D). For example, suppose u(D) = g1 (D) = 1+ D + D4:
Then the permuter output will be a multiple of g (D) if
the three input 1's become the jth; (j +1)th; and (j1+4)th
bits out of the permuter, for some j . If we imagine that the
permuter acts in a purely random fashion so that the probability that one of the 1's lands
a given position is 1=N , the
permuter output will
be
Dj g1(D) = Dj 1 + D + D4 with
probabilility 3!=N 3 :1 For comparison, for w = 2 inputs,
a given
permuter output pattern occurs with probability
2!=N 2. Thus, we would expect the number of weight-three
inputs, n3 ; resulting in remergent paths in both encoders
to be much less than n2 ,
n3 << n2 ;
with the result being that the inner sum in (1) for w = 3
is negligible relative to that for w = 2.2
w 4: Again we can approximate the inner sum in (1)
for w = 4 in the same manner as in (2) and (3). Still
0
min
N0
g (D)
3!=N !
168
3 min
10
88
15
848
2 min
3 min
III.
min
+1
The Decoder
In the symbol-by-symbol MAP decoder, the decoder decides uk = +1 if P (uk = +1 j y) > P (uk = 1 j y), and it
decides uk = 1 otherwise. More succinctly, the decision
u^k is given by
u^k = sign [L(uk)]
where L(uk ) is the log a posteriori probability (LAPP)
ratio dened as
P
(
u
=
+1
y)
j
k
L(uk ) , log P (u = 1 j y) :
k
Incorporating the code's trellis, this may be written as
0P
p(sk = s ;sk = s; y)=p(y) 1
L(uk ) = log @ SP p(s = s ; s = s; y)=p(y) A (5)
k
k
S
+
02
+1
+1
+1
s S
" Unfortunately, dividing by simply p(O ) to obtain p(s ; s j O ) also
leads to an unstable algorithm. Obtaining p(s ; s j O)p(yk ) instead
of the APP p(s ; s j O) presents no problem since an APP ratio is
computed so that the unwanted factor p(yk ) cancels; see equation
(16) below.
2
P (uk = +1)
+
log
L(uk) = log PP ((yy jj uukk == +1)
1)
P (uk = 1)
with the second term representing a priori information.
Since P (uk = +1) = P (uk = 1) typically, the a priori term is usually zero for conventional decoders. However, for iterative decoders, D1 receives extrinsic or soft
0
+1
+1
+1
information for each uk from D2 which serves as a priori information. Similarly, D2 receives extrinsic information from D1 and the decoding iteration proceeds as
D1!D2!D1!D2!..., with the previous decoder passing
soft information along to the next decoder at each halfiteration except for the rst. The idea behind extrinsic
information is that D2 provides soft information to D1 for
each uk , using only information not available to D1 (i.e.,
E2 parity); D1 does likewise for D2.
An iterative decoder using component BCJR-MAP decoders is shown in Fig. 4. Observe how permuters and
de-permuters are involved in arranging systematic, parity,
and extrinsic information in the proper sequence for each
decoder.
We now show how extrinsic information is extracted
from the modied-BCJR version of the LAPPratio embodied in (16). We rst observe that k (s ;s) may be written
as (cf. equation (9))
k(s ; s) = P (s j s )p(yk j s ;s)
= P (uk)p(yk j uk)
where the event uk corresponds to the event s ! s. Dening
P
(
u
=
+1)
k
e
L (uk ) , log P (u = 1) ;
k
observe that wemay write
Le (uk )=2] exp[u Le (u )=2]
P (uk) = 1exp[
k
k
+ exp[eLe(uk)]
= Ak exp[ukL (uk )=2]
(17)
where
the rst equality follows since it equals
p
!
P =P pP =P = P when u = +1 and
k
1 + P =P
0
P =P+
1 + P =P+
when uk = 1 :
where we have dened P , P (uk = +1) and P ,
As for p(y j u ); we may
P (uk = 1) for convenience.
write (recall yk = (yks ; ykp ) and xk = (xsk; xkpk ) = k(uk ;xpk))
p p
s
p(yk j uk) / exp (yk 2uk) (yk 2xk)
"
#
s + u + yp + xp
y
k
k
k
k
= exp
2
p
p
s
exp uk yk + xk yk
s
p xp
y
u
+
y
k
k
k
= Bk exp k
so that
s + xp yp
u
y
k
k
e
k k :
k(s ; s) / AkBk exp[ukL (uk )=2]exp
(18)
P =P+
1
1
p
p
e
s
k (s ;s) exp 2 uk (L (uk ) + Lcyk ) + 2 Lcykxk
0 2
where Ck , exp uk (Le(uk ) + Lcyks ) : The second equality follows since Ck (uk = +1) and Ck(uk = 1) can be
factored out of the summations in the numerator and denominator, respectively. The rst term in (20) is sometimes called the channel value, the second term represents
any a priori information about uk provided by a previous
decoder, and the third term represents extrinsic information that can be passed on to a subsequent decoder. Thus,
for example, on any given iteration, D1 computes
L (uk) = Lcyks + Le (uk) + Le (uk )
where Le (euk ) is extrinsic information passed from D2 to
D1, and L (uk) is the third term in (20) which is to be
used as extrinsic information from D1 to D2.
C. Pseudo-Code for the Iterative Decoder
We do not give pseudo-code for the encoder here since
this is much more straightforward. However, it must be
emphasized that at least E1 must be terminated correctly
to avoid serious degradation. That is, the last m bits of
the N -bit information wordth to be encoded must force E1
to the zero state by the N bit.
The pseudo-code given below for iterative decoding of
a turbo code follows directly from the development above.
Implicit is the fact that each decoder must have full knowledge of the trellis of the constituent encoders. For example,
each decoder must have a table (array) containing the input bits and parity bits for all possible state transitions
s ! s: Also required are permutation and de-permutation
1
2
21
12
21
12
functions (arrays) since D1 and D2 will be sharing reliability information about each uk, but D2's information is
pemuted relative to D1. We denote these arrays by P []
and Pinv[], respectively. For example, the permuted word
u is obtained from the original word u via the pseudo-code
statement: for k = 1 : N , uk = uP k , end. We next point
out that due to the presence of Lc in L(uk), knowledge of
the noise variance N =2 by each MAP decoder is necessary. Finally, we mention that a simple way to simulate
puncturing is, in the computation of (s ;s), to set to
zero the received parity samples,p ykporp ykkp; corresponding
to the punctured parity bits, xk or xk : Thus, puncturing
need not be performed at the encoder.
0
[ ]
(1)
12
(1)
12
(1)
12
(1)
[ ]
[ ]
(2)
for s = 0
- ~ (s) == 01 for
s 6= 0
- ~N (s) = ~N (s) for all s (set after computation of
f~N (s)g in the rst iteration)
- Le (uk ) is to be determined from D1 after the rst
half-iteration and so need not be initialized
=======================
(2)
0
(2)
12
[ ]
(1)
D2:
21
21
(1)
(2)
end
D2:
for k = 1 : N
- get yk = (yPs k ; ykp)
- compute k (s ;s) from (19) for all allowable state
transitions s ! s (uk in (19) is set to the value of
the encoder input which caused the transition s ! s;
Le(uk) is Le (uP k ), the permuted extrinsic informaton from the previous D1s iteration; yks is the permuted systematic value, yP k )
- compute ~k (s) for all s using (14)
end
for k = N : 1 : 2
- compute ~k (s) for all s using (15)
end
for k = 1 : N
- compute Le (uk ) using
1
0P
~k (s ) ke(s ;s) ~k (s)
C
S
Le (uk ) = log B
A
@P
e
~
~k (s ) k(s ; s) k (s)
S
[ ]
(1)
0
(2)
(2)
21
(2)
21
(2)
1
1
(2)
(2)
end
==========================
===== After the last iteration =====
for k = 1 : N
- compute
L (uk) = Lcyks + Le (uPinv k ) + Le (uk )
- if L (uk) > 0
decide uk = +1
1
21
[ ]
12
else
decide uk = 1
end
==========================
Acknowledgment
References
10
N = 1000
2
10
10
Pb
10
10
10
10
10
0.5
1.5
2.5
u=xs
Eb/No
Fig. 3.
RSC 1
x1p
g2 ( D)
g1 ( D)
N-bit
Interleaver
Puncturing
x1p, x2p
Mechanism
RSC 2
u
N-bit
De-Intrlver
Le21
2p
g2 ( D)
g1 ( D)
Fig. 1.
y1p
ys
e
L12
MAP
Decoder 1
N-bit
Intrlver
MAP
Decoder 2
N-bit
Intrlver
y2p
21
uk
g11
uk
g12=0
g13=0
g14
g23
g24
+
g20
g21=0
g22
+
pk
Fig. 2.