Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Proceedings of The 2nd International Conference on Green Technology and Sustainable Development, 2014

PERFORMANCE EVALUATION FOR CONVOLUTIONAL CODES


USING VITERBI DECODING
Do Duy Tana, Nguyen ThanhHaib
Ho Chi Minh City University of Technology and Education
a

tandd@hcmute.edu.vn; bnthai@hcmute.edu.vn

ABSTRACT
Convolutional codes are a kind of channel coding, used in numerous applications in order to achieve reliable
data transfer, including digital video, radio, mobile communication, and satellite communication. In this paper,
we review some basic concepts of convolutional codes with implementation in practical digital communication
systems. Then, a convolutional decoder based on Viterbi algorithm is designed. The paper particularly describes
main points of convolutional codes, how to carry out encoder and decoder. We evaluate performance of Viterbi
decoding through simulation in case of Soft-Hard Decision and in comparison with uncoded cases. Simulation
results show that the system with convolutional codes obtains better quality in Bit Error Rate (BER) than
uncodedcodewords.
Keywords: channel coding, convolutional code, Viterbi decoding, Bit Error Rate, Soft and Hard Decision.

1.

between soft decision and hard decision in


system model in comparison with uncoded
case. Also, the paper presents the effect of
coding model on system resource.

INTRODUCTION

Error control coding plays an important role


in protection of delivering information from
a source to a destination with minimum
errors. There are several general techniques
for the control of errors, and which one is
chosen depend on the nature of data and
user's requirement as well as complexity for
error-free reception [1].

The rest of this paper is organized as


follows: In section 2, to describe
convolutional code concept through an
example, parameters from this example will
be used in the latter chapter for decoder and
simulation. Section 3 presents a method for
convolutional decoding using Viterbi
Algorithm. Section 4presents simulations
for encoding and decoding. Section 5
concludes the paper.
2.

Figure 1. Basic Elements of Digital


Communication Systems

The codes for error control are divided into


two categories, namely block codes and
trellis codes. Convolutional Codes belong
to trellis codes [2]. Many applications in
telecommunications
have
used
convolutional codes because of their ability
to deliver good coding gains on the AWGN
channel [3]. In this paper, we review some
features of convolutional codes and
implement an example with encoder and
decoder through Viterbi decoding algorithm.
Furthermore, we analyze the differences

CONVOLUTIONAL CODE
IMPLEMENTATION

Figure 2. Convolutional Encoder

A linear trellis code is a convolutional code.


We show up the encoder for convolutional
codes through a simple example, then these
540

Proceedings of The 2nd International Conference on Green Technology and Sustainable Development, 2014

parameters will be used to implement the


decoder.

The states represent the possible contents of


the right-most K-1 stages of the shift
register ( in this case K-1 is D1-D2-D3).
State diagram shows transitions from each
state, corresponding to input bits. In this
specific example, it contains 8 states which
comes from K-1 = 3 bits.

2.1 Encoder
Some notations for convolutional encoder:
Input bits - k, the number of bits taken
into the encoder at once.

In figure 3, we see that each of input bit 0


or 1, the state diagram changes from this
value to other value, and an output
codeword respectively.

Output bits - n, the number of bits output


from the encoder at once.
Constraint length - K, the total number
of shift register stages in the encoder.

2.3 Input/Output for Current and Next


State

Code rate - k/n, ratio input bits and output


bits.

Fig. 4 describes relation between input bits


and output bits through states of shift
register. The outcome is combination from
input bit and generator polynomial. We
have 3-bit output from 1-bit input.

Generator polynomial - G(n), respectively


input, relation between shift register and
output.
We choose parameters for convolutional
encoder as follows:
Input : k =1
Output : n = 3
Constraint length: K = 4
Code rate: k/n = 1/3
Generator Polynomial:
G0 = 1 1 1 1 = 1 + D + D + D (1)
G1 = 1 0 1 1 = 1+D + D

G2 = 1 1 0 1 = 1+ D + D

(2)
3

2.2 State Diagram


Figure 4.Input/Output for Current and Next
State

2.4 Trellis Diagram

Figure 5. Trellis Diagram

In Fig. 5, the solid line denotes the output


generated by an input of zero, and a dashed

Figure 3. State Diagram

541

Proceedings of The 2nd International Conference on Green Technology and Sustainable Development, 2014

line denotes the output generated by an


input bit one. The trellis contains states
through time. Each of the states can
transition to one of two states. Of the two
outgoing branches, one corresponds to an
input bit zero and the other corresponds to
an input bit one. So, one transition from
current state to next state will produce one
output bit with one corresponding input bit.

since the complexity of T(D) increases


exponentially with constraint length.
2.6 Tail-biting Method
Zero-tailing method: append a "tail" of
M zeros (memory depth of the encoder)
to the message sequence, so that at the
end the encoder memory contains only
zeros and the encoder is at the all-zero
state. The method is simple to implement,
but, due to addition of the extra bits, the
effective coding rate is reduced to
/ + ( is length of the actual
message sequence).

Fig. 5 denotes trellis diagram for our example


through t . We refer to this time as the
start time and labelt . Length of trellis is
referred to decoding window to protect a
converging point for decoding algorithm.

Tail-biting method: initially set the


encoder to a state that is identical to its
final state rather than to the all-zero state.
At the end of encoding, the same M bits
terminate the encoder at the same initial
state. The coding rate is retained. The
price to pay is the increase of decoder
complexity.

2.5 Minimum Distance by Mason Equation

3.

VITERBI DECODING
ALGORITHM

Convolutional decoding is the process of


searching for the path that an encoder has
traversed. There are three main schemes for
convolutional
decoding:
sequential
decoding, majority-logic decoding and
Viterbi decoding. Sequential decoding, as
the first practical decoding technique for
convolutional codes. It uses the Fano
algorithm and the stack algorithm. The
threshold-based majority-logic decoding
scheme appears some time later. The
Viterbi decoding algorithm is optimal in the
maximum-likelihood sense, and has quickly
become the most widely used convolutional
decoding algorithm in practice for its
reduced computational complexity and
satisfactory performance [4]. In this paper,
we utilize Viterbi's algorithm for
convolutional decoding as the most popular
ones in applications.

Figure 6. State Diagram

Minimum distance or free distance can be


interpreted as the minimal length of an
erroneous "burst" at the output of a
convolutional decoder. Fig. 6 presents the
computation of free distance by starting with
state diagram. First, we label branches of
state diagram with exponent, where
exponent of D denotes the Hamming
distance from the branch word of that branch
to the all-zeros branch. Number of exponent
for each of branch is number of bit 1 at
output value. All paths originating at a=000
and terminating at i=000 can be traced on
the modified state diagram. The transfer
function, T(D), called the generating
function of the code expressed as ratio
between X (at terminating transition) and
X(at starting transition).The exponent of D
represents the cumulative of the number of
ones in the path. In evaluating distance
properties, the transfer function, T(D),
cannot be used for long constraint lengths

3.1 Soft Decision and Hard Decision


Decoding
For the hard-decision case, the BPSK
demodulator produces hard decisions, at
542

Proceedings of The 2nd International Conference on Green Technology and Sustainable Development, 2014

the receiver, which are passed onto the


decoder. (Binary Symmetric Channel the received sequence is binary)

metric and a path metric. At state i, it may


come from two previous state. Each of
them has a metric to become state i, path
metric at previous state and the distance
between received codeword and theory
codeword. At state i, path metric is
minimum of branch metric from those two
paths. The survivor path is path has totally
smaller path metric at state i.

For the soft-decision case, the BPSK


demodulator produces soft decisions, at
the receiver, using the log-likelihood
ratio. These soft outputs are 3-bit
quantized and passed onto the decoder.
(the received sequence is real valued)

4.

3.2 Viterbi Algorithm

4.1 Block Diagram

We can choose an arbitrary node (S,t) in the


trellis diagram of a code and look at all of
the paths going into it, we find that there
always exists a path that has a smaller
distance between the received sequence and
the code sequence than all other paths.
Relying on definition of maximum
likelihood, the path is with at least difference,
called the local survivor path or survivor.

Some parameters need to be set up for


simulation, including Number of Data Bits,
Trace Back Window/ Queue Sizes, Shift
Register, Generation Polynomial, Number
of Output, Initial table, Path Metric.
In decoding using Viterbi algorithm, an
important issue needs to be taken care is the
width of the sliding window or decoding
depth. We cannot decide the outcome
sequence of decoder after only one and
some state's changes because result is not
exact. The decoding error caused by
insufficient
decoding
depth,
called
truncation error. An recommended value for
this parameter should be equal or greater
than 5 times the constraint length. In these
simulations, we choose 5 times greater than
constraint length for decoding depth.

Figure 7. Metric Computation

BM: branch metric, based on the distance


between theory codeword and received
value depending on Soft/Hard Decision.

PM: path metric - the accumulation of


branch metric on the path from the
beginning of the trellis up to the current
decoding point (Add Compare and
Select)

SIMULATION AND RESULTS

Simulation starts with setting one level for


Signal-to-Noise Ratio (SNR) at transmitter.
A large sequence of input bits are pushed
into encoder, modulated by BPSK
technique. The transmitted data is involved
by channel noise before accessing the
receiver. At the receiver side, we divide
into two kinds of detection, one for Hard
Decision Decoding and the other one is for
Soft Decision Decoding. The concepts of
Hard-Soft Decision are mentioned in the
previous section. The main difference
between them is the quantilization levels,
the ways to solve code distance and
complexity of receiver.After decoding
(based on decoding depth), the decoded
data is stored and compared with the
original sequence at transmitter to calculate
BER. Models are similar for C and Matlab.

Figure 8. Block Diagram

From Fig. 7, we can see that two metrics


are used in Viterbi algorithm: a branch
543

Proceedings of The 2nd International Conference on Green Technology and Sustainable Development, 2014

The flow chart for implementation of


Viterbi Decoding followed in Fig. 9

4.2 Simulation in C
In this paper, we set up two simulations to
evaluate the performance of Viterbi
Decoding and system cost. The first one is
C Cygwin. This is a software Linux-based
but run on Window, like virtual
environment. It helps improve resource on
computer and speed of simulation.

(1) Increase time by 1.


(2) Branch Metric Computation:
Compute BM for each branch.
(3) Path Metric Update: Perform ACS
for each current state, and store the
survivor path together with its PM,
discard the other(s).

In these simulations, we take into account


on not only performance of decoding
algorithm but also system resource and
convergence speed for each of them when
changing experiment conditions such as
decoding depth and queue size.

(4) If the end of the track back or trellis


is reached, map the global optimum path
to the decode sequence and output.
Otherwise go back to step 1.
With each of received bit, the algorithm
calculates the branch metric and path
metric for this step. After some steps decoding depth (or track back), a
decision will be done, then one output
decoded sequence obtains. Similar
processes repeat for other values of SNR.
In these simulation, we set up 10 SNR
level and the length of sequence is
1,000,000 bits for each of SNR level.

Figure 10. Track Back = 20, Queue Size = 300

Results of simulation showed that BER


in case of soft Viterbi decoding has
lower value than hard Viterbi decoding
and uncoded case.
The size of track back window and queue
size have effect on the performance of
Convolutional Coding and Decoding.
When the queue size increases, BER
decreases but in other hand, it costs more
memory and speed of simulation.

Figure 9. Flow chart

Figure 11. Track Back = 50, Queue Size = 300

544

Proceedings of The 2nd International Conference on Green Technology and Sustainable Development, 2014

4.3 Simulation in Matlab

5. CONCLUSIONS

The second simulation is implemented with


Matlab. Targets of this simulation are similar
to C, but also takes care of comparison with
outcomes from C. The fact that simulation in
Matlab requires a higher system resource
and longer time for simulation.

In this paper, we presentthe performance


evaluation for convolutional code with a
sample encoder/decoder using Viterbi
decoding algorithm. It really attains a
higher performance for BER calculation.
The performance of coding depends on kind
of quantilization, Hard or Soft decoding. In
order to increase performance of digital
communication systems, we can utilize the
encoder with longer constraint length but
with higher complexity. Also, other
modulation techniques replacing for BPSK
modulation/demodulation such as QPSK,
QAM, TCM modulation,... but under
consideration between performance and
system requirement.

Figure 12. Track Back = 20, Queue Size = 100

Obtain result after 45 minutes (~10


times longer than simulation by C) for
case TB = 20, Queue Size = 50.

BER also decreases when SNR


increases and BER in case of Soft
Decision Decoding is smallest in
comparison with Hard Decision and
theory-uncoded.

In case of larger TB and Queue Size,


time increases and error probability
decreases. It takes more time for
Simulation in Matlab than C.

Figure 13. Track Back = 30, Queue Size = 100

ACKNOWLEDGEMENTS
The authors would like to convey thanks to
Faculty of Electrical and Electronics
Engineering, Ho Chi Minh City University
of Technology and Education, Vietnam for
providing laboratory facilities.

REFERENCES
[1]

B. Sklar, Digital Communications: Fundamentals & Applications, 2nded., Prentice Hall, 2001.

[2]

Iglesias Curto, Munoz Castaneda, Munoz Porras, Serrano Sotelo, Every Convolutional
Code is a Goppa Code, IEEE Transactions onInformation Theory, vol.59, no.10,
pp.6628-6641, Oct. 2013

[3]

Sweeney P.,Error control coding. From theory to practice, Wiley, 2002.

[4]

Y. Jing, A Practical Guide to Error-Control Coding Using MATLAB,Artech House, 2010

545

You might also like