Professional Documents
Culture Documents
INFORMATION THEORY
AND CODING
(Electronics & Communication Engineering/Telecommunication Engineering)
Authors
Pages : 1 to 000
ISBN: 978-93-87756-20-5
Published by
MayasPublication®
# 45/5, Unathur& Post.Attur Tk.,
Salem Dt. Tamilnadu, India – 636112
www.eijfmr.commaya1984kannan@gmail.com
editoreijfmr@gmail.com
+91 9655933100
ii
Preface
Information Theory and Coding may be the fastest growing technologies in the field
of Communication and network security. One of the ramifications of that growth is a
dramatic increase in the number of professions-where an understanding of these
technologies is essential for success-and a proportionate increase in the number and
types of students taking course to learn about them.
Course Objectives
Course objectives are clearly defined at initial for all the chapters.
Structure
This textbook is designed for students with little or no background in
telecommunications or data communications. For this reason, we use a bottom-up
approach. With this approach, students learn first about information system (bottom
up approach) followed by generating the code words and code vectors using linear
block codes and cyclic codes respectively.
Visual Approach
The book presents highly technical subject matter without complex formulas by using
a balance of text and figures. More than 200 figures accompanying provide a visual
and intuitive opportunity for understanding the material. Figures are particularly
important and explaining coding concepts, which are based on connections and
transmissions. Both of these ideas are easy to grasp visually.
Highlighted Points
We emphasize important concepts in highlighted boxes for quick references and
immediate attention.
Recommended Reading
Each chapter includes a list of books and sites that can be used for further reading.
iii
Preface
Key Terms
Each chapter includes a list of key terms for the student.
Practice Set
Each chapter includes a practice set designed to reinforce and apply Salient concepts.
It consists of two parts: descriptive questions and model exam question papers (end
of all the chapters). Descriptive questions are intended to test the students first-level
understanding of the material presented in the chapter. Multiple choice questions are
designed to create motivation for the students to appear in the competitive
examinations. Examination questions require deeper understanding of the material.
Index
The book contains an extensive list of acronyms.
Organization
The following lists the course material in the organization of the book:
1. Chapter 1 discusses the brief Introduction of Information Theory.
2. Chapter 2 deals with the generation of code words Source coding.
3. Chapter3 describes the various Communication Channels in the field of
Communication.
4. Chapter 4 discusses Error Control Codes for Linear Block Codes.
5. Chapter 5 discuses Binary Cyclic Codes.
6. Chapter 6 discusses Important Cyclic codes
7. Chapter 7 deals with the convolution codes.
Instructional Materials
Instructional materials for both the student and the teacher are provided. The
solutions to exercises contain both the explanation and answer including full colored
figures or tables when needed. The PowerPoint presentations are more
comprehensive and include text and figures.
Contents
The book is divided into six parts. The first part is an introduction to Information
theory; the second part is Source Coding; the third part is Informational Channels; the
iv
Preface
fourth chapter is Error Control Coding; Binary Cyclic codes are discussed in Chapter
5; Chapter 6 covers some important Cyclic codes and Chapter 7 covers the
Convolution codes. The following summarizes the contents of each part.
Part two: Source Coding: Source coding theorem, Prefix Codes, Kraft McMillan
Inequality property – KMI. Encoding of the Source Output, Shannon’s Encoding
Algorithm.Shannon Fano Encoding Algorithm, Huffman codes, Extended Huffman
coding, Arithmetic Coding, Lempel – Ziv Algorithm.
RBT Level: (L1, L2, L3)
Part Four: Error Control Coding: Introduction, Examples of Error control coding,
methods of Controlling Errors, Types of Errors, types of Codes, Linear Block Codes:
matrix description of Linear Block Codes, Error Detection and Error Correction
Capabilities of Linear Block Codes, Single Error Correcting hamming Codes, Table
lookup decoding using Standard Array.
RBT Level: (L1, L2, L3)
Part Five: Binary Cyclic Codes: Binary Cyclic Codes: Algebraic Structure of Cyclic
Codes, Encoding using an (n-k) Bit Shift register, Syndrome Calculation, Error
Detection and Correction.
RBT Level: (L1, L2, L3)
v
Preface
Part Six: Some important Cyclic codes Golay Codes, BCH Codes.
RBT Level: (L1, L2, L3)
Peer Review
The most important contribution to the development of a book such as this comes
from peer reviews. We cannot express our gratitude in words to the many reviewers
who spent numerous hours reading the manuscript and providing us with helpful
comments and ideas. We would especially like to acknowledge the contribution of the
following reviewers for this book.
1. M.Pavithra, M.E.,
Assistant Professor, Tamilnadu.
vi
Preface
2. Rajendiran
Assistant Professor, Suriya Institute of Engineering and
Technology, Vilupuram, Tamilnadu.
3. Dr. Senthil Kumar
MGR University, Professor of Computer Science
Chennai.
Just like any other book, this book being the first edition is bound to have some
errors and omissions, which may please be bought to the notice of the authors or
publisher to come with improvement in the second edition. All suggestions and
Critical comments are most welcome.
We pledge our sincere sense of gratitude to our parents and all our family
members for their constant support and encouragement.
We wish to thank our respected his holiness Pujya Shri. Dr. Siddharama
Swamiji, President, SSET, Belagavi, Shri S. G. Sambaragimath, Chairman, S. G. B. I.
T, Belagavi, Dr. S. S. Salimath, Principal, S G Balekundri Institute of Technology,
Belagavi, Dr. K. S. Prabhushetty, Professor and Head, Department of Electronics and
communication Engineering, S. G. Balekundri Institute of Technology, Belagavi for
their encouragement to carry out this work.
Also we would like to express our sincere gratitude to Panchajanya Vidyapeetha
Welfare Trust, Bangalore, Dr. C Nanjundaswamy, Principal, Dr. Ambedkar Institute
of Technology, Bangalore and Dr. Yamunadevi C R, Professor and Head, Department
of Telecommunication Engineering, Dr. Ambedkar Institute of Technology, Bangalore
for their constant support and encouragement.
Our sincere thanks to Dr. Venugopal K. R., Vice-Chancellor, Bangalore
University, Bangalore and Dr. K. B. Raja, Professor and Chairman, University
Visvesvaraya College of Engineering, Bangalore for their constant support and
encouragement.
We wish to thank all our staff and teaching faculties for their inputs at various
stages of writing the book including the feedback from our students.
I express my grateful thanks to Dr. R. Mayakkanan and their members of the staff,
for their efforts in publishing this book. Our sincere thanks to Mr. Muthu S, page
designer for excellent typesetting of the manuscript.
July 2018
AUTHORS
viii
Table of Contents
Preface
Contents Page. No
1. Information Theory
Learning Objectives
1.1 Introduction...........................................................................................................01
1.2 Basics of Information System..............................................................................01
1.3 Measure of Information..................................................................................... 03
1.3.1 Unit of Information................................................................................... 03
1.3.2 Properties of Information......................................................................... 04
1.3.3 Average Information Content................................................................. 09
1.3.4 Properties of Entropy................................................................................ 18
1.3.5 Extension of Zero memory Source.......................................................... 25
1.4 Entropy of source with memory........................................................................ 30
1.4.1 Markoff Stochastic Model..........................................................................31
1.4.2 Entropy and Information rate of Markoff Sources.............................. 31
Things to be remember
Descriptive Questions
Multiple Choice questions
References
2. Source Coding
Learning Objectives
2.1 Introduction..............................................................................................................57
2.2 Types of Codes....................................................................................................... 58
2.2.1 Block Codes...................................................................................................58
2.2.2 Non Singular Codes................................................................................... 58
2.2.3 Singular Codes............................................................................................ 58
2.2.4 Uniquely Decodable Codes....................................................................... 59
2.2.5 Instantaneous Codes.................................................................................. 59
ix
Table of Contents
3. Information Channels
Learning Objectives
3.1 Introduction...............................................................................................................135
3.1.1 Representation of a Channel.......................................................................135
3.2 Joint Probability....................................................................................................... 138
3.2.1 Properties of Joint Probability Matrix....................................................... 139
3.3 Entropy Function and Equivocation..................................................................... 142
3.4 Rate of Information transmission over a discrete channel................................ 144
3.4.1 Capacity of a discrete memoryless channel............................................. 144
3.4.2 Channel efficiency and Redundancy........................................................ 144
3.5 Special Channels...................................................................................................... 145
3.5.1 Symmetric Channel...................................................................................... 145
3.5.2 Binary Symmetric Channel......................................................................... 152
3.5.3 Binary Erasure Channel.............................................................................. 160
3.5.4 Noiseless Channel........................................................................................ 163
x
Table of Contents
xi
Table of Contents
7. Convolution Codes
Learning Objectives
7.1 Introduction..............................................................................................................281
7.2 Some definitions.......................................................................................................282
7.2.1 Code rate........................................................................................................282
7.2.2 Constraint length..........................................................................................282
7.3 Analysis of convolution encoder using time domain approach........................282
7.4 Analysis of convolution encoder using matrix method ....................................288
xii
Table of Contents
xiii
Chapter 1
Information Theory
Contents
Learning Objectives
1.1 Introduction…………………………………………………………………………………01
1.2 Basics of Information System……………………………………………………………...01
1.3 Measure of Information……………………………………………………………………03
1.3.1 Unit of Information………………………………………………………………….03
1.3.2 Properties of Information…………………………………………………………...04
1.3.3 Average Information Content………………………………………………………09
1.3.4 Properties of Entropy………………………………………………………………..18
1.3.5 Extension of Zero memory Source…………………………………………………25
1.4 Entropy of source with memory…………………………………………….....................30
1.4.1 Markoff Stochastic Model…………………………………………………………...31
1.4.2 Entropy and Information rate of Markoff Sources……………………………….31
Things to be remember
Descriptive Questions
Multiple Choice questions
References
1
Claude. Elwood. Shannon was an American Mathematician,
Electrical Engineer and Cryptographer known as the “Father
of Information Theory”
Born: 30-04-1916
Died: 24-02-2001
Nationality: American
Occupation: Mathematician
2
1 INFORMATION THEORY
Learning Objectives
1.1 Introduction
In 1948, Claude Shannon published "A Mathematical Theory of Communication", an
article in the Bell System Technical Journal. This work focuses on the problem of how
best to encode the information a sender wants to transmit. In this fundamental work
he used tools in probability theory, developed by Norbert Wiener, which were in their
nascent stages of being applied to communication theory at that time. Shannon
developed information entropy as a measure for the uncertainty in a message while
essentially inventing the field of information theory. The word information refers to
message or intelligence in information theory. Here, the message may be in the form
of voltage, power, speech, picture message such as facsimile or television or music
message. The source which produces these messages is called information source.
3
Introduction to Information Theory and Coding
Information Source: Information sources can be classified into two sections Analog
information Sources such as a microphone actuated by speech, TV camera scanning a
scene that emits one or more continuous amplitude electrical signals with respect to
time. Discrete Information sources such as a teletype or the numerical output of a
computer consists of a sequence of discrete symbols. The analog information source
can be transferred into a discrete information source through sampling and
quantization process. Further it is characterized by source alphabet, symbol rate,
source alphabet probabilities and probabilistic dependence of symbols in a sequence.
With respect to Fig. 1.1, now let us assume that the information source is a discrete
source that emits discrete message symbols {S1, S2,……….,Sq} with probabilities of
occurrence given by {P1, P2,…….., Pq} respectively. Then the sum of all these
probabilities must be equal to ‘1’ and is given in equation (1.1).
P1+P2+…..+Pq = 1 or ∑
………………….1.1
Source Encoder: Now let us consider the string of source symbols emitted from the
source alphabet S = {S1, S2,….,Sq} occurring at a rate of ‘rs’ symbols/sec as an input to
the source encoder. The source encoder converts the symbol sequence into a binary
sequence of 0’s and 1’s by assigning code-words to the symbols in the input sequence.
Transmitter: It couples the input message signal to the channel. Here, the signal
processing operations are also performed which includes amplification, filtering and
modulation.
Channel: When binary symbols are transmitted over the channel, the effect of noise is
to convert some of the 0’s into 1’s and some of the 1’s to 0’s. The signals are then said
to be corrupted by noise which leads to reduce the performance of the system.
4
Information Theory
Decoder: The source decoder converts the binary output of the channel decoder into
symbol sequence. Therefore, the function of the decoder is to convert the corrupted
signals into symbol sequence.
Receiver: The function of the receiver is to identify the symbol sequence and match it
with the correct sequence.
………………….1.2
1.3.1 Unit of Information
Let us consider the equation (1.2)., which shows the definition of amount of
information.
5
Introduction to Information Theory and Coding
(Ik)= =
………………….1.3
Here, if the base of the logarithm is ‘2’, then the units are called “BITS” (Binary
Units). If the base is ‘3’, then the units are Trinits or Ternary. If the base is ‘10’, then
the units are “HARTLEYS” or “DECITS”. If the base is ‘e’, then the units are
“NATS”. Finally if the base is ‘r’, then the units are called r-array units. The most
widely used unit of information is “BITS” which has base 2.
iii) If receiver knows the message being transmitted, the amount of information
carried is zero.
If Pk=1 then Ik=0
iv) If ‘I1’ is the information carried by message ‘S1’ and ‘I2’ is the information carried
by ‘S2’, then the amount of information carried due to S1 and S2 is
v) If there are M=2N equally likely messages, then amount of information carried by
each message will be of ‘N’ bits.
6
Information Theory
EXAMPLE 1.1 Prove that I1, 2 = I1 + I2 where ‘I1’ represents the information carried by
message‘m1’ and ‘I2’ is the information carried by message ‘m2’.
Therefore
I1, 2 = I1 + I2
Hence Proved
EXAMPLE 1.2 Consider a binary system emitting two symbols {0, 1} with
probabilities 0.25 and 0.75 respectively. Find the total information conveyed by bit 0
and bit 1.
Probability of the occurrence of ‘0’ at the source output is P(0)=0.25 and the
probability of the occurrence of ‘1’ at the source output is P(1)=0.75. Therefore,
7
Introduction to Information Theory and Coding
Similarly,
I= 2.415 bits
EXAMPLE 1.3 If there are ‘M’ equally likely and independent messages, then prove
that amount of information carried by each message will be of Ik=N bits, where M=2N
and N is an integer.
Solution: Since all the messages are equally likely and independent, probability of
occurrence of each message will be ( ). We know that, the amount of information is
given by,
Ik= log2 bits
We know that
Pk= then Ik=log2M
Ik= log2 2N
where M=2N
Ik = N log2 2 = N
Therefore
Ik = N bits
8
Information Theory
EXAMPLE 1.4 A source is emitting two symbols S0 and S1 with the probabilities
and respectively. Find the self information of the symbols in (i) Bits (ii) Trinits (iii)
Decits (iv) Nats.
EXAMPLE 1.5 Suppose a fair coin is tossed by binary source which emits ‘1’ for
head and ‘0’ for tail.
(i) What is the information content of each output from the source?
(ii) Consider if the source is memory less, then what will be the source
information of an m-bit block from the source.
9
Introduction to Information Theory and Coding
Solution: There are two outputs ‘1’ and ‘0’ from the source. Here, both are equally
likely and the probability of each output is,
P(0)= and P(1)=
(i) Hence, the information content of each output is,
Ik= loge where k=0, 1
Therefore
I= log2 2 = 1 bit
(ii) If m-bits are to be transmitted as one message block, then the probability of
such a message will be,
P(x)= X X X X…… X (m-times) = ( )
Hence the information content is,
I(x) = log2 = log2
I(x)= m bits
Solution: The Information Content of the messages for the above three statements
are listed below as follows
(i) Since it is sure that Sun always sets from west and the probability of occurrence of
the event is high. Hence, it carries less or negligible information. i.e., Ik=0
(ii) It predicts about phone ring in the time span of one hour without mentioning the
exact time. Hence it carries moderate information.
(iii) In the winter season snow fall in Mangalore is very rare. Hence the probability of
occurrence of this event is very rare. So it carries large amount of information.
10
Information Theory
It is noticed that each symbol of ‘S1’ conveys information of bits and such P1L
number of ‘S1’ symbols are present on an average in a length of ‘L’ symbols. So, the
total information conveyed by symbol ‘S1’ is
P1L log2 bits
Therefore, the total self information conveyed by all these symbols is,
ITotal = P1L log2 + P2L log2 + P3L log2 +…………. + PqL log2
The average information conveyed by the source is denoted by its Entropy H(s),
which is given by
H(s) =
* +
H(s) =
* +
=
∑ bits/symbol
………………….1.4
Equation (1.4) represents the expression for the average information content of a
source ‘S’. If the baud rate of the system is ‘rs’ symbols/second, then the average rate
of the information is given by
Rs=H(s) * rs
=∑ bits/symbol * rs symbols/second
=[∑ * rs ] bits/second
EXAMPLE 1.7 A zero memory or discrete memory less source emits one of the six
symbols in every 3ms. The symbol probabilities are {0.5, 0.4, 0.01, 0.02, 0.03, 0.04}.Find
the average information rate of the source.
Solution: The entropy or the average information content of the source is given by
∑ bits/symbol
Substituting the probabilities {0.5, 0.4, 0.01, 0.02, 0.03, 0.04} given in the above
equation, we get
H(s) = { + + + + + }
H(s) = {0.5+0.52+0.06+0.11+0.15+0.18}
Therefore,
Rs=H(s) * rs bits/second
It is given that a symbol is emitted for every 3ms. Therefore,
rs = = 333 symbols/second
Rs =1.52 * 333
Therefore,
Rs =506.16 bits/second
13
Introduction to Information Theory and Coding
EXAMPLE 1.8 A zero memory source emits one of the four symbols in every 1ms.
The symbol probabilities are , -. Find
Solution: The entropy or the average information content of the source is given by
∑ bits/symbol
H(s) = { ( ⁄ )
+
( ⁄ )
+
( ⁄ )
+
( ⁄ )
}
H(s) = {0.52+0.43+0.5+0.5}
Therefore,
H(s) = { ( ⁄ )
+
( ⁄ )
+
( ⁄ )
+
( ⁄ )
}
H(s) = {0.33+0.27+0.31+0.31}
H(s) = { ( ⁄ )
+
( ⁄ )
+
( ⁄ )
+
( ⁄ )
}
H(s) = {0.15+0.12+0.15+0.15}
H(s) = { ( ⁄ )
+
( ⁄ )
+
( ⁄ )
+
( ⁄ )
}
14
Information Theory
H(s) = {0.36+0.29+0.34+0.34}
rs = = 1000 symbols/second
Rs =1.95 * 1000
Therefore,
Rs =1950 bits/second
EXAMPLE 1.9 Suppose if ‘s’ represents the response of a single roll of a fair die.
Calculate the entropy of ‘s’.
Solution: We know that, a die is having a six faces. Hence, the probability of getting
any number is . i.e., Pi = . So, entropy of ‘s’ is given by
∑ bits/symbol
= }
bits/symbol
15
Introduction to Information Theory and Coding
EXAMPLE 2.0 The output of information source consists of 100 symbols, 24 of which
occur with the probability of and the remaining 76 occur with a probability . If
the source emits 2000 symbols/sec, find the average information rate of the source.
={ }
( ⁄ ) ( ⁄ )
= {0.11+0.04}
bits/symbol
Therefore,
rs = = 2000 symbols/second
Rs =0.15 * 2000
Therefore,
Rs =300 bits/second
16
Information Theory
EXAMPLE 2.1A code is composed of dots and dashes. Assume that a dash is 3times
as long as a dot and has one-third the probability of occurrence. Find
(i) The average information content in a dot and dash
(ii) The entropy of dot - dash code
(iii) The average rate of the information, if a dot lasts for 10ms and this time is
allowed between symbols.
Solution: As we know that only dots and dashes are present we must have
Pdot +Pdash=1
………………….1.6
It is given that Pdash = Pdot
………………….1.7
Substituting equation (1.7) in equation (1.6) we get
Pdot + Pdot =1
Pdot =
………………….1.8
Substituting equation (1.8) in equation (1.7) we obtain
Pdash =
………………….1.9
(i) Information in a dot
Idot = = = 0.415 bits
= { }
( ⁄) ( ⁄ )
17
Introduction to Information Theory and Coding
}
Therefore,
bits/symbol
(iii) Since 3 dots and 1 dash with a dot lasting for 10ms, a dash for 30ms and with
10ms gap between two successful symbols, a total of 100ms is required to
transmit 4 symbols.
rs= = 40 symbols/second
Rs =0.8113 * 40
Therefore,
Rs =32.45 bits/second
I= Hartleys
………………….1.10
I= nats
………………….1.11
I= bits
………………….1.12
18
Information Theory
1 Hartley = =
( ⁄ ) ( ⁄ )
= nats
= nats where =
Therefore,
1 Hartley = nats
Or,
1 Hartley = bits
Or,
1 Hartley =3.32 bits
EXAMPLE 2.3 Calculate the entropy of a source in nats/symbol that emits one out of
four symbols P, Q, R, and S with probabilities , , and respectively.
19
Introduction to Information Theory and Coding
={ + }
={ }
( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ )
={0.52+0.5+0.5+0.33}
Therefore,
bits/second
………………….1.13
We know that
1nat=1.443 bits
1bit= nat = 0.693 nats
………………….1.14
Now, by substituting equation (1.14) in equation (1.13) we get
nats/symbol
nats/symbol
20
Information Theory
Ex: If PX = {P1, P2, P3} ; Py = { P2, P3, P1} ; Pz = { P3, P1, P2} then
3) Extremal Property
Consider the source with ‘q’ symbols S ={S1, S2, .....,Sq } with probabilities
P={P1, P2,....., Pq}. Then the entropy of ‘S’ is given by
∑ bits/symbol
We know that sum of all the probabilities is equal to unity.
P1+P2+.....+ Pq = ∑ =1 ………………….1.15
Since, the entropy H(S) has an upper bound which is proved by considering a
quantity [ ]. Therefore
= [∑ ] ∑ where ∑ =1
=∑ * +
=∑ Where =
∑ * + Where
Therefore,
………………….1.16
21
Introduction to Information Theory and Coding
From above graph it is noticed that the straight line Y=X-1 always lies above
the logarithmic curve Y= except at X=1. Thus, the straight line forms the
tangent to the curve at X=1. Therefore,
[ ]
………………….1.18
Multiplying equation (1.18) by we get
∑ *∑ ∑ +
………………….1.19
Where [∑ ∑ ]= 1-1=0
From equation (1.16) it is noticed that, LHS of equation (1.19) is
and RHS of equation (1.19) is always zero. Therefore
OR
………………….1.20
22
Information Theory
Equation (1.20) is used, when the emitted symbols of the zero memory sources
are equiprobable.
4) Additive Property:
Suppose if the symbol ‘Sq’ is splitted into n sub symbols such that Sq = {Sq1,
Sq2, ....., Sqn}
With probabilities Pq= {Pq1, Pq2, .....,Pqn} then the entropy H(s) of splitted
symbols is greater than or equal to H(s).
H(s) ≥ H(s)
………………….1.21
This means that partitioning of symbols into sub symbols cannot decrease
entropy.
5) Source Efficiency: It is defined as the ratio of the average information
conveyed by the source to that of the maximum average information
= * 100%
………………….1.22
6) Source Redundancy: It is defined as
R =1- =* += * 100%
………………….1.23
EXAMPLE 2.4 The Source has generated twelve symbols in blocks of six at a rate of
1000 blocks/second. The first symbol in each block is always synchronization (same),
the remaining five are filled by any of the twelve symbols with equal probability.
Calculate the entropy rate of this source.
Sync
23
Introduction to Information Theory and Coding
Since the symbols are generated in blocks of six, the total entropy HT is given by
HT= H1+H2+H3+H4+H5+H6
………………….1.24
In a given problem, 1st
bit is always same, which indicates no information is carried
by sure event (probability of the sure event is P1=1)
H1= P1
H1=0
The second, third, fourth, fifth and sixth position is occupied by any of the twelve
symbols with equal probability. Hence,
Now, Substitute the values of H2, H3, H4, H5 and H6 in equation (1.24) we get
HT= {0+3.5+3.5+3.5+3.5+3.5}
HT=17.5 bits/symbol
Rs = *
Rs = 17500 bits/second
24
Information Theory
EXAMPLE 2.5 A zero memory Source ‘S’ emits four symbols A, B, C and D with
probabilities 0.25, 0.15, 0.40 and 0.2 respectively. Find the efficiency and its
redundancy of the source.
∑ bits/symbol
={ + + + }
={ + + +0.2 }
bits/symbol
H(s)max = =
H(s)max =2 bits/symbol
=94.5%
R =5.5%
25
Introduction to Information Theory and Coding
Since all the values are equally likely to occur, all these frames are equiprobable. So,
( )
H(s) = H(s)max = =
=2 x 106
It is said that one picture is transmitted for every 4 seconds. Therefore, the rate of
transmission is given by
rs= ( ) = 0.25 picture/second
Now, the average rate of information is obtained by
Rs = H(S) * rs bits/second
Rs =6 x 106 * 0.25
Rs = 15 x 106 bits/second
= = =1
26
Information Theory
P1+ P2 =1
………………….1.25
Then, the entropy for binary source is given by
∑ bits/symbol
………………….1.26
Now, 2nd extension of the binary source will be
[ ]
27
Introduction to Information Theory and Coding
But we have,
=2 [ ]
From equation (1.26)
Similarly, the third extension of binary source will be 23 = 8 symbols and its entropy is
In general, the nth extension of binary source will be 2n symbols and its entropy is
………………….1.27
EXAMPLE 2.7 Let us consider the zero memory source S= {S0, S1, S3, S4} with their
probabilities {0.2, 0.6, 0.1, 0.1}. Find the entropy of source and the entropy of second
order extension.
∑ bits/symbol
={ + + }
Therefore,
bits/symbol
= 2 x 1.57
28
Information Theory
Therefore,
( ) bits/symbol
EXAMPLE 2.8 Consider a source S emits one of the three symbols S0, S1 and S3 with
their probabilities , and respectively. Find the entropy of source and list all the
elements for the second extension of this source. Also, Verify H (s2) = 2 H(s).
∑ bits/symbol
={ +
( ⁄ ) ( ⁄ )
+ ( ⁄ )
}
Therefore,
bits/symbol
Symbol S1S1 S1S2 S1S3 S2S1 S2S2 S2S3 S3S1 S3S2 S3S3
Probability 1/4 1/8 1/8 1/8 1/16 1/16 1/8 1/16 1/16
∑ bits/symbol
={ ( ) ( ) }
( ⁄ ) ( ⁄ ) ( ⁄ )
29
Introduction to Information Theory and Coding
H (s2) = 3 bits/symbol
We have,
H (s2) = 2 x H(s)
=2 x 1.5 bits/symbol=3 bits/symbol
Therefore,
H (s2) = 2 H(s)
EXAMPLE 2.9 Consider a zero memory source emitting two symbols ‘X’ and ‘Y’
with respective probabilities 0.6 and 0.4. Find the entropy of source and list all the
elements for the second and third extension of this source. Also, Verify H (s3) = 3 H(s).
∑ bits/symbol
={ +
Therefore,
bits/symbol
Symbol XX XY YX YY
30
Information Theory
∑ bits/symbol
={( )+( ) ( )}
∑ bits/symbol
= ( ) +( ) ( ) ( )
We have,
H (s3) = 3 x H(s)
=3 x 0.96 bits/symbol=3 bits/symbol
Therefore,
H (s3) = 3 H(s)
31
Introduction to Information Theory and Coding
EXAMPLE 3.0 An analog baseband signal, band limited to 100 Hz, is sampled at the
Nyquist rate. The samples are quantized into four message symbols that occur
independently with probabilities P1 = P4 = 0.125 and P2 = P3. Find the information rate
(bits/sec) of the message source.
=( ) ( )
Therefore,
bits/symbol
Since the signal is sampled at Nyquist rate, the symbol rate ‘rs’ is given by
Rs =1.81 * 200
Therefore,
Rs =362 bits/second
32
Information Theory
signal are not statistically independent. So, in real time, most of the sources are
dependent. A source with a memory can be represented by a Markov model, it is a
dependent probabilistic model required for dependent sources. For a Markov model
source, the emission of message symbols at the current instant is dependent on its
previous message symbols.
Hi = ∑ bits/symbol
………………….1.28
Where m= total number of states. The entropy of the source is given by
H=∑ bits/symbol
………………….1.29
Where is the probability of the state. The average information rate of a source is
given by,
Rs =H * rs bits/second
………………….1.30
Note: If P(mi)is the probability of a sequence ‘mi’ of ‘N’ symbols from the source is
given by,
33
Introduction to Information Theory and Coding
GN= ∑
………………….1.31
In other words
= H bits/symbol
The value of ‘GN’ decreases for every higher length of message symbols and will be at
least equal to H.
G1 G2 ……..,…
………………….1.32
EXAMPLE 3.1 For the Markov source shown in Fig 1.3, find
(i) State probabilities
(ii) State entropies
(iii) Source entropy.
34
Information Theory
P (A) =
From equation (1.34),
P (B) = P (B) + P ( )
P (B) =
From equation (1.35),
P (B) = P (C) + ( )
P (C) =
(ii ) The entropy of each state is
H= ∑ bits/symbol
={ }
( ⁄ ) ( ⁄ ) ( ⁄ )
HA = 1.5 bits/symbol
={
( ⁄ ) ( ⁄ )
}
HB = 1 bits/symbol
35
Introduction to Information Theory and Coding
={ }
( ⁄ ) ( ⁄ )
HC = 1 bits/symbol
= ( ) ( ) ( )
H =1.25 bits/symbol
EXAMPLE 3.2 For the Markov source shown in Fig 1.4, find
(i) Stationary distribution
(ii) State entropies and Source entropy
(iii) Entropy of adjoint source and verify H(S) ̅
P (C) = 0.25
P(B) = 0.32
Substituting the value of P(C) in the equation (1.42),
P (A) = 1.71 x 0.25
P(A) = 0.42
={ }
HA = 1.37 bits/symbol
={ }
HB = 1.48 bits/symbol
={ }
HC = 1.57 bits/symbol
38
Information Theory
H =1.45 bits/symbol
………………….1.43
(iv) We know that, represents monotonically decreasing function. Hence, for the
first order of Markov source the value of N becomes unity (N=1). Entropy of
adjoint source is given by
= ∑
= ̅ =∑
= {0.42 0.32 }
Therefore,
̅ = 1.55 bits/symbol
………………….1.44
Comparing equation (1.43) and equation (1.44) it is proved that,
H(s) ̅
EXAMPLE 3.3 For the Markov source shown in Fig 1.5, find
(i) State probabilities
(ii) State entropies and Source entropy
(iii) G1 and G2 and also verify G1 > G2 > H(S)
39
Introduction to Information Theory and Coding
Solution: (i) From the state diagram shown in Fig. 1.5, state equations can be written
as
P (1) = 0.666 P (1) +0.25 P (2)
………………….1.45
P (2) = 0.75 P (2) +0.334 P (1)
………………….1.46
From Equation (1.45)
0.334 P(1)=0.25P(2)
P(1) =0.75P(2)
………………….1.47
But we have
P(1)+P(2) = 1
Using Equation (1.47)
0.75P(2) + P(2)=1
P(2) =0.57
P(1)=0.42
40
Information Theory
Hi = ∑ bits/symbol
For state 1:
H1 = P11 P12
={ }
H1 = 0.918 bits/symbol
={ }
H2 = 0.811 bits/symbol
=P(1) H1 + P(2) H2
H=0.847 bits/symbol
………………….1.48
(iii) It is required to draw the tree diagram to find G1 and G2
41
Introduction to Information Theory and Coding
Figure 1.6: Tree diagram showing first two states for the Markov source.
From the figure 1.6., it is recorded at the end of the first symbol interval we have, ̅ =
{A, B, C}; P (A) = 0.28; P (B) = 0.42; P (C) = (0.14+0.14) = 0.28. The entropy of source at
the end of first symbol interval is given by
GN = ∑
For N=1,
G1= H( ̅)= + + }
42
Information Theory
(0.035+0.047) = 0.08; P (CB) =0.107; P (CA) = 0.095; P (BC) =0.107; P (BB) = 0.32}.
Therefore, the entropy of source at the end of second symbol interval is given by
GN= ∑
For N=2,
G2 = H( ̅ ) = { + + + +
+ }
G1> G2>H
EXAMPLE 3.4 For the Markov source shown in Fig 1.7, find
(i) State probabilities
(ii) State entropies and Source entropy
(iii) G1 and G2 and also verify G1 > G2 > H(S)
Solution: (i) From the state diagram shown in Fig. 1.7, state equations can be written
as
43
Introduction to Information Theory and Coding
P(1) =( ⁄ ) P(2)
………………….1.53
But we have
P(1)+P(2) = 1
Using Equation (1.52)
( ⁄ ) P (2)+ P(2)=1
P(2) =
P(1) =
Hi = ∑ bits/symbol
For state 1:
H1 = P11 P12
44
Information Theory
={ ( ) ( ) }
( ⁄ ) ( ⁄ )
H1 = 0.984 bits/symbol
H2 = P21 P22
= {( ) ( ) }
( ⁄ ) ( ⁄ )
H2 = 0.953 bits/symbol
H=∑ bits/symbol
=P(1) H1 + P(2) H2
H= ( )*(0.984) + ( )* (0.953)
H=0.969 bits/symbol
………………….1.54
45
Introduction to Information Theory and Coding
Figure 1.8: Tree diagram showing first two states for the Markov source.
From the figure 1.8, it is recorded that at the end of the first symbol interval we have,
̅ = {A, B, C}; P (A) = ; P (B) = ; P (C) = ( + ) = . The entropy of source at the end
of first symbol interval is given by
GN= ∑
46
Information Theory
For N=1,
G1=H( ̅)= ( ) +( ) +( ) }
( ⁄ ) ( ⁄ ) ( ⁄ )
GN= ∑
For N=2,
G2 = H( ̅ ) = ( )
( ⁄ )
+( ) + +( ) +( ) +
( ⁄ ) ( ⁄ ) ( ⁄ )
( ) +( ) }
( ⁄ ) ( ⁄ )
………………….1.56
From the equations (1.54), (1.55) and (1.56), it can easily observed that
G1> G2>H
47
Introduction to Information Theory and Coding
Things to be
Remember
∑ bits/symbol
8. Source Redundancy
R =1-
3. The average rate of information or
information rate is given by
9. Entropy of a sequence „mi‟ of ‘N‟
symbols from the source after the
Rs= H(S) * rs bits/sec
end of certain intervals is given by,
Hi = ∑ bits/symbol
5. Source Efficiency
= * 100%
48
Information Theory
DESCRIPTIVE
QUESTIONS
50
Information Theory
Multiple Choice
Questions
( ) ( )
5. A memoryless source emits ‘n’
symbols each with a probability ‘P’.
The entropy of the source as a function
bits/symbol of ‘n’
(a) Increases
Since the signal is sampled at Nyquist (b) Decreases as log n
rate, the symbol rate ‘rs’ is given by (c) Increases as n
rs=2 fmax=2 x 100 (d) Increases as n log n [GATE 2012: 1 Mark]
rs = 200 symbol/sec
Information rate is given by Solution: Entropy of memoryless
Rs = H(S) * rs bits/second source
Rs =1.81 * 200 H(s) =∑ bits /sym
Rs =362 bits/second Wkt., P1=P2=………….Pq =
H(s) = ∑ ( ⁄ )
=
4. A source alphabet consists of N
symbols with the probability of the Hence H(s) increases as a function
first two symbols being the same. of .
A source encoder increases the
probability of the first symbol by a 6. A source generates three symbols
small amount e. After encoding, with probability 0.25, 0.25, 0.50 at a
the entropy of the source
rate of 3000 symbols per second.
(a) Increases
Assuming independent generation
(b) Remains the same
of symbols, the most efficient source
(c) Increases only if N = 2
encoder would have average bit rate
(d) Decreases [GATE 2012: 1 Mark]
of
Solution: When the symbols are (a) 6000 bits/sec
equally probable, then the entropy of (b) 4500 bits/sec
such source results maximum and (c) 3000 bits/sec
entropy decreases when the (d) 1500 bits/sec [GATE 2006: 2 Mark]
52
Information Theory
(c) H = log10 M2
= 0.875 =
(d) H = 2log10 M
9. A fair is tossed repeatedly until a 11. The information rate R for given
‘Head’ appears for the first time. Let average information H= 2.0 for
‘L’ be the number of tosses to get analog signal band limited
this first ‘Head’. The entropy H(L) to B Hz is
in bits is (a) 8 B bits/sec
(b) 4 B bits/sec
(a) 3
(c) 2 B bits/sec
(b) 1.375
(d) 16 B bits/sec
(c) 2.8
12. Entropy is
(d) 3.5 [GATE 2014: 2 Marks]
(a) Average information per
Solution: If 1 toss is required to get
message
first head, then probability P1= . If 2 (b) Information in a signal
toss are required to get first head, then (c) Amplitude of signal
probability P2= x = . If 3 toss are (d) All of the above.
required to get first head, then 13. The memory less source refers to
probability P3= x x = (a) No previous information
(b) No message storage
Entropy of source is given by
(c) independent of previous
H(s) = ∑ bits message
/sym (d) None of the above
14. The information „I‟ contained in a
={ +
( ⁄ ) ( ⁄ ) ( ⁄ ) message with probability of
= (0.5+0.5+0.375) occurrence is
(a) I = k log21/P
(b) I = k log2P
H(s) = 1.375 bits/symbol
(c) I = k log21/2P
(d) I = k log21/P2
10. For M equally likely messages,
average amount of information ‘H’ 15. The expected information
(a) H = log10 M contained in a message is called
(b) H = log2 M (a) Entropy
(b) Efficiency
54
Information Theory
Answers
Q. No 1 2 3 4 5 6 7 8 9 10
Options a b d d a b b b b b
Q. No 11 12 13 14 15 16 17 18 19 20
Options b a c a a d b b a c
55
Introduction to Information Theory and Coding
References
[1] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
[2] Shanmugam K San, Digital and Analog Communication System, John Wiley and Sons:
New York; 1989.
[3] Muralidhar Kulkarni and K S Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
[4] J. S. Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[5] K. Giridhar, Information Theory and Coding, Pooja Publications.
[6] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
56
Chapter 2
Source Coding
Syllabus: Source coding theorem, Prefix Codes, Kraft McMillan Inequality property –
KMI. Encoding of the Source Output, Shannon’s Encoding Algorithm. Shannon Fano
Encoding Algorithm, Huffman codes, Extended Huffman coding, Arithmetic Coding, Lempel
– Ziv Algorithm.
Contents
2. Source Coding Page. No
Learning Objectives
2.1 Introduction............................................................................................................ ..................57
2.2 Types of Codes....................................................................................................... ..................58
2.2.1 Block Codes...................................................................................................................58
2.2.2 Non Singular Codes.....................................................................................................58
2.2.3 Singular Codes..............................................................................................................58
2.2.4 Uniquely Decodable Codes.........................................................................................59
2.2.5 Instantaneous Codes....................................................................................................59
2.2.6 Optimal Codes..............................................................................................................60
2.3 Prefix Codes.............................................................................................................................60
2.4 Kraft Mc-Millan Inequality...................................................................................................62
2.5 Code Efficiency and Redundancy........................................................................................64
2.6 Shannon’s Encoding Theorem..............................................................................................65
2.7 Shannon-Fano Encoding Algorithm....................................................................................81
2.7.1 Shannon-Fano Ternary Coding Algorithm..............................................................89
2.8 Compact Code: Huffman Minimum Redundancy Code..................................................92
2.9 Shannon Hartley Law and its Implications......................................................................110
2.10 Arithmetic Coding................................................................................................................112
2.10.1 Arithmetic Algorithm for decoding.......................................................................117
2.11 Lempel-Ziv Coding......................................................................................................119
2.12 Lempel-Ziv-Welsh Coding..........................................................................................122
Things to be remember
Descriptive Questions
Multiple Choice questions
References
57
Claude Shannon, the founder of
Information Theory, invented a way to
measure ‘the amount of information’
in a message without defining the
word information.
58
2 SOURCE CODING
Learning Objectives
2.1 Introduction
In a digital communication, the term source encoding is used prior to the information
source, where the output of information source is applied to the source encoder which
in turn, represents every information symbol emitted by the source in terms of bit
sequence called “codeword”. Now for a binary encoder, the codeword represents the
symbols in the form of (0, 1), in case of ternary code the codeword takes the symbols
in the form of (0, 1, 2). Similarly for quaternary, codeword represents the symbols in
the form of (0, 1, 2, 3) and so on. It is required to represent the data with minimum
number of bits to achieve effective communication to resolve the bandwidth scarcity
in any of the communication field.
The term source encoding refers to assigning minimal-length digital sequence to
every information symbols emitted by the source. Here, the codewords can be either
of fixed or variable length. In case of fixed length coding, the length of the codewords
is same whereas, in variable length coding, the length of the codewords is different
for the different symbols emitted from the source. Thus, a better compression can be
achieved in such codes. Compression process is applied to the source information
prior to its transmission is done to reduce the volume of information to be
transmitted. Depending upon the applications compression (such as lossless and
lossy) algorithms are carried out by the source encoder.
59
Introduction to Information Theory and Coding
The codes emitted by the source ‘A’ are of fixed length (i.e., L=3) whereas, the codes emitted
by the source ‘B’ are of variable length.
It is observed that the codes generated by the source „A‟ are distinct from each other.
Hence it is said to be non singular code.
60
Source Coding
B
001
011
001
111
It is observed that the codes generated by source „B‟ are repeated (001). Hence it is
said to be singular code.
Suppose for source „A‟ the codeword „10‟ is its nth extension and similarly for source
„B‟ codeword „110‟ is nth extension. In this case, the codes from the sources „A‟ and „B‟
are non singular (distinct). So the codes are uniquely decodable.
It is observed that, for the codewords 001011010111 the source symbols are P, Q, R,
and S respectively, which are unique and are of equal length 3. It is noticed from the
property of instantaneous codes that no codeword is a prefix of another codeword.
For this observation, prefix codes are sometimes also called as instantaneous codes.
It is observed that the source symbols P, Q, R and S are having codewords of the
length equal to 3 and the source symbols A, B, C and D are having codewords of a
length equal to 2. So it is noticed that the codewords of a source symbols A, B, C and
D are optimal codes as the assigned code length is 2.
The receiver keeps decoding the information after receiving a bit stream 156213475.
Once the first bit stream „1‟ is received, the receiver decodes it as „S‟, as „1‟ is valid
codeword for „S‟. Then for the next bit stream „5‟, which is not a valid codeword hence
it accepts the next bit code „56‟ is valid codeword for „G‟. Similarly after decoding all
62
Source Coding
the bit streams the receiver gets a message as “SGBIT”. This is a valid prefix code as
the received message is same as that of transmitted message. Let us consider an
illustration for non prefix code. The receiver keeps decoding the information after
receiving a bit stream 136114475. Once the first bit stream „1‟ is received, the receiver
decodes it as „S‟, as „1‟ is valid codeword for „S‟. Then for the next bit stream „3‟, which
is not a valid codeword hence it accepts the next bit code „36‟ is valid codeword for
„G‟. For the next bit stream „1‟, even though the sent message was „11‟ for the symbol
„B‟, but it will consider „1‟ as a valid codeword for symbol „S‟. Similarly after decoding
all the bit streams the receiver gets a message as “SGSSIT”. This is a non prefix code
as the received message is not same as that of transmitted message. From the above
illustrations it is observed that for an instantaneous code no codeword should be a prefix
of any other codeword. Hence, they are also called prefix codes.
Solution: It is observed that code 1 is not a prefix code as the codeword “111” is also
a prefix for the codeword “1110”. In case of code 2 the codeword “11” is also a prefix
for the codeword “1110”. Hence, it is not a prefix code. Similarly, in code 3 no
codeword is a prefix of other codewords. So, it is a prefix code. Decision tree for prefix
codeword is shown in fig 2.1.
63
Introduction to Information Theory and Coding
∑ ≤1
………………….2.1
Where „r‟ is number of different symbols used in the code alphabet, „li‟ is word length
of the codeword corresponding to ith symbol and „q‟ represents number of source
symbols.
Proof: Let „ni‟ represents the number of messages encoded in to codewords of length
„i‟. Then we have
For i=1, n1 ≤ r
………………….2.2
For i=2,
n2 ≤ (r-n1) r
n2 ≤ r2- n1r
………………….2.3
In a similar way, the number of message to be encoded to 3 digits which has to be
different from code words corresponding to n1 and n2 number of messages
64
Source Coding
ni ≤ ri-n1r(i-1)-n2r(i-2)……-n(i-1)r
………………….2.5
ni +n1r(i-1)+n2r(i-2)……+n(i-1)r ≤ ri
………………….2.6
Multiplying throughout by r-i, we get
∑ ≤1
………………….2.7
Since the actual number of messages „ni‟ has to be integer, we can rewrite equation 2.7
as,
………………….2.8
∑ =∑ +∑ +∑ +…+∑ ≤1
∑ ≤1
The unit of word length as “BINITS” which is the short form of “BINARY DIGITS”.
For binary codes, we have r=2, so that the Kraft inequality equation 2.3 becomes,
65
Introduction to Information Theory and Coding
∑ ≤1
Hr(S) =
………………….2.13
Where „r‟ is the number of different symbols used in code alphabet. The coding
efficiency denoted by “ ” is defined in equation (2.14) and equation (2.15). For binary
codes, we have
………………….2.14
66
Source Coding
………………….2.15
The coding redundancy denoted by is defined as
=1-
………………….2.16
The following steps indicate the Shannon‟s Procedure for generating binary codes.
Step 1: Note down the given source alphabet S = {S1, S2, S3, …, Sq} with their
corresponding probabilities P={ P1, P2, P3,…,Pq} for a given information source.
Where P1 ≥P2 ≥P3≥ …≥Pq.
1=0
2= P1= P1+ 1
3= P2+ P1= P2+ 2
………….
………….
………….
q+1= Pq + Pq-1 +…..+ P2 + P1 = Pq + q
67
Introduction to Information Theory and Coding
Where is the probability of symbol Si and the value of „i‟ lies in between 1 to q i.e.
i=1, 2, 3…..,q.
Step 5: Expand the decimal number „ i „in binary form till „li‟ number of places after
decimal point.
Symbols A B C D
Probability ⁄ ⁄ ⁄ ⁄
Symbols C D A B
Probability ⁄ ⁄ ⁄ ⁄
68
Source Coding
1=0
2= ( ⁄ )= 0.5
3=( ⁄ + ⁄ )= 0.9
4=( ⁄ + ⁄ + ⁄ )= 0.96
5=( ⁄ ⁄ + ⁄ + ⁄ )= 1
1=0
2= ⁄ = (0.5)10
0.5 x 2 = 0.00 with carry 1
0.00 x 2 = 0.00 with carry 0
Therefore 2= (.10)2
3=( ⁄ + ⁄ )= (0.9)10
0.9 x 2 = 0.8with carry 1
0.8 x 2 = 0.6with carry 1
0.6 x 2 = 0.2with carry 1
0.2 x 2 = 0.4with carry 0
Therefore 3= (.1110)2
69
Introduction to Information Theory and Coding
4=( ⁄ ⁄ ⁄ )= (0.96)10
0.96 x 2 =0.92 with carry 1
0.92 x 2 =0.84 with carry 1
0.84 x 2 =0.68 with carry 1
0.68 x 2 =0.36 with carry 1
0.36 x 2 =0.72 with carry 0
Therefore 4= (.11110)2
L={( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ ) }
L=1.75 binits/symbol
={(( ⁄ ) ( ⁄ )
) (( ⁄ )
( ⁄ )
) (( ⁄ )
( ⁄ )
) (( ⁄ )
( ⁄
)}
)
H(S)=1.45 bits/symbol
70
Source Coding
=82.8%
=17.2%
EXAMPLE 2.3 Consider symbols m1, m2, m3, m4, m5, m6, m7, and m8 with the
corresponding probabilities as shown in Table 2.11. Find the
(i) Codewords for the symbols by applying Shannon‟s algorithm.
(ii) Source efficiency and redundancy.
Step 1: Given source alphabet S ={ m1, m2, m3, m4, m5, m6, m7, m8 } with their
corresponding probabilities P={0.25,0.15,0.15,0.05,0.02,0.08,0.12,0.18} for a
given information source.
71
Introduction to Information Theory and Coding
Symbols m1 m8 m2 m3 m7 m6 m4 m5
Probability 0.25 0.18 0.15 0.15 0.12 0.08 0.05 0.02
2=0.25
3= (0.25+0.18)= 0.43
4=(0.43+0.15)= 0.58
5=(0.58+0.15)= 0.73
6 =(0.73+0.12)=0.85
7 =(0.85+0.08)=0.93
8 =(0.93+0.05)=0.98
9 =(0.98+0.02)=1
2= (0.25)10
72
Source Coding
3= (0.43)10
0.43 x 2 =0.86
0.86 x 2 =0.72 with carry 0
0.72 x 2 =0.44 with carry 0
0.44 x 2 =0.88 with carry 0
0.88 x 2 =0.76 with carry 1
Therefore 3= (.0001)2
4= (0.58)10
0.58 x 2 =0.16 with carry 1
0.16 x 2 =0.32 with carry 0
0.32 x 2 =0.64 with carry 0
0.64 x 2 =0.28 with carry 1
Therefore 4= (.1001)2
5=( 0.73)10
0.73 x 2 =0.46 with carry 1
0.46 x 2 =0.92 with carry 0
0.92 x 2 =0.84 with carry 1
0.84 x 2 =0.68 with carry 1
0.68 x 2 =0.36 with carry 1
Therefore 5= (.10111)2
6 =(0.85)10
Therefore 6= (.11011)2
7= (0.85+0.08)=0.93
0.93 x 2 = 0.86 with carry 1
0.86 x 2 = 0.72 with carry 1
0.72 x 2 = 0.44 with carry 1
0.44 x 2 = 0.88 with carry 0
0.88 x 2 = 0.76 with carry 1
0.76 x 2 = 0.52 with carry 1
0.52 x 2 = 0.04 with carry 1
Therefore 7= (.1110111)2
8= (0.98)10
0.98 x 2 = 0.96 with carry 1
0.96 x 2 = 0.92 with carry 1
0.92 x 2 = 0.84 with carry 1
0.84 x 2 = 0.68 with carry 1
0.68 x 2 = 0.36 with carry 1
0.36 x 2 = 0.72 with carry 0
Therefore 8= (.1111110)2
74
Source Coding
L= ∑ binits/symbol
L={
L=
L=3.11 binits/symbol
={( ) ( ) ( ) ( )
( ) ( ) ( ) ( )}
H(s)=2.73 bits/symbol
=87.78%
75
Introduction to Information Theory and Coding
=12.22%
EXAMPLE 2.4 Consider symbols S1, S2 and S3 with the corresponding probabilities ,
and respectively. Find
(i) Code words for the symbols by applying Shannon‟s algorithm and also
compute the
source efficiency and redundancy.
(ii) Recompute the codewords and the efficiency with the consideration of second
order extension for the given symbols.
Solution: (i) Consider the following steps to generate codewords using Shannon‟s
algorithm.
Step 1: Given source alphabet S = {S1, S2, S3} with their corresponding probabilities P=
{ , } for a given information source.
Step 2: Now arrange the probabilities in non-increasing order as given in Table 2.14
Symbols S2 S1 S3
Probability ⁄ ⁄ ⁄
2=( ⁄ ) 0.5
3= ( ⁄ )= 0.75
4= (0.75+ ⁄ )= 1
76
Source Coding
1=0
2=
(0.5)10
0.5 x 2=0 with carry 1
0 x 2 = 0 with carry 0
Therefore 2= (.10)2
3=
(0.75)10
0.75 x 2 =0.5 with carry 1
0.5 x 2=0 with carry 1
Therefore 3= (.11)2
77
Introduction to Information Theory and Coding
L= ∑ binits/ symbol
L={( ⁄ ) ( ⁄ ) ( ⁄ ) }
L=1.5 binits/symbol
Entropy is given by
H(S) = ∑ bits/symbol
={(( ⁄ ) ) (( ⁄ ) ) (( ⁄ ) )}
( ⁄ ) ( ⁄ ) ( ⁄ )
=100%
78
Source Coding
=0%
Step 1: Given source alphabet S ={ S1 S1, S1 S2, S1 S3, S2 S1, S2 S2, S2 S3, S3 S1, S3 S2, S3S3 }
with their corresponding probabilities P={ , , , , , , , , } for a given
information source.
Symbols S2 S2 S1 S2 S2 S1 S 2 S3 S3 S2 S1 S1 S 1 S3 S3 S1 S3 S3
Probability ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄
1=0
2=( ⁄ ) 0.25
3= ( ⁄ )= 0.375
4= (0.375+ ⁄ )= 0.5
5= (0.5+ ⁄ )= 0.625
6= (0.625+ ⁄ )= 0.75
7= (0.75+ ⁄ ) = 0.8125
8= (0.8125+ ⁄ ) = 0.875
9= (0.875+ ⁄ ) = 0.9375
10= (0.9375+ ⁄ )=1
2=
(0.25)10
0.25 x 2=0.5 with carry 0
0.5 x 2 = 0 with carry 1
0 x 2 = 0 with carry 0
Therefore 2= (.010)2
3= (0.375)10
0.375 x 2 =0.75 with carry 0
0.75 x 2=0.5 with carry 1
0.5 x 2 = 0 with carry 1
Therefore 3= (.011)2
4= (0.5)10
80
Source Coding
5= (0.625)10
0.625 x 2 =0.25 with carry 1
0.25 x 2=0.5 with carry 0
0.5 x 2 = 0 with carry 1
Therefore 5= (.101)2
6= (0.75)10
0.75 x 2=0.5 with carry 1
0.5 x 2 = 0 with carry 1
0 x 2 = 0 with carry 0
0 x 2 = 0 with carry 0
Therefore 6= (.1100)2
7= (0.8125)10
0.8125 x 2 =0.625 with carry 1
0.625 x 2=0.25 with carry 1
0.25 x 2 = 0.5 with carry 0
0.5 x 2 = 0 with carry 1
Therefore 7= (.1101)2
8= (0.875)10
0.875 x 2 =0.75 with carry 1
0.75 x 2=0.5 with carry 1
0.5 x 2 = 0 with carry 1
0 x 2 = 0 with carry 0
Therefore 8= (.1110)2
9= (0.9375)10
0.9375 x 2 =0.875 with carry 1
81
Introduction to Information Theory and Coding
L= ∑ binits/symbol
L={( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ )
( ⁄ ) ( ⁄ ) ( ⁄ ) }
Entropy is given by
H(S) = ∑ bits/symbol
82
Source Coding
={(( ⁄ ) ( ⁄ )
) (( ⁄ )
( ⁄ )
) (( ⁄ )
( ⁄ )
) (( ⁄ ) )
( ⁄ )
(( ⁄ ) ) (( ⁄ ) ) (( ⁄ ) ) (( ⁄ ) )}
( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ )
H(s)=3 bits/symbol
=100%
83
Introduction to Information Theory and Coding
Solution: (i) Consider the following steps to generate the codewords by applying
using Shannon-Fano approach.
Symbols D B A E C F
Step 2: Now, assign bit „1‟ to all the elements of first (upper) group and bit „0‟ to the
elements of second (lower) group.
Symbols D B A E C F
Probability (Pi) 0.3 0.25 0.15 0.12 0.1 0.08
Codes 11 10 01 001 0001 0000
Length (li) 2 2 2 3 4 4
L =2.48 binits/symbol
H(s) = ∑ bits/symbol
={ + + + + + }
= (0.52+0.5+0.41+0.36+0.33+0.29)
= = =0.9717
=97.17%
85
Introduction to Information Theory and Coding
=2.83%
Symbols D B A E C F
Probability (Pi) 0.3 0.25 0.15 0.12 0.1 0.08
Codes 11 10 01 001 0001 0000
Length (li) 2 2 2 3 4 4
Average Length ( L) L=2.48 binits/symbol
Entropy H(s) H(s)=2.41 bits/symbol
Source Efficiency ( ) =97.17%
Source Redundancy ( ) =2.83%
Solution: (i) Consider the following steps to generate the codewords by applying
using Shannon-Fano approach.
Symbols Z Y X
Step 2: Now, assign bit „1‟ to all the elements of first (upper) group and bit „0‟ to the
elements of second (lower) group.
86
Source Coding
0.74 (1)
(0)
0.18 (0) 0.18 (1)
0.08 (0)
0.08 (0)
Symbols Z Y X
Probability (Pi) 0.74 0.18 0.08
Codes 1 01 00
Length (li) 1 2 2
Average Length
L1= ∑ binits/ symbol
= (0.74)(1)+(0.18)(2)+(0.08)(2)
= (0.74+0.36+0.16)
L1 =1.26 binits/symbol
H(s)= ∑
={ + + }
={0.32+0.44+0.29}
87
Introduction to Information Theory and Coding
=83.3%
=16.6%
Symbols Z Y X
Probability (Pi) 0.74 0.18 0.08
Codes 1 01 00
Length (li) 1 2 2
Average Length (L1) L1=1.26 binits/symbol
Entropy H(s) H(s)=1.05 bits/symbol
Source Efficiency ( ) 83.3%
Source Redundancy ( ) 16.6%
(ii) For 2nd Extension the Symbols and Probabilities are given as
Symbols XX XY XZ YX YY YZ ZX ZY ZZ
Probability (Pi) 0.0064 0.0144 0.0592 0.0144 0.0324 0.1332 0.0592 0.1332 0.5476
88
Source Coding
Symbols ZZ YZ ZY XZ ZX YY XY YX XX
Probability (Pi) 0.5476 0.1332 0.1332 0.0592 0.0592 0.0324 0.0144 0.0144 0.0064
Step 2: Now, assign bit „1‟ to all the elements of first group (upper group) and bit „0‟
to the elements of second group (lower group).
Symbols ZZ YZ ZY XZ ZX YY XY YX XX
Probability (Pi) 0.5476 0.1332 0.1332 0.0592 0.0592 0.0324 0.0144 0.0144 0.0064
Codes 1 011 010 0011 0010 0001 00001 000001 000000
Length (li) 1 3 3 4 4 4 5 6 6
89
Introduction to Information Theory and Coding
= {(0.5476) (1) + (0.1332) (3) (2) + (0.0592) (4) (2) + (0.0324) (4) + (0.0144) (5) + (0.0144)
(6) + (0.0064) (6)}
= (0.5476+0.7992+0.4736+0.1296+0.072+0.0864+0.0384)
L2 =2.14 binits/symbol
H(s2) = ∑ bits/symbol
={ +( ) (2)+( )(2) + +
( )(2) + }
= (0.47+0.77+0.48+0.16+0.17+0.04)
=98.13%
=1.87%
90
Source Coding
91
Introduction to Information Theory and Coding
Step 2: Now, assign bit „2‟ to all the elements of first (upper) group, bit „1‟ to the
elements of second (middle) group and bit „0‟ to the elements of third (lower)
group.
0.3 (2)
0.3 (1)
Average Length
L= ∑ binits/ symbol
92
Source Coding
=(0.3)(1)+(0.3)(1)+(0.15)(2)+(0.15)(2)+(0.05)(3)+(0.03)(3)+ (0.02)(3)
= (0.3+0.3+0.3+0.3+0.15+0.09+0.06)
L =1.5 binits/symbol
H(S) = ∑ bits/symbol
={ + + +
+ + + }
= (0.52+0.52+0.41+0.41+0.216+0.15+0.112)
Hr(s) =
For r=3,
Hr(s) =
Therefore
93
Introduction to Information Theory and Coding
=98.4%
=1.6%
94
Source Coding
Where ‘q’ is the number of source symbols and ‘r’ is the number of different symbols used in
the code alphabet. The quantity ‘ is calculated and it should be an integer. If it is not, then
‘dummy symbols’ with zero probabilities are added to ‘q’ to make the quantity an integer.
EXAMPLE 2.8 Apply Huffman Encoding Procedure to generate binary codes for the
given symbols A, B, C, D, E and F with the corresponding probabilities 0.15, 0.2, 0.25,
0.06, 0.03 and 0.31 respectively. Also compute efficiency and redundancy of the
source code.
Solution: Using Equation (2.17) it is required to compute the value of „ ‟. For binary
code r= 2 and given source symbols (q) = 6.Therefore,
= = = 4.
Source Probability
Stage 1 Stage 2 Stage 3 Stage 4
Symbols (Pi)
F 0.31 0.31 0.31 0.44 0.56 (0)
E 0.03 (1)
95
Introduction to Information Theory and Coding
Symbols F C B A D E
Probability (Pi) 0.31 0.25 0.2 0.15 0.06 0.03
Codes 00 01 11 100 1010 1011
Length (li) 2 2 2 3 4 4
Average Length
L= ∑ binits/ symbol
=(0.31)(2)+(0.25)(2)+(0.2)(2)+(0.15)(3)+(0.06)(4)+(0.03)(4)
= (0.62+0.5+0.4+0.45+0.24+0.12)
L =2.33 binits/symbol
H(S) = ∑ bits/symbol
={ + + + + + }
= (0.52+0.5+0.46+0.41+0.24+0.15)
=97.8%
96
Source Coding
=2.1%
Solution: Using Equation (2.17) it is required to compute the value of „ ‟. Hence, for
binary code r= 2 and given that source symbols (q) = 3. Therefore
97
Introduction to Information Theory and Coding
= = = 1.
Source Probability
Stage 1
Symbols (Pi)
P 0.62 0.62 (0)
R 0.1 (1)
Average Length
L1= ∑ binits/ symbol
=(0.62)(1)+(0.28)(2)+(0.1)(2)
= (0.62+0.56+0.2)
L1 =1.38 binits/symbol
H(S) = ∑ bits/symbol
98
Source Coding
={ + + }
= (0.42+0.51+0.33)
=91.3%
=8.7%
Symbols P Q R
Probability (Pi) 0.62 0.28 0.1
Codes 0 10 11
Length (li) 1 2 2
Average Length (L) L1=1.38 binits/symbol
Entropy H(s) H(s)=1.26 bits/symbol
Source Efficiency ( ) =91.3%
Source Redundancy ( ) =8.6%
99
Introduction to Information Theory and Coding
For Second Extension the following steps are considered to generate codewords.
Symbols PP PQ PR QP QQ QR RP RQ RR
Probability
0.3844 0.1736 0.062 0.1736 0.0784 0.028 0.062 0.028 0.01
(Pi)
Source Probability
Stage 1 Stage 2 Stage 3 Stage 4 Stage 5 Stage 6 Stage 7
Symbols (Pi)
PP 0.3844 0.3844 0.3844 0.3844 0.3844 0.3844 0.3844 0.6156 (0)
PQ 0.1736 0.1736 0.1736 0.1736 0.1736 0.2684 0.3472 (0) 0.3844 (1)
Symbols PP PQ QP QQ PR RP QR RQ RR
Probability
0.3844 0.1736 0.1736 0.0784 0.062 0.062 0.028 0.028 0.01
(Pi)
Codes 1 000 001 0100 0110 0111 01011 010100 010101
Length (li) 1 3 3 4 4 4 5 6 6
Average Length
L2= ∑ binits/ symbol
={(0.3844)(1)+(0.1736)(3)+(0.1736)(3)+(0.0784)(4)+(0.062)(4)+(0.062)(4)+(0.028)(5)
+(0.028)(6)+(0.01)(6)}
= (0.3844+0.5208+0.5208+0.3136+0.248+0.248+0.14+0.168+0.06)
L2 =2.6 binits/symbol
H(s2)=2.52 bits/symbol
= = =0.976
=97.6%
101
Introduction to Information Theory and Coding
=2.4%
Symbols PP PQ QP QQ PR RP QR RQ RR
Probability
0.3844 0.1736 0.1736 0.0784 0.062 0.062 0.028 0.028 0.01
(Pi)
Codes 1 000 0001 00000 00001 000001 0000001 0000000 00000001
Length (li) 1 3 4 5 5 6 7 7 8
Avg. Length L2=2.6 binits/symbol
Entropy H(s) H(s2)=2.52 bits/symbol
Efficiency ( ) =97.6%
Redundancy
=2 .4%
( )
EXAMPLE 2.10 For a memoryless source (S) which emits the symbols A, B, C, D, E, F
and G with the corresponding probabilities 0.2, 0.15, 0.03, 0.05, 0.09, 0.08, and 0.4
respectively.
(i) Construct a binary Huffman Code by placing the composite symbols as
low as possible.
(ii) Generate binary Huffman Code by placing the composite symbols as
high as possible.
Solution: Using Equation (2.17) it is required to compute the value of „ ‟. Hence, for
binary code r= 2 and given that source symbols (q) = 7. Therefore
= = = 5.
102
Source Coding
Symbols A B C D E F G
Source Probability
Stage 1 Stage 2 Stage 3 Stage 4 Stage 5
Symbols (Pi)
G 0.4 0.4 0.4 0.4 0.4 0.6 (0)
A 0.2 0.2 0.2 0.24 0.36 (0) 0.4 (1)
B 0.15 0.15 0.16 0.2 (0) 0.24 (1)
E 0.09 0.09 0.15 (0) 0.16 (1)
F 0.08 0.08 (0) 0.09 (1)
D 0.05 (0) 0.08 (1)
C 0.03 (1)
Symbols G A B E F D C
Probability (Pi) 0.4 0.2 0.15 0.09 0.08 0.05 0.03
Codes 1 000 010 011 0010 00110 00111
Length (li) 1 3 3 3 4 5 5
Average Length
L= ∑ binits/ symbol
=(0.4)(1)+(0.2)(3)+(0.15)(3)+(0.09)(3)+(0.08)(4)+(0.05)(5)+(0.03)(5)
= (0.4+0.6+0.45+0.27+0.32+0.25+0.15)
L =2.44 binits/symbol
103
Introduction to Information Theory and Coding
H(S) = ∑ bits/symbol
={ + + + + +
+ 0.03 }
= (0.528+0.464+0.410+0.312+0.291+0.216+0.15)
=97.1%
Redundancy of the source
=1- = (1-0.971) =0.029
=2.9%
Symbols G A B E F D C
Probability (Pi) 0.4 0.2 0.15 0.09 0.08 0.05 0.03
Codes 1 000 010 011 0010 00110 00111
Length (li) 1 3 3 3 4 5 5
Average Length L=2.44 binits/symbol
Entropy H(s) H(s)=2.37 bits/symbol
Efficiency ( ) =97.1%
Redundancy ( ) =2.9%
104
Source Coding
Source Probability
Stage 1 Stage 2 Stage 3 Stage 4 Stage 5
Symbols (Pi)
G 0.4 0.4 0.4 0.4 0.4 0.6 (0)
A 0.2 0.2 0.2 0.24 0.36 (0) 0.4 (1)
B 0.15 0.15 0.16 0.2 (0) 0.24 (1)
E 0.09 0.09 0.15 (0) 0.16 (1)
F 0.08 0.08 (0) 0.09 (1)
D 0.05 (0) 0.08 (1)
C 0.03 (1)
Average Length
L= ∑ binits/ symbol
=(0.4)(1)+(0.2)(3)+(0.15)(3)+(0.09)(3)+(0.08)(4)+(0.05)(5)+(0.03)(5)
= (0.4+0.6+0.45+0.27+0.32+0.25+0.15)
L =2.44 binits/symbol
={ + + + + +
+ 0.03 }
105
Introduction to Information Theory and Coding
= (0.528+0.464+0.410+0.312+0.291+0.216+0.15)
=97.1%
=2.9%
Code Tree:
106
Source Coding
EXAMPLE 2.11 For a memoryless source (S) which emits the symbols A, B, C, D, E
and F with the corresponding probabilities 0.01, 0.08, 0.27, 0.42, 0.06 and 0.16
respectively. Design Ternary source code using Huffman coding procedure. Also
find the efficiency and redundancy of the code.
Solution: Using Equation (2.17) it is required to compute the value of „ ‟. Hence, for
ternary code r= 3 and given that source symbols (q) = 6.
Therefore,
= = =
Since, „ ‟ is a non integer, we need to add dummy symbols to make it an integer. Hence,
„ ‟ becomes an integer only for q=5, 7, 9, 11….and next higher integer to q=6 in the
sequence is 7, so one dummy symbol would suffice.
Symbols A B C D E F G(Dummy)
Probability (Pi) 0.01 0.08 0.27 0.42 0.06 0.16 0
Source Probability
Stage 1 Stage 2
Symbols (Pi)
D 0.42 0.42 0.42(0)
C 0.27 0.27 0.31(1)
F 0.16 0.16(0) 0.27(2)
B 0.08 0.08(1)
E 0.06 (0) 0.07(2)
A 0.01 (1)
G(Dummy) 0 (2)
107
Introduction to Information Theory and Coding
Symbols D C F B E A G(Dummy)
Probability (Pi) 0.42 0.27 0.16 0.08 0.06 0.01 0
Codes 0 2 10 11 120 121 122
Length (li) 1 1 2 2 3 3 3
Average Length
L(3)= ∑ binits/ symbol
=(0.42)(1)+(0.27)(2)+(0.16)(2)+(0.08)(2)+(0.06)(3)+(0.01)(3)+(0)(3)
= (0.42+0.54+0.32+0.16+0.18+0.03+0)
={ + + + + + + 0}
= (0.5256+0.5100+0.4230+0.2915+0.2435+0.066+0)
H3(s)= =
108
Source Coding
=78.18%
=21.82%
Symbols D C F B E A G(Dummy)
Probability (Pi) 0.42 0.27 0.16 0.08 0.06 0.01 0
Codes 0 2 10 11 120 121 122
Length (li) 1 1 2 2 3 3 3
Average Length L(3)=1.65 trinits/symbol
Entropy H3(s) H3(s)=1.29 ternary units/symbol
Efficiency ( ) =78.18%
Redundancy ( ) =21.82%
EXAMPLE 2.12 For a memoryless source (S) which emits the symbols P, Q, R, S, T,
U, V and W with the corresponding probabilities 0.10, 0.18, 0.15, 0.15, 0.06, 0.04, 0.12
and 0.20 respectively. Design Quaternary source code using Huffman coding
procedure. Also find the efficiency and redundancy of the code.
Solution: Using Equation (2.17) it is required to compute the value of „ ‟. Hence, for
Quaternary code r= 4 and given that source symbols (q) = 8.
Therefore
= = =
109
Introduction to Information Theory and Coding
Since, „ ‟ is a non integer, we need to add dummy symbols to make it an integer. Hence,
„ ‟ becomes an integer only for q=7, 10, 13, 16….and next higher integer to q=8 in the
sequence is 10, so two dummy symbols would suffice.
Source Probability
Stage 1 Stage 2
Symbols (Pi)
W 0.20 0.20 0.47 (0)
Q 0.18 0.18 0.20 (1)
R 0.15 0.15 0.18 (2)
S 0.15 0.15 (0) 0.15 (3)
V 0.12 0.12 (1)
P 0.10 0.10 (2)
T 0.06 (0) 0.10 (3)
U 0.04 (1)
X 0 (2)
Y 0 (3)
110
Source Coding
Average Length
L(4)= ∑ binits/symbol
={(0.20)(1)+(0.18)(1)+(0.15)(1)+(0.15)(2)+(0.12)(2)+(0.10)(2)+(0.06)(3)
+(0.04)(3)+(0)(3)+(0)(3)}
= (0.20+0.18+0.15+0.30+0.24+0.20+0.18+0.12+0+0)
H(S) = ∑ bits/symbol
={ + +( )(2)+ + +
+ +0+ 0}
= (0.4643+0.4453+0.8210+0.3670+0.0332+0.2435+0.1857+0+0)
H4(s)= =
=81.52%
111
Introduction to Information Theory and Coding
=18.47%
Symbols W Q R S V P T U X Y
Probability (Pi) 0.20 0.18 0.15 0.15 0.12 0.10 0.06 0.04 0 0
Length (li) 1 1 1 2 2 2 3 3 3 3
Average Length
L(4)=1.57 quaternary digits/symbol
L(4)
Entropy H4(s) H4(s)=1.28 quaternary units/symbol
Efficiency ( ) =81.52%
Redundancy
=18.47%
( )
C= B ( ) bits /second
C= [H( ) – H(N)]max
………………….2.18
112
Source Coding
But we have,
H(N)max = B bits/ sec
………………….2.19
Then,
H(γ)max = B bits/ sec
………………….2.20
= (S+N)
………………….2.21
Substituting equation (2.21) in equation (2.20) we get
C= [B –B ]
C=
C=B
C= B ( ) bits /second
………………….2.23
EXAMPLE 2.13 A Gaussian channel has a 10MHz bandwidth. If SNR is 100, calculate
the Channel Capacity and the maximum information rate.
Solution: Given B= 10 x 106 Hz and =100. Using equation (2.23), the Channel
Capacity is obtained as
C= B ( ) bits /second
113
Introduction to Information Theory and Coding
C= 10 x 106
C=66.58 M bits/second
Rmax = B e
= 106
C= 9.967 M bits/second
114
Source Coding
is introduced in example 2.7, which shows the issues for some extent but fails to
results optimal solution where the computation of codeword for different
combination of length for every mth extension is not possible when the values of m
increases. Hence, Arithmetic coding is introduced which generates variable length
code. It is useful when dealing with binary source having small alphabets. In this
method a unique identifier/ tag is used to distinguish a sequence of symbols from
another sequence of symbols represented by binary fraction values. The tag value is
always lies in the range of 0 to 1, where 0 denotes the lower limit and 1 denotes upper
limit. Table 2.53 shows the detailed algorithm for arithmetic coding method.
Step 1: Divide the numeric range 0 to 1 into number of different symbol present in the
message.
Step 2: Expand the first letter to be encoded along with the range. Further, sub-divide this
Total(message)=
115
Introduction to Information Theory and Coding
Solution:
To encode the Character „S‟, the value of upper limit and lower limit is 1 and 0.7
respectively. Its difference (D) is
D= 1-0.7= 0.3
For Character „I‟, the range is
R (I) = 0.7 + (0.3 X 0.1) =0.73
116
Source Coding
For step2, to encode the Character „G‟, the value of upper limit and lower limit is 0.91
and 0.835 respectively. Its difference (D) is
D= 0.91-0.835= 0.075
For Character „I‟, the range is
R (I) = 0.835 + (0.075 X 0.1) =0.8425
For Character „T‟ the range is
R (T) = 0.8425+ (0.075 X 0.1) =0.85
For Character „B‟ the range is
R (B) = 0.85+ (0.075 X 0.25) =0.86875
For Character „G‟ the range is
R (G) = 0.86875+ (0.075 X 0.25) =0.8875
For Character „S‟ the range is
R (S) = 0.8875+ (0.075 X 0.3) =0.91
For step 3, to encode the Character „B‟, the value of upper limit and lower limit is
0.8685 and 0.85 respectively. Its difference (D) is
D= 0.8685-0.85= 0.01875
For Character „I‟, the range is
R (I) = 0.85 + (0.01875 X 0.1) =0.851875
117
Introduction to Information Theory and Coding
For step 4, to encode the Character „I‟, the value of upper limit and lower limit is
0.851875 and 0.85 respectively. Its difference (D) is
D= 0.851875-0.85= 0.001875
For Character „I‟, the range is
R (I) = 0.85 + (0.001875 X 0.1) =0.8501875
For Character „T‟ the range is
R (T) = 0.8501875+ (0.001875 X 0.1) =0.850375
For Character „B‟ the range is
R (B) = 0.850375+ (0.001875 X 0.25) =0.85084375
For Character „G‟ the range is
R (G) = 0.85084375+ (0.001875 X 0.25) =0.8513125
For Character „S‟ the range is
R (S) = 0.8513125+ (0.001875 X 0.3) =0.851875
Finally, the value of upper limit and lower limit of Character „T‟ is 0.8501875 and
0.81875 respectively. Hence, total tag value of the String “SGBIT” is
118
Source Coding
Total (SGBIT)=
Total(SGBIT)= 0.83446875
Step 1: Divide the numeric range 0 to 1 into number of different symbol present in the
message.
Step 2: Expand the first letter to be decoded along with the range. Further, sub-divide this
range into number of symbols with respect to tag value.
Step 3: Repeat the procedure until the tag value lies in the prescribed range.
Step 4: If the sub divided value is lies nearer to the assigned tag value, then stop the
process.
Step 5: Note down the decoded message.
EXAMPLE 2.15: Decode the message “0.572” given in the coding model with
Probabilities P(C) = 0.4, P(E)=0.5 and P(1)=0.1
Solution: The decoding process using arithmetic process is as shown in fig 2.7.
119
Introduction to Information Theory and Coding
Calculation: The message 0.572 lies in the range of 0.4 to 0.9. For step 1, it is required
to obtain the difference value (D) using
D= 0.9-0.4= 0.5
For Character „C‟, the range
D= 0.6-0.4= 0.2
For Character „C‟, the range is
R (C) = 0.4+ (0.2 X 0.4) =0.48
For Character „E‟ the range is
R (E) = 0.48+ (0.2 X 0.5) =0.58
Similarly,
R (1) = 0.58+ (0.2 X 0.1) =0.6
For step 3, it is noticed that the value 0.572 lies in the range of 0.48 to 0.58.
D= 0.58-0.48= 0.10
For Character „C‟, the range is
R(C) = 0.48+ (0.1 X 0.4) =0.52
For Character „E‟ the range is
R (E) = 0.52+ (0.1 X 0.5) =0.57
Similarly,
R (1) = 0.57+ (0.1 X 0.1) =0.58
Finally 0.572 lies in between 0.57 to 0.58. Hence, it is concluded that the decoded
message will be ECE1. Since, 0.57 and 0.58 which is the range of termination
character, stop the process.
121
Introduction to Information Theory and Coding
Step 1: The source sequence is sequentially passed in to strings that have not appeared so
far.
Step 2: After every separation we look along input sequence until we come to the shortest
string that has not been marked off before.
Step 3: We code this phrase by giving the location of the prefix and the value of the last
bit.
EXAMPLE 2.16: Obtain the codewords using Lempel-Ziv coding method for the
given string
AABABBBABAABABBBABBABBA.
Step 1: The source sequence is sequentially passed in to strings that have not
appeared so far.
AABABBBABAABABBBABBABBA
Step 2: After every separation we look along input sequence until we come to the
shortest string that has not been marked off before.
Step 3: We code this phrase by giving the location of the prefix and the value of the
last bit. Assume the values of A=0, B=1 and null ( )=000 to generate the
codewords.
122
Source Coding
000000110101000101001011100101101000
In order to generate a codewords, we have to look after the prefix of the last bit. For
the sequence „A‟ with position 1, it is noticed that prefix of „A‟ is null ( ).Hence, the
codeword is „0000‟. For the sequence „AB‟ with position 2, the prefix of last bit „B‟ is
„A‟ but the position for „A‟ is 1 and the generated codeword is „0011‟. Similarly for the
sequence „ABB‟ with position 3, the prefix of last bit „B‟ is „AB‟ but the position for
„AB‟ is 2 hence the generated codeword is „0101‟. The process of generating
codewords for the respective sequence continues till the position of last sequence (say
position 9).
Step 2: After every separation we look along input sequence until we come to the
shortest string that has not been marked off before.
123
Introduction to Information Theory and Coding
Step 3: We code this phrase by giving the location of the prefix and the value of the
last bit. Assume the value of null ( )=000 to generate the codewords.
00010000001000110101011110100110
In order to generate a codewords, we have to look after the prefix of the last bit. For
the sequence „1‟ with position 1, it is noticed that prefix of „1‟ is null ( ).Hence, the
codeword is „0001‟. For the sequence „0‟ with position 2, the prefix of „0‟ is null ( ) and
the generated codeword is „0000‟. Similarly for the sequence „10‟ with position 3, the
prefix of last bit „0‟ is „1‟ but the position for „1‟ is 1, hence the generated codeword is
„0010‟. The process of generating codewords for the respective sequence continues till
the position of last sequence (say position 8).
Step 1: Create an initial dictionary with index and content of characters in a sequence.
Step 2: After every separation including previous characters, we look along input sequence
until, we come to the shortest string that has not been marked off before.
Step 3: Obtain the encoded output for the separated string of characters.
Step 1: Create an Initial Dictionary which consists of index and entry of sequence.
Step 2: The encoding output for the above string is obtained by providing the entries
in the Table 2.67.
Therefore, the encoded output sequence for the given string ababbabcababba is
124523461
126
Source Coding
Step 1: Create an Initial Dictionary which consists of index and entry of sequence.
Step 2: The encoding output for the above string is obtained by providing the entries
in the Table 2.69.
Therefore, the encoded output sequence for the given string 101011011 is
123161
127
Introduction to Information Theory and Coding
128
Source Coding
THINGS TO BE
REMEMBER
1. Different types of codes are Block 6. The Huffman codes are also called
codes, Non-singular codes, Compact codes.
uniquely decodable codes, q=r+(r-1)
Instantaneous codes and optimal =
codes. The necessary condition for an 7. The capacity a band limited Gaussian
instantaneous code is “No codeword channel with AWGN is given by
should be a prefix of any other
codeword”. Thus they are also called C= B ( ) bits /second
prefix codes.
8. Arithmetic Coding is useful when
the binary source having small
2. All prefix codes must satisfy the
alphabets. Here, a unique
Kraft Inequality property
identifier/tag is used to distinguish a
∑ ≤1
sequence of symbols from another
sequence of symbols represented by
3. Average Codeword length „L‟ is
binary fraction values. The tag value
obtained by
is always lies in the range of [0 to 1].
∑ bits/symbol
129
DESCRIPTIVE
QUESTIONS
1. Derive the expression for the code 6. Consider a zero memory source S=
efficiency and code redundancy. {S1, S2, S3, S4, S5, S6} with the
probabilities P={ 0.1, 0.2, 0.1, 0.4, 0.05,
2. Explain the steps in the Shannon‟s 0.1, 0.05}. Construct a binary Huffman
Encoding procedure for generating code by placing the composite symbol
binary codes. as high as possible. Also calculate the
variance of word length.
3. Apply Shannon‟s encoding algorithm
to generate binary codes for the set of 7. Explain the important properties of
symbols S1, S2, S3, S4 and S5 with their codes to be considered while
probabilities , , , and encoding a source.
respectively.
8. A discrete memory-less source with
4. Apply Shannon‟s Fano Coding alphabets “A to H” has respective
algorithm to generate binary codes probabilities 0.22, 0.20, 0.18, 0.15, 0.10,
for the set of symbols S= {S1, S2, S3, S4, 0.08, 0.05 and 0.02. Construct binary
S5, S6, S7} with the probabilities of P= code and ternary codes for the same
using Huffman‟s encoding algorithm.
{ , , , , , , } respectively. Also
Determine code efficiency in each
find the coding efficiency and
case.
redundancy.
9. State and explain the Shannon-
5. Consider a discrete memoryless Hartley law. Obtain an expression
source S= {S1, S2, S3, S4, S5, S6} with the for the maximum capacity of a
probabilities P={ 0.4, 0.2, 0.1, 0.1, 0.1, continuous channel.
0.05, 0.05}. Construct a binary
Huffman code by placing the 10. Explain the prefix coding and
composite symbol as low as possible. decision tree with examples.
Also calculate the variance of word
length.
130
Source Coding
131
Introduction to Information Theory and Coding
MULTIPLE CHOICE
QUESTIONS
9. In dictionary techniques for data 10. Which bitmap file format supports
compaction, which approach of building the Run Length Encoding.
dictionary is used for the prior (a) TIFF
knowledge of probability of the (b) BMP
frequently occurring patterns? (c) PCX
(a) Static Dictionary (d) All of the above.
(b) Adaptive Dictionary
(c) Both a and b
(d) None of the above
Answers
Q. No 1 2 3 4 5
Options b a b a a
Q. No 6 7 8 9 10
Options a b a a d
References
[1] H. Jafarkhani, Space Time Coding: Theory and Practice, Cambridge University
Press, 2005.
[2] B. Vucetic and J. Yuan, Space Time Coding, Wiley, 2003.
[3] W. Stallings, Cryptography and Network Security: Principles and Practice, 4th Edition,
Prentice Hall, 2006.
[4] B. Schneier, Applied Cryptography: Protocols, Algorithms and Source Code in C, John
Wiley & Sons, 2nd Edition, 1995.
[5] M. Bloch and J. Barros, Physical Layer Security, Cambridge University Press, 2011.
[6] R. Liu and W. Trappe, Securing Wireless Communications at the Physical Layer,
Springer, 2010.
[7] Shanmugam K San, Digital and Analog Communication System, John Wiley and
Sons: New York; 1989.
[8] Muralidhar Kulkarni and K. S. Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
133
Introduction to Information Theory and Coding
[9] J. S. Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[10] K. Giridhar, Information Theory and Coding, Pooja Publications.
[11] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
[12] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
134
Chapter 3
Information Channels
Syllabus: Communication Channels. Channel Models, Channel Matrix, Joint probability
Matrix, Binary Symmetric Channel, System Entropies, Mutual Information, Channel
Capacity, Channel Capacity of: Binary Symmetric Channel, Binary Erasure Channel,
Muroga,s Theorem, Continuous Channels.
RBT Level: (L1, L2, L3)
Contents
3. Information Channel Page. No
Learning Objectives
3.1 Introduction.............................................................................................................. ..............135
3.1.1 Representation of a Channel......................................................................................135
3.2 Joint Probability......................................................................................................... .............138
3.2.1 Properties of Joint Probability Matrix.......................................................................139
3.3 Entropy Function and Equivocation...................................................................................142
3.4 Rate of Information transmission over a discrete channel..............................................144
3.4.1 Capacity of a discrete memory less channel............................................................144
3.4.2 Channel efficiency and Redundancy........................................................................144
3.5 Special Channels....................................................................................................................145
3.5.1 Symmetric Channel.....................................................................................................145
3.5.2 Binary Symmetric Channel........................................................................................152
3.5.3 Binary Erasure Channel..............................................................................................160
3.5.4 Noiseless Channel.......................................................................................................163
3.5.5 Deterministic Channel................................................................................................165
3.5.6 Cascaded Channel.......................................................................................................167
3.6 Estimation of Channel Capacity by Muroga’s Method...................................................173
3.7 Continuous Channels...........................................................................................................179
Things to be remember
Descriptive Questions
Multiple Choice questions
References
135
I just wondered how
things were put together
-Claude. E. Shannon
136
3 INFORMATION CHANNELS
Learning Objectives
3.1 Introduction
A channel is defined as the medium through which the coded signals produced by
an information source are transmitted. In the digital communication system the
binary data is presented at the input and the transmitted data is expected at the
receiver. Hence, the channel is considered as communication channel with various
kinds of disturbances. These disturbances may be due to its variations of amplitude
and frequency. The main characteristic of a data communication system is Channel
Capacity which represents the maximum rate at which data is transmitted with a
small probability of error across the channel. Let us see how a discrete communication
channel is completely modeled in the following section.
137
Information Theory and Coding
The conditional probabilities come into the picture due to the generation of noise at
the channel. This leads to produce the content of noise and results an uncertainty at
the receiver (loss of information). So a different number of „s‟ and „r‟ symbols are
considered at receiver and transmitter respectively. The term channel matrix or noise
matrix is represented in equation 3.1 with the arrangement of r x s number of
conditional probabilities in a matrix form, row wise input symbols and column wise
output symbols.
( ⁄ ) ( ⁄ ) ( ⁄ )
P( ⁄ * or P( ⁄ ) = ( ⁄ ) ( ⁄ ) ( ⁄ )
[ ( ⁄ ) ( ⁄ ) ( ⁄ )]
………………….3.1
Let us consider following example to illustrate the effect of noise and inter symbol
conversion. Now, consider input alphabet „A‟ emitting discrete symbols at the
transmitter with a symbols {a1, a2, a3} with a encoded binary coding as 00, 01 and 10
respectively. Because of the presence of noise in the channel receiver receives four
symbols with an alphabet B and symbols {b1,b2,b3,b4} with a codewords 00, 01, 10, and
11. Figure 3.2 illustrates “Channel Diagram” or “Noise diagram”.
138
Information Channels
P( ⁄ )+ P( ⁄ )+ P ( ⁄ )+ P( ⁄ ) = 1
................3.3
If we generalize the equation (3.3) for „s‟ output symbols and „r‟ input symbols with
respect to Figure 3.2, we get
P( ⁄ )+ P( ⁄ )+ P ( ⁄ )+............+ P( ⁄ ) = 1
∑ ( ⁄ *=1
139
Information Theory and Coding
For the „r‟ input symbols the probabilities are P(a1), P(a2),.........., P(ar)=1
∑ =1
Total probability theorem is used to find the channel matrix elements P( ⁄ ) for all i
and j, input symbol probabilities P(ai) for all „i‟ and output symbol probabilities P(bj)
for all „j‟.
P(b1)= P( ⁄ ) P(a1)+P( ⁄ ) P(a2)+............+ P( ⁄ ) P(ar)
( ⁄ *
P( ⁄ *=
.........................3.3
3.2 Joint Probability
If „ai‟ and „bj‟ denotes input and output symbol, then the joint probability of both the
symbols is given by
140
Information Channels
( ⁄ ) ( ⁄ ) ( ⁄ )
P( ⁄ * P( )= ( ⁄ ) ( ⁄ ) ( ⁄ )
[ ( ⁄ ) ( ⁄ ) ( ⁄ ) ]
.......................3.5
Substituting equation (3.4) in equation (3.5) we get,
........................3.6
From the equation (3.6) it is observed that the elements in the matrix are having
different joint probabilities between the input and output symbols. Such type of
arrangement matrix is called Joint Probability Matrix (JPM) represented by ( )
or
∑ ∑ ( )=
........................3.9
141
Information Theory and Coding
EXAMPLE 3.1 Consider a set of symbols A= {a1, a2, a3} at the transmitter and a set of
symbols B= {b1, b2, b3} at the reception. For the Table 3.1, find the missing probabilities
(*) and also find P( ⁄ ) and P( ⁄ ).
∑ =1 and s =3
P( )+ P( )+ P( )=1
P( )+ ⁄ + ⁄ =1
P( )=1-( ⁄ )-( ⁄ )
P( )= ⁄
From the first property of JPM for the first column, we have
P( ) = P(a1, b1)+ P(a2, b1)+ P(a3, b1)
⁄ = (P(a1, b1)+ ⁄ + ⁄ )
P(a1, b1)= ⁄ - ⁄ - ⁄
P(a1, b1)= ⁄
142
Information Channels
⁄ = ( ⁄ + ⁄ +P(a3, b2))
P(a3, b2)=( ⁄ - ⁄ - ⁄ )
P(a3, b2)= ⁄
P(a2, b3)= ( ⁄ - ⁄ )
P(a2, b3)= ⁄
Can be rewritten as
P( ⁄ * =
........................3.10
From the second property of JPM, for the first row
P( ) = P(a1, b1)+ P(a1, b2)+ P(a1, b3)
P( ) = ( ⁄ + ⁄ + ⁄ )
143
Information Theory and Coding
P( ⁄ ) = ⁄
P( ⁄ )= ⁄
144
Information Channels
H( ⁄ )= ∑ ⁄ bits/message symbol
⁄
....................3.13
3. Equivocation: Equivocation is stated as the average value of all the
conditional probabilities illustrated in equation (3.13) when the value of „j‟
varies from 1 to s. It denoted by H( ⁄ ) and given by
H ( ⁄ )= E[H( ⁄ )]
Above equation can also be written as
=∑ H( ⁄ )
Where ∑ =1
=∑ ∑ ⁄
⁄
=∑ ∑ ⁄
⁄
From the equation (3.4) we have P(ai, bj)= P( ⁄ * P( ), substitute in the above
equation
H( ⁄ )=∑ ∑ bits/symbol
⁄
...........................3.14
H( ⁄ )=∑ ∑ bits/symbol
⁄
145
Information Theory and Coding
Or ...........................3.15
C=Max[H(A)-H( ⁄ )]rs
...........................3.16
3.4.2 Channel Efficiency and Redundancy
The efficiency of the channel is denoted as “ “and it is given by
= x 100%
...........................3.17
Now, Substitute the value of Rt and C from the equation (3.15) and equation (3.17)
⁄
= x 100%
( ⁄ )
146
Information Channels
= x 100%
..............3.18
= 1-
..............3.19
⁄ ⁄ ⁄
P( ⁄ )= ⁄ ⁄ ⁄
[ ⁄ ⁄ ⁄ ]
147
Information Theory and Coding
H (B/A) = ∑ ∑ ( )
⁄
We know that
P (ai, bj) =P(ai) P( ⁄ )
H (B/A) = ∑ ∑ ⁄
⁄
H (B/A) = ∑ ∑ ⁄
⁄
Let us assume
h=∑ ⁄
⁄
We know that sum of rows is equal to 1 ( ∑ = 1). So the above equation will
become as
I (A, B) = H (B) - h
148
Information Channels
C= – h bits/sec
.................3.22
Example 3.2: Find the Channel Capacity for the matrix given below.
P( ⁄ *=[ ]
Solution: The matrix given is belongs to a symmetric or uniform channel so, the H
(B/A) can be calculated by
H (B/A) = [h] =∑
149
Information Theory and Coding
C= bits/sec
Example 3.3: Calculate the capacity of the channel shown in Fig 3.3.
Solution: From the channel diagram we can write the channel matrix as below
⁄ ⁄
P( ⁄ )= ⁄ ⁄
[ ⁄ ⁄ ]
Now, to find H ( ⁄ ) we have,
H ( ⁄ ) =h=∑
= ( *+ ( ⁄
* +0
⁄
=0.31+0.5
H ( ⁄ ) = h= 0.81 bits/symbol
150
Information Channels
C= 0.19 bits/symbol
Example 3.4: Find the Channel Capacity for the matrix given below.
P( ⁄ *=[ ]
Solution: The considered matrix is of symmetric or uniform channel so, the H (B/A)
can be calculated by
H (B/A) = [h] =∑
=0.52+0.5 +0.33
C= 352 bits/symbol
151
Information Theory and Coding
Solution: Consider that the input probabilities P(X1) = P(X2) =P(X3)= . By using
equation (3.7) of JPM calculate the columns of the matrix
P (Y1) = P ( ⁄ ) P(X1)
Then the P(X, Y) becomes
⁄ ⁄ ⁄
P = ⁄ ⁄ ⁄
[ ⁄ ⁄ ⁄ ]
From the above matrix of P(X, Y) it is observed that, the probabilities of all columns
are equal according to JPM.
H(X) = ∑
H(X) = + +
= + +
⁄ ⁄ ⁄
=0.52+0.52+0.52
152
Information Channels
H(Y) = ∑ ( ) ( )
H(Y) = + +
= + +
⁄ ⁄ ⁄
=0.52+0.52+0.52
H(X, Y) = ∑ ∑ ( )
( )
=0.78+2.32
I(X, Y) =0.02
C=0.02 bits/symbol
153
Information Theory and Coding
C=20 bits/second
( ⁄ ) ( ⁄ )
P( ⁄ ) = [ ]
( ⁄ ) ( ⁄ )
̅
P( ⁄ ) = * +
̅
....................3.23
154
Information Channels
Equation (3.23) shows the matrix of BSC channel which is symmetric in nature and
the channel will become the symmetric channel. The Equivocation of the
Symmetric/Uniform channel can be given by
H( ⁄ )=h= ∑
H( ⁄ )=h= ̅ ̅
+P
...................3.24
The Entropy of the symbols at the reception can be written as
H(Y) = ∑ ( )
( )
H(Y) = +
....................3.25
The total probability theorem can be used to find the probability of the output
symbols and at the receiver as below:
=P( ⁄ ) + P( ⁄ )
From the Fig 3.4 of BSC symmetric channel diagram we can observe that
P( ⁄ )= ̅ and =W
Similarly
P( ⁄ )=P and =̅
P (Y1) = ̅ W+P ̅
To find the P(Y2),
=P( ⁄ ) + P( ⁄ )
155
Information Theory and Coding
From the Fig 3.4 of BSC symmetric channel diagram we can observe that
P( ⁄ )=P and =W
Similarly
P( ⁄ )= ̅ and =̅
P (Y2) = W+ ̅ ̅
Now, by Substituting the values of P(Y1) and P(Y2) in equation (3.25) we get,
Now, by substitute the equation (3.24) and equation (3.26) in the above equation we
get,
I(X, Y) = ̅ W+P ̅ ̅̅̅ +
̅̅̅̅
W+ ̅ ̅ - [̅ +P
̅̅
]
̅
BSC is also a Symmetric/ Uniform channel, since the channel capacity is defined as
C= – h bits/ sec
C= –h
=1- h
C= 1- [ ̅ ̅ +P ] bits/sec
.................3.27
Efficiency of the channel is given by
=
156
Information Channels
Example 3.5: The noise matrix of a binary symmetric channel is given below, with the
transmitted symbols having probabilities of and respectively.
⁄ ⁄
P( ⁄ )=[ ]
⁄ ⁄
Solution: From the equation (3.23) the channel matrix for BSC is given by
̅ ⁄ ⁄
P( ⁄ ) = * + =[ ]
̅ ⁄ ⁄
H(X) = ∑
= ⁄ ⁄
+ ⁄ ⁄
H(X) = 1 bits/symbol
There are two output symbols P(Y1) and P(Y2) are given by
=P( ⁄ ) + P( ⁄ )
= ( ⁄ )( ⁄ ) +( ⁄ )( ⁄ )
= ⁄
157
Information Theory and Coding
Similarly,
=P( ⁄ ) + P( ⁄ )
=( ⁄ )( ⁄ )+( ⁄ )( ⁄ )
= ⁄
H(Y) = ∑ ( )
( )
= ⁄ ⁄
+ ⁄ ⁄
H(Y) = 1 bits/symbol
From equation (3.24) the Equivocation of the Symmetric/ Uniform channel can be
given by
H( ⁄ )=h= ∑
H( ⁄ )=h= ̅ ̅
+P
= ⁄ ⁄
+ ⁄ ⁄
=0.46+0.25
H( ⁄ )=0.71 bits/symbol
H(X, Y) = H(X) + H( ⁄ )
= 1+0.71
158
Information Channels
H( ⁄ ) = H(X, Y) - H(Y)
=1.71 – 1
H( ⁄ ) =0.71 bits/symbol
C= –h
C= –H( ⁄ )
=1 - 0.71
C=0.29 bits/symbol
Example 3.6: Two independent Symbols “A” and “B” are produced by a message
source with the respective probabilities 0.7 and 0.3. Determine the source efficiency
and redundancy. If the symbols are received in an average with 8 in 100 symbols in
error, also find the transmission rate of the system.
159
Information Theory and Coding
Solution: Two symbols A and B with probabilities of 0.7 and 0.3 at the transmitter „X‟.
The entropy of the input symbols is
H(X) = ∑
H(X) = +
= +
=0.36+0.52
We know that
H(S) max = =
H(S)max =1 bits/symbol
=88%
=12%
P= =0.08
160
Information Channels
It is noted that W=P (A)=0.7 and ̅ =P(B)=0.3. From the Fig 3.5 the channel matrix
can be written as
̅
P( ⁄ ) = * + =* +
̅
There are two output symbols P(Y1) and P(Y2) are given by
=P( ⁄ ) + P( ⁄ )
= +
=0.668
Similarly,
=P( ⁄ ) + P( ⁄ )
= +
=0.332
Hence, the entropy of output symbols is calculated as
H(Y) = ∑ ( ) ( )
= +
=0.38+0.52
161
Information Theory and Coding
From equation (3.24) the Equivocation of the Symmetric/ Uniform channel can be
given by
H( ⁄ )=h= ∑
H( ⁄ )=h= ̅ ̅
+P
= +
=0.11+0.29
H( ⁄ )=0.4 bits/symbol
I(X, Y) = H(Y) - H ( ⁄ )
=0.90 - 0.4
Rt =50 bits/second
162
Information Channels
request (ARQ) protocol .This process of requesting for the retransmission of the
symbol will continues till the correct symbol receives at the reception. Hence, it results
in 100% recovery of the symbols with the absence of redundancy or erroneous
symbol. This kind of a channel which produces an output without an error is called as
“Binary Erasure Channel”. The Fig 3.6 shows the diagram of BEC.
Channel matrix of the BEC is constructed from the channel diagram and is also like a
Symmetric Channel Matrix.
̅
P( ⁄ )=[ ]
̅
Let us consider P(X1) = W and P(X2) = ̅ . The Entropy of the Transmitter is given by
H(X) =∑
= +
H(X) = W +̅ ̅
.................3.28
163
Information Theory and Coding
H(Y) = ∑ ( )
( )
From the diagram of BEC the Value of P (Y1) and P (Y2) can be written as
P(Y) = P W + ̅ = P (W + ̅ ) = P
where W + ̅ = 1
̅ ⁄ ⁄
̅
P( ⁄ )= P( ⁄ ) = [ ]
̅⁄ ̅̅
⁄̅ ̅
P( ⁄ )= * ̅ +
.................3.29
The equivocation, H ( ⁄ ) can be written as
H( ⁄ )=∑ ∑ ( )
⁄
=̅ + ̅
̅̅̅ +̅̅
H( ⁄ )=P[ +̅ ̅̅̅ ]
.................3.30
The Mutual Information of the BEC can be written as,
I(X, Y) = H(X)-H ( ⁄ )
164
Information Channels
= [1-P] [ +̅ ̅̅̅ ]
where 1-P =̅
= Max [̅ H(X)]
=̅ Max [ H(X)]
=̅ H(X)max
C=̅
NOTE: In BEC channel “Y” will get rejected by the receiver. Hence, even though BEC
is a symmetric Channel we cannot write the mutual information as I(X, Y) = H(Y)-H
( ⁄ ).
165
Information Theory and Coding
Property 1: It states that there must be only one element in each column of the matrix
and the other elements should possess zero value.
Property 2: It states that the sum of any row in the matrix must be equal to unity.
Channel matrix of the noiseless channel can be written as
⁄ ⁄
P( ⁄ )=[ ⁄ ⁄ ⁄ ]
By using the logical explanation the input conditional probability matrix P ( ⁄ ) can
be written as
P( ⁄ )=[ ]
Equivocation H ( ⁄ ) is given by
H( ⁄ )=∑ ∑ ( )
⁄
We know from the equation (3.11) that,
P( ⁄ * =
Can also be written as
( )= P( ⁄ *
H( ⁄ )=∑ ∑ ( ⁄ *
⁄
=∑ ∑ [ ( ⁄ * ]
⁄
=1 +1 +1 +1 +1 +1
166
Information Channels
H( ⁄ )=0
I (A, B) = H (A) - H ( ⁄ )
C= 1.585 bits/symbol
In general, if the no. of input symbols is „r‟ then the channel capacity can be given by,
C= bits/symbol
.................3.32
3.5.5 Deterministic Channel
A matrix of a channel which is represented by one and only one non-zero element in
every row is known as the “Deterministic Channel”.
Channel matrix of the Deterministic Channel can be written as
167
Information Theory and Coding
P( ⁄ )=
[ ]
H( ⁄ )=∑ ∑ ( )
⁄
( ) = P( ⁄ *
H( ⁄ )=∑ ∑ ( )
⁄
=∑ ∑ ( ⁄ *
⁄
=1 +1 +1 +1 +1 +1
Therefore, Equivocation of Noiseless channel is
H( ⁄ )=0
=Max [H (B)]
C= H (B)max =
C= 1.585 bits/symbol
In general, if the no. of output symbols are „s‟ then the channel capacity can be given
by,
C= bits/symbol
.................3.33
Consider that the information is getting transfer from node „X‟ to the node „Y‟ through
a channel 1. There will be loss of information at the receiver node, due to the presence
of the noise in the channel 1. The mutual information at the reception of channel 1 can
be written as
I(X, Y) = H(Y)-H ( ⁄ )
.................3.34
If the same information passed to the node „Z‟ through the Channel 2, then there will
be again a more loss information. The mutual information at the reception of channel
2 can be written as
I(X, Z) = H (Z)-H ( ⁄ )
.................3.35
So, from the equation (3.34) and the equation (3.35) we can observe that
169
Information Theory and Coding
To determine the channel capacity of the Cascaded Channel, consider the Fig3.8
shown below
Let us consider,
P( ⁄ )= ̅ 2+ 2
= ̅ - 2P ̅
= 1- 2P ̅
=P( ⁄ )
Let us consider,
P ( ⁄ ) = P̅ +P̅ =2P ̅
=q
=P( ⁄ )
P ( ⁄ ) = P ( ⁄ )= q
170
Information Channels
̅
P( ⁄ )=[
̅]
CXY =CYZ = 1- [ ̅ ̅ +P ]
C= 1- [ ̅ ̅ +P ]
Example 3.7: Two channels which are noisy are cascaded whose channel matrix is
given as
⁄ ⁄
⁄ ⁄ ⁄
P( ⁄ )=[ ] P( ⁄ )= ⁄ ⁄
⁄ ⁄ ⁄
[ ⁄ ⁄ ]
With P(X1) =P(X2) = ⁄ , find the mutual Information I(X, Z).
171
Information Theory and Coding
Solution: From the matrix the channel diagram for the cascaded channel is drawn
below.
P( )=( ) ( ) +( ) ( )
( )=( ) ( ) +( ) ( )
( )=( ) ( ) +( ) ( )
( )=( ) ( ) +( ) ( )
( )=( ) ( ) +( ) ( )
172
Information Channels
( )=( ) ( ) +( ) ( )
=( ) ( )+( ) ( )= +( )=
From the above calculation, the equivalent channel diagram is as shown in Fig (3.11).
With reference to the above Fig (3.11) the channel matrix can be written as
⁄ ⁄ ⁄
P( ⁄ )=[ ]
⁄ ⁄ ⁄
Consider that the input probabilities P(X1) = P(X2) = . By using equation (3.7) of JPM
calculate the columns of the matrix
P (Zk) = P ( ⁄ ) P (Xi)
⁄ ⁄ ⁄
P(Z, X) =[ ]
⁄ ⁄ ⁄
H( ⁄ )=∑ ∑
⁄
173
Information Theory and Coding
={ ⁄ + ⁄ + ⁄
( ⁄ ) ( ⁄ ) ( ⁄ )
+ ⁄ + ⁄ + ⁄ }
( ⁄ ) ( ⁄ ) ( ⁄ )
=(0.21+0.44+0.26+0.02+0.38+0.19)
H ( ⁄ ) = 1.5 bits/symbol
H (Z) = ∑
= + =
= + =
= + =
H (Z) ={ + + }
( ⁄ ) ( ⁄ ) ( ⁄ )
=(1.56+0.43+0.71)
H (Z)=2.7 bits/symbol
I(X, Z) = H(Z)- H ( ⁄ )
=(2.7 -1.5)
174
Information Channels
P( ⁄ )=[ ]
Dr. Muroga‟s method helps us to find the channel capacity of the binary channel with
the following steps.
[ ][ ]=[ ]
By Expanding we get,
+ =
+ =
C= [ ] bits/symbol
Similarly, for 3x3 matrix the channel capacity can be found by,
C= bits/symbol
175
Information Theory and Coding
C= [ ] bits/symbol
Example 3.8: Calculate the capacity of the channel using Muroga‟s method for the
Fig 3.13 shown below, and P(X1)=0.5, P(X2)=0.3, and P(X3)=0.2 .
⁄ ⁄
P( ⁄ )= ⁄ ⁄
[ ⁄ ⁄ ]
⁄ ⁄
P(X, Y) = ⁄ ⁄
[ ⁄ ⁄ ]
176
Information Channels
H( ⁄ )=∑ ∑ ( )
⁄
= ⁄ + ⁄ ⁄
+ ⁄ ⁄ ⁄
+ ⁄ ⁄
⁄ ⁄
⁄ ⁄
}
=(0.15+0.25+0.09+0.15+0.1+0.1)
H ( ⁄ ) =0.84 bits/symbol
= ⁄ (0.5) + ⁄ (0.3)+ 0 = ⁄
H (Y) = ∑ ( )
= + +
=(0.51+0.53+0.48)
177
Information Theory and Coding
I(X, Y)=H(Y)-H( ⁄ )
=1.52-0.84
⁄ ⁄
⁄ ⁄ [ ]=[ ]
( ⁄ ) ( ⁄ ) ( ⁄ ) ( ⁄ )
[ ⁄ ⁄ ]
⁄ ⁄ =-0.311-0.5=-0.811
⁄ ⁄ =-0.311-0.5=-0.811
⁄ ⁄ =-1
C= C=0.68
bits/symbol
Example 3.9: A binary channel is of non-symmetric as shown in Fig (3.14) below. Find
H(X), H(Y), H(X/Y) and H(Y/X) with P(X1)=1/2 and P(X2)=1/2, α=0.65, β=0.8. Also
find the capacity of channel if the channel becomes symmetric channel α= β=0.75.
178
Information Channels
P(Y/X)=[ ]=* +
P(X, Y)= * +
Input symbol entropy is given by
H (X) = ∑
= )
=0.5+0.5
H(X)=1 bits/symbol
To find the output symbol H(Y), we need to have P(Y1) and P(Y2)
P(Y1)=0.325+0.175=0.5
P(Y2)=0.1+0.4=0.5
H (Y) = ∑ ( )
179
Information Theory and Coding
= +
=(0.5+0.5)
H(Y)=1 bits/symbol
H( ⁄ )=∑ ∑ ( )
⁄
=( + + + )
=0.20+0.26+0.23+0.12
H ( ⁄ ) =0.81
We know that
H(Y)+H(X/Y)=H(X)+H(Y/X)
H(X/Y)= H(X)+H(Y/X)-H(Y)
=(1+0.81-1)
H(X/Y)=0.81 bits/symbol
C= 1- * ̅ ̅
+
=1-* +
=1-* +
C=1-0.40+0.53=1-0.93
C=0.07 bits/symbol
180
Information Channels
181
Information Theory and Coding
THINGS TO BE
REMEMBER
( ⁄ *
P( ⁄ *= 8. Equivocation H( ⁄ ) is given by
182
Information Channels
DESCRIPTIVE
QUESTIONS
b1 b2 b3
6. Noise matrix of a binary symmetric
a1 0.7 0.1 *
channel, which has the following
a2 0.3 * 0.2
a3 * 0.4 0.6 source symbol probabilities
bj 1.0 * 1.0 P(X1)=0.42, P(X2)=0.58
183
Information Theory and Coding
P( ⁄ )=* +
184
Information Channels
MULTIPLE CHOICE
QUESTIONS
Answers
Q. No 1 2 3 4 5
Options a d a d c
Q. No 6 7 8 9 10
Options a d c a d
References
[1] T.M. Cover and J. A. Thomas, Elements of information theory, John Wiley & Sons,
2012.
[2] A. B. Robert, Information Theory, Dover Special Priced Titles, 2007.
[3] R. M. Roth, Introduction to Coding Theory, Cambridge University Press, 2006.
[4] Shanmugam K San, Digital and Analog Communication System, John Wiley and Sons:
New York; 1989.
186
Information Channels
[5] Muralidhar Kulkarni and K. S. Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
[6] J. S. Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[7] K. Giridhar, Information Theory and Coding, Pooja Publications.
[8] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
[9] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
187
Information Theory and Coding
Work Space
188
Chapter 4
Contents
Learning Objectives
4.1 Introduction...........................................................................................................................187
4.2 Examples of Error Control Coding.....................................................................................187
4.3 Methods of controlling errors..............................................................................................188
4.4 Types of errors................................................................................................................ .......189
4.5 Types of Codes.......................................................................................................................189
4.6 Linear Block Codes......................................................................................................... .......189
4.7 Matrix Description of linear block codes...........................................................................190
4.8 Encoding circuit for (n, k) linear block codes....................................................................192
4.9 Syndrome Calculation Circuit.............................................................................................193
4.10 Distance Properties of linear block codes..........................................................................206
4.11 Single error correcting Hamming Codes...........................................................................213
4.12 Table look-up decoding using the standard array...........................................................218
Things to be remember
Descriptive Questions
Multiple Choice questions
References
189
We know the past but cannot
control it. We control the future
but cannot know it.
Claude. E. Shannon
-Claude. E.
190
4 ERROR CONTROL CODING
Learning Objectives
4.1 Introduction
In previous chapters, many various kinds of coding approaches are used to obtain
lower value of average length that in turn achieves higher efficiency. These coding
techniques suffer from two issues such as variable length and fixed length. So to
overcome the limitations the process of detecting and correction codes “Error Control
Coding” is introduced which provides systematic addition of redundant symbols
with affecting the designed system. In this chapter, the meaning of error control
coding and various methods to detect and correct the errors that help to provide
higher efficiency are discussed.
191
Introduction to Information Theory and Coding
Now let us consider the source which generates a message block {bk} at a rate of ‘rb’
bits/sec. The message block is fed to the channel encoder which adds (n-k) number of
redundant bits to these „k’ bit messages generated from the source to form ‘n’ bit code
words.
These additional (n-k) bits are called check bits. Where these check bits carries no
information but helps to detect and correct errors at the channel decoder. The
message block { k} received at the receiver is differs from the transmitted block.
Hence the probability of error is denoted by Pe=P( k bk). The value of ‘Pe’ must be
less than prescribed value.
A code is said to be a (n-k) linear block code if it satisfies two important characteristics
such as
193
Introduction to Information Theory and Coding
(i) If C1 and C2 be any of the codewords which belongs to the set of (n, k) block
code, then C1+C2 is also a ‘n’ bit codeword that belongs to the same set of (n, k)
block code.
(ii) A (n-k) linear block code is systematic, if the „k’ message bits appear either at
the beginning or end of the codeword.
Ci = di
………………….4.3
Where i=1, 2, 3, ….., k. The remaining (n-k) bits are check bits. Hence equation (4.2) and
equation (4.3) can be combined as
Where P11, P21, P12, P22 … are either 0‟s or 1‟s and performed addition using modulo-2
arithmetic. The process of modulo-2 arithmetic is given in Table 4.1.
Now it is required to combine equations (4.3), (4.4) and (4.5) and express the results in
a matrix form as
[ ]
………………….4.6
Equation (4.6) can be rewritten as
………………….4.7
Where [G] is known as “Generation matrix” of order (kxn) and is given by
[G] = [P Ik]
195
Introduction to Information Theory and Coding
The parity check matrix with order (n-k)xn is defined in equation (4.8)
Ck=dk
Ck+1= P11d1+ P21d2+………..+ Pk1dk
[ ]
………………….4.12
Syndrome bits are obtained by multiplying received vector with the matrix using
modulo-2 arithmetic.
S1= r1P11+r2P21+……+rkPk1+rk+1
S2= r1P12+r2P22+……+rkPk2+rk+2
Sn-k= r1P1,n-k+r2P2,n-k+……+rkPk,n-k+rn
………………….4.13
In order to implement the equation (4.13) in a circuit requires a Syndrome calculation
circuit for linear block code. The realization of Syndrome calculation circuit consisting
of a k-bit shift register and modulo-2 adder is shown in Fig 4.4.
197
Introduction to Information Theory and Coding
The error pattern „E‟ is obtained as the difference between R and C is given in
equation (4.14). i.e., E=R-C or E=R+C. Therefore
C=R+E
………………….4.14
Example 4.1: For a (6, 3) linear block code, the parity matrix „P‟ is given by
P=[ ]
Find the possible code vectors. Also draw the encoding and decoding circuit for the
transmitted and received vectors respectively.
198
Error Control Coding
Solution: For a (6, 3) linear block code, i.e., n=6 and k=3. Hence it generates 2k=23=8
message vectors. The code vectors are formed using equation (4.7) i.e., [C] = [D] [G].
But from equation (4.8) we have
[G] = [ Ik P]
Where „Ik‟ denotes identity matrix for the different values of „k‟. Since k=3, then the
generation matrix [G] is
[G] = [I3 P]
[G]=[ ]
Now it is possible to generate the code vectors using equation (4.7). Therefore
Table 4.2 provides the detailed information of systematic (6, 3) linear block code for
the 2k message vectors.
Message Vector [D] Code Vector [C] for (6,3) linear block code
C4=d1 +
d1 d2 d3 C1=d1 C2=d2 C3=d3 C5=d1 + d2 C6=d2 + d3
d3
0 0 0 0 0 0 0 0 0
0 0 1 0 0 1 1 0 1
0 1 0 0 1 0 0 1 1
0 1 1 0 1 1 1 1 0
1 0 0 1 0 0 1 1 0
1 0 1 1 0 1 0 1 1
1 1 0 1 1 0 1 0 1
1 1 1 1 1 1 0 0 0
199
Introduction to Information Theory and Coding
Now for the possible code vector [C], the code vector bits are [C1=d1, C2=d2, C3=d3, C4=d1
+ d3, C5=d1 + d2, C6=d2 + d3]. It is required to draw the encoding circuit for (6, 3) linear
block code. Since k=3, it is necessary to consider three shift register to shift the
message bits. Also requires (n-k)=(6-3)=3 modulo-2 adders to construct the circuit and
is shown in Fig 4.5.
For constructing the syndrome calculation circuit for the (6, 3) linear block code, it is
necessary to consider equation (4.11)
[S]= [R] [H]T
We know the definition
[H]=[In-k PT]
………………….4.15
From the above equation (4.15), the transpose of parity check matrix [H] can be
obtained in equation (4.16). Therefore
[H]T [ ]= [ ]
………………….4.16
Where „I3‟ denotes identity matrix. Therefore
[H]T=
[ ]
200
Error Control Coding
As we know that from the above transpose of parity check matrix [H]T, the received
vector is R=[r1, r2, r3, r4, r5, r6]. Therefore
[S]= [R] {H]T
[s1, s2, s3]= [r1, r2, r3, r4, r5, r6] [H]T
[ ]
Therefore
[s1, s2, s3]= [r1+r3+r4, r1+r2+r5, r2+r3+r6]
Syndrome Bits
s1 r1+r3+r4
s2 r1+r2+r5
s3 r2+r3+r6
Fig. 4.6: Syndrome calculation circuit for (6, 3) linear block code
201
Introduction to Information Theory and Coding
Example 4.2: For a (7, 4) linear block code, the parity matrix „P‟ is given by
P=[ ]
Find the possible valid code vectors. Also draw the encoding and decoding circuit for
the transmitted and received vectors respectively. A single error has occurred in each
of the received vectors. And also detect and correct the errors (i) Rp=[0110010] (ii)
Rq=[1111101].
Solution: For a (7, 4) linear block code, i.e., n=7 and k=4. Hence it generates 2k
message vectors. The code vectors are formed using equation (4.7) i.e., [C] = [D] [G].
But from equation (4.8) we have
[G] = [ Ik P]
where „Ik‟ denotes identity matrix for the different values of „k‟. Since k=4, then the
generation matrix [G] is
[G] = [ I4 P]
[G]=[ ]
Now it is possible to generate the code vectors using equation (4.7). Therefore
Table 4.4 provides the detailed information of systematic (7, 4) linear block code for
the 2k=24=16 message vectors
202
Error Control Coding
Now for the possible code vector [C], the code vector bits are [C1=d1, C2=d2, C3=d3, C4=d4,
C5=d1+d3+d4, C6=d1+d2+d4, C7=d2+d3+ d4]. It is required to draw the encoding circuit for (7,
4) linear block code. Since k=4, it is necessary to consider three shift register to move
the message bits. Also requires (n-k)=(7-4)=3 modulo-2 adders to construct the circuit
and is shown in Fig 4.7.
For constructing the syndrome calculation circuit for the (7, 4) linear block code, it is
necessary to consider equation (4.11)
[S]= [R] [H]T
We know the definition
[H]=[In-k PT]
From the above, the transpose of parity check matrix [H] can be obtained in equation
(4.17). Therefore
[H]T [ ]= [ ]
………………….4.17
Where „I3‟ denotes identity matrix. Therefore
[H]T=
[ ]
As we know that from the above [H]T matrix, the received vector is R=[r1, r2, r3, r4, r5,
r6, r7]. Therefore
[S]= [R] {H]T
[s1, s2, s3]= [r1, r2, r3, r4, r5, r6, r7] [H]T
[s1, s2, s3]= [r1, r2, r3, r4, r5, r6, r7]
[ ]
Therefore
[s1, s2, s3]= [r1+r3+r4+r5, r1+r2+r4+r6, r2+r3+r4+r7]
204
Error Control Coding
Fig. 4.8: Syndrome calculation circuit for (7, 4) linear block code
Sp= [0110010]
[ ]
Therefore
Sp= [011]
205
Introduction to Information Theory and Coding
Since the syndrome Sp= [011] is located in second row of transpose of parity check
matrix [H]T. The corresponding error vector is
Ep = [0100000]
Cp= [0010010]
Sp= [1111100]
[ ]
Therefore
Sp= [010]
Since the syndrome Sp= [010] is located in sixth row of transpose of parity check
matrix [H]T. The corresponding error vector is
Eq = [0000010]
206
Error Control Coding
Cq= [1111110]
Example 4.3: If „C‟ is a valid code vector then prove that CHT=0 where HT is the
transpose of the parity check matrix „H‟.
Solution: Consider the ith row of the [G] is defined in equation (4.18)
[ ]
Therefore Gi HjT= Pij + Pij= Pij(0+0)
207
Introduction to Information Theory and Coding
[C] [H]T=0
Example 4.4: For the given generation matrix of (5, 1) code [G] = [1 1 1 1 1]. Find the
Parity check matrix [H] and evaluate the syndrome for the received vector.
Solution: For (5, 1) code, there are only one message bit and the remaining three bits
are check bits. We know that,
[G] = [P Ik] = [P I1]
[G] = [1 1 1 1 1]
Therefore
[P] = [1 0 0 1]
Therefore
[H] = [ ]
Since k=1, there are only two valid code vectors and the message vectors [D] can
either be [0] or [1]. Therefore
Suppose if the transmitted vector be [0 0 0 0 0]. Then there are five possible single
error patterns are generated such as [1 0 0 0 0], [0 1 0 0 0], [0 0 1 0 0], [0 0 0 1 0] and [0 0
0 0 1]. The syndrome for the single error pattern is generated using equation (4.11).
S1=[1 0 0 0 0]
[ ]
S1=[1 0 0 0 ]
S2=[0 1 0 0 0]
[ ]
S2=[0 1 0 0 ]
S3=[0 0 1 0 0]
[ ]
S3=[0 0 1 0 ]
209
Introduction to Information Theory and Coding
S4=[0 0 1 0 0]
[ ]
S4=[0 0 0 1 ]
S5=[0 0 0 0 1]
[ ]
S5=[1 1 1 1 ]
210
Error Control Coding
It is noticed that, the values from 1st to 4th position is same in C1 and C2. But it differs
in 5th position of the code vector. Hence the Hamming distance between C1 and C2 is
said to be 1.
………………….4.21
4.10.4 Minimum Distance [dmin]
It is the shortest hamming distance between any two code vectors in a code.
211
Introduction to Information Theory and Coding
Example 4.5: For a (6, 3) linear block code, the parity matrix „P‟ is given by
P=[ ]
Find the possible code vectors, Hamming Weights and parity check matrix. Also draw
the encoding circuit for the above codes.
Solution: For a (6, 3) linear block code, i.e., n=6 and k=3. Hence it generates 2k=23=8
message vectors. The code vectors are formed using equation (4.7).
where „Ik‟ denotes identity matrix for the different values of „k‟. Since k=3, then the
generation matrix [G] is
[G] = [ I3 P]
[G]=[ ]
Now it is possible to generate the code vectors using equation (4.7). Therefore
Table 4.7 provides the detailed information of systematic (6, 3) linear block code for
the 2k message vectors.
212
Error Control Coding
The hamming distance for 000000 and 001101 is 3. For 001101 and 010011 it is
recorded as 4. In case of 010011 and 011110 the hamming distance is 3. The distance
between 011110 and 100110 is 3. In case of 100110 and 101011 its distance is 3. For the
vectors 101011 and 110101 its hamming distance is recorded as 4 and finally the
hamming distance between 110101 and 111000 is 3. To obtain parity check matrix, we
need to have the value of Parity matrix and Identity matrix (In-k=3). The parity check
matrix is given by
[H] = [In-k PT] = [I3 PT]
Therefore
[H] = [ ]
By observing the components of [H], it is noticed that minimum weight for the parity
check matrix [H] is dmin=3. Now for the possible code vector [C], the code vector bits
are [C1=d1, C2=d2, C3=d3, C4=d1 + d3, C5=d1 + d2, C6=d2 + d3]. It is required to draw the
encoding circuit for (6, 3) linear block code. Since k=3, it is necessary to consider three
shift register to shift the message bits. Also requires (n-k)=(6-3)=3 modulo-2 adders to
construct the circuit and is shown in Fig 4.9.
213
Introduction to Information Theory and Coding
Example 4.6: Consider d1, d2, d3 and d4 are the message bits. For a parity check bits of
(7, 4) hamming code generated by
C5=d1+d3+d4
C6=d1+d2+d4
C7=d2+d3+d4
(i) Find the generator matrix [G] and Parity check matrix [H] for the code.
(ii) Show that [G] [H]T=0.
(iii) Also find the Hamming weights, distances and minimum weight of this code.
Solution: (i) For a (7, 4) linear block code, i.e., n=7 and k=4. Hence it generates 2k =16
message vectors. It is given that,
………………….4.22
214
Error Control Coding
By comparing the above equations (4.7) and (4.21), the generator matrix is obtained
and is given by
[G]=[ ]
[G] = [ Ik P]= [ I4 P]
where „Ik‟ denotes identity matrix for the different values of „k=4‟. By knowing the
values of transpose of Parity matrix (P) and Identity matrix (In-k=I3) to generate the
Parity Check Matrix is obtained by
Therefore
[H] =[ ]
(ii) Considering the values of generator matrix [G] and the transpose of parity check
matrix [H] in part (i). It is required to find
[G] [H]T=[ ]
[ ]
215
Introduction to Information Theory and Coding
[G] [H]T=[ ]
Therefore
[G] [H]T=0
(iii) Table 4.8 provides the detailed information of systematic (7, 4) linear block code
for the 2k=24=16 message vectors.
0 0 0 0 0000000 0
0 0 0 1 0001111 4
0 0 1 0 0010101 3
0 0 1 1 0011010 3
0 1 0 0 0100011 3
0 1 0 1 0101100 3
0 1 1 0 0110110 4
0 1 1 1 0111001 4
1 0 0 0 1000110 3
1 0 0 1 1001001 3
1 0 1 0 1010011 4
1 0 1 1 1011100 4
1 1 0 0 1100101 4
1 1 0 1 1101010 4
1 1 1 0 1110000 3
1 1 1 1 1111111 7
The hamming distance for 0000000 and 0001111 is 4. For the 0001111 and 0010101 it
results 3. Similarly we need to generate for all the pair of code vectors. It is noticed
216
Error Control Coding
Parameters Definitions
Example 4.7: For a linear block code the minimum distance is three and a message
block size of eight bits. Find the generator matrix [G] and Parity check matrix [H].
Solution: From the Table 4.9, the code length „n‟ is given by
n 2n-k -1
Therefore
n 2n-8 -1
Apply trial and error method such that least integer value of „n‟ must satisfy
inequality. Suppose for n=11, then
11 211-8 -1=10
The value of 10 is less than compared with 11. Hence it is not possible to choose 11.
217
Introduction to Information Theory and Coding
The value of 15 is greater than compared with 12. Hence it is possible to choose 12.
Therefore such an arrangement is composed of (12, 8) code. The transpose of parity
check matrix [H] is given by
( )
[H]T=[ ]=[ ]=
[ ]
[H] = [ ]
[G]=
[ ]
218
Error Control Coding
Example 4.8: For a linear block code the minimum distance is three and a message
block size of three bits. Design the (n, k) hamming code. Also correct the error for
received vector R=[110111].
Solution: From the Table 4.9, the code length „n‟ is given by
n 2n-k -1
Therefore
n 2n-3 -1
Apply trial and error method such that least integer value of „n‟ must satisfy
inequality. Suppose for n=5, then
5 25-3 -1=3
The value of 3 is less than compared with 5. Hence it is not possible to choose 5.
Suppose for n=6, then
6 26-3 -1=7
The value of 7 is greater than compared with 6. Hence it is possible to choose 6.
Therefore such an arrangement is composed of (6, 3) code. The transpose of parity
check matrix [H] is given by
( )
[H]T=[ ]=[ ]=
[ ]
………………….4.23
Several conditions to be followed to form the parity matrix with the matrix order of
three rows and three columns. Some of the requirements are listed below
(i) The transpose of parity check matrix [H]T should not contain a row of zeros.
(ii) No two rows of [H]T must be same.
[P]=[ ]
………………….4.24
Substitution of equation (4.24) in equation (4.23) to obtain transpose of parity check
matrix [H]T
[H]T=
[ ]
[H] = [ ]
By comparing the components of [H], the minimum hamming distance (dmin=3). The
generator matrix [G] is given by
[G]= [ ]
Table 4.10 provides the details of the valid code vector for 2k=23=8 message vectors.
220
Error Control Coding
Since it is recorded that the value of dmin=3 from Table 4.10. Therefore the error
correcting capability of code is
t= = =1
Therefore (6, 3) hamming code formed is considered as single error correcting code.
Let the received vector be given as R=[11011]. Then the syndrome is calculated by
[S]=[R] [H]T
[S]= [1 1 0 1 1 1]
[ ]
[S]= [0 0 1]
Since the syndrome vector lies in the sixth position of the transpose of parity check
matrix [H]T. where the error pattern is represented by E= [0 0 0 0 0 1], since it lies in
the 6th position of [H]T. So the corrected code vector is obtained as
221
Introduction to Information Theory and Coding
[C] = [110111] + [0 0 0 0 0 1]
[C] = [1 1 0 1 1 0]
The code vector [C] = [1 1 0 1 1 0] is a valid code vector for the received vector [1 1 0 1
1 1] that is tabulated in 4.10 for the message vector D = [1 1 0].
Based on the properties of the standard array, the decoding procedure is as follows
(i) The syndrome [S] = [R] [H]T is generated for the received vector.
(ii) The co-set leader Ei is located with [S] = [E] [H]T.
(iii) The corrected code vector [C] is obtained from [C] = [R] + [E]
The general decoding circuit for (n, k) linear code is described in Fig 4.10., by
considering the truth table of n-switching functions.
Where s1, s2,…., sn-k are syndrome digits and e1, e2, …., en are the predicted error digits
of different co-set leaders.
222
Error Control Coding
Example 4.9: Contruct the standard array for (5, 2) single error correcting code with
the generator matrix [G]
[G]=⌈ ⌉
Solution: We know that the standard array is capable to correct only the single error
pattern. It is given that n=5 and k=2. Therefore 2k=22=4 input combinations of binary
bits such as [D]=00, 01, 10 and 11. And 2n=25=32 numbers of codes are generated in
the array. Now multiply the each input of [D] with the generator matrix [G] to
generate codewords using equation (4.7).
For [D] = [0 0], the code vector [C]= [0 0] ⌈ ⌉= [0 0 0 0 0]
Now to construct the standard array, let us note down all the generated code words
along the first row in the given Table 4.11. The least weighted (less number of 1‟s)
223
Introduction to Information Theory and Coding
numbers are considered in the first column of the second row (0 0 0 0 1) and perform
addition with all the contents of the first row. Similarly for the next least weighted
number say (0 0 0 1 0) and perform addition with all the contents of the first row.
Finally the procedure is continued till the least weighted numbers are completed.
Table 4.11: Standard array for (5, 2) single error correcting code
Example 4.10: Contruct the standard array for (4, 2) of single error correcting code.
Find the status of error detecting and error correcting capabilities of code and form a
syndrome table for correctable error patterns. Also draw the encoding and decoding
circuit.
224
Error Control Coding
Solution: For (4, 2) linear block code, we have n=4 and k=2. Therefore, it is required
to obtain the parity matrix [P] with the order 2x2 for generating codes and to
construct standard array.
[P]=[ ]
………………….4.25
Since k=2, 2k=22=4 input combinations of binary bits such as [D]=00, 01, 10 and 11. For
parity matrix, the binary values such as 01 and 10 cannot be considered as elements
since both the values are representing identity matrix. Similarly message 00 is
representing syndrome with no-error, so cannot be used as an element in [P]. Hence it
is noticed that either 01 or 10 are consider as an element along with the remaining
pair 11 to construct the parity matrix. Therefore the parity matrix [P] with the order of
2x2 is given in equation 4.26.
[P]=[ ]
………………….4.26
The generator matrix [G] is obtained by
225
Introduction to Information Theory and Coding
We know that the standard array is capable to correct only the single error pattern. It
is given that n=4 and k=2. Therefore 2k=22=4 input combinations of binary bits such as
[D]=00, 01, 10 and 11. And 2n=24=16 numbers of codes are generated in the array.
Now multiply the each input of [D] with the generator matrix [G] to generate
codewords using equation (4.7).
Now to construct the standard array, let us note down all the generated code words
along the first row in the given Table 4.12. The least weighted (less number of 1‟s)
numbers are considered in the first column of the second row (0 0 01) and perform
addition with all the contents of the first row. Similarly for the next least weighted
number say (0 0 1 0) and perform addition with all the contents of the first row.
Finally the procedure is continued till the least weighted numbers are completed.
Table 4.12: Standard array for (4, 2) single error correcting code
226
Error Control Coding
Finally 2n=24=16 number of codes are appeared in the standard array table. Further it
can be concluded that first 16 codes which has least weighted number (number of
one‟s is 1) contains only one error and it can be corrected. For the message vector
D=[00, 01, 10, 11], the code vectors along with the hamming weight [H w] is tabulated
in Table 4.13.
Table 4.13: Code vector for (4, 2) linear block code
Message Vectors Code Vectors Hamming Weight
[D] [C] [Hw]
00 0000 0
01 0110 2
10 1011 3
11 1101 3
From the Table 4.13, dmin=min [Hw]=2. Error detecting capability dmin-1=2-1=1.
Therefore error correcting capability
t= = =
Therefore a (4, 2) linear block code is incapable of correcting any error. The syndrome
for correctable error pattern is given in Table 4.14.
[C]=[d1, d2]=[ ]
Therefore
[C]=[d1, d2, (d1+d2), d1]
227
Introduction to Information Theory and Coding
Fig. 4.12: Syndrome Calculation Circuit for (4, 2) linear block code.
228
Error Control Coding
THINGS TO BE
REMEMBER
C2=1 0 1 0 0
[C]=[D][G]
[G]=[Ik:P] or [G]=[P:Ik] ∑
n 2n-k -1
6. The syndrome is calculated using
229
Introduction to Information Theory and Coding
DESCRIPTIVE
QUESTIONS
4. Define the following terms with
1. Explain briefly the communication their notations
system employing error control (a) Hamming Weight
coding with necessary block (b) Hamming Distance
diagram. (c) Minimum Distance
(d) Hamming Bound
2. If „C‟ is a valid code vector, then
Prove that [C][H]T=0 where [H]T is 5. Design (n, k) hamming code with a
the transpose of parity check minimum distance of dmin=3 and a
matrix [H]. message length of 4 bits.
230
Error Control Coding
[P]=[ ]
231
Introduction to Information Theory and Coding
MULTIPLE CHOICE
QUESTIONS
232
Error Control Coding
9. One of the major characteristics of 10. Which among the following are the
linear block codes conventional essential conditions for a good error
codes is control coding techniques?
a. Both of them have memory a. Faster coding & decoding
b. none of them have memory methods
c. Only linear block codes have b. Better error correcting capability
memory c. Maximum transfer of information
d. Only conventional codes have in bits/sec
memory. d. All of the above
Answers
Q. No 1 2 3 4 5
Options a b a c b
Q. No 6 7 8 9 10
Options d b b d d
References
[1] S. Lin and D. J. Costello, Error Control Coding, 2nd Edition, Prentice Hall, 2004.
[2] R. E. Blahut, Algebraic Codes for Data Transmission, Cambridge University Press,
2002.
[3] T. K. Moon, Error Correction Coding: Mathematical Methods and Algorithms, Wiley,
2005.
[4] R. H. Morelos-Zaragoza, The Art of Error Correcting Coding, Wiley and sons, 2006.
[5] Shanmugam K San, Digital and Analog Communication System, John Wiley and Sons:
New York; 1989.
[6] Muralidhar Kulkarni and K. S. Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
[7] J. S. Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[8] K. Giridhar, Information Theory and Coding, Pooja Publications.
[9] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
[10] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
233
Introduction to Information Theory and Coding
Work Space
234
Chapter 5
Contents
Learning Objectives
5.1 Introduction...........................................................................................................................231
5.2 Algebraic structure of cyclic codes.....................................................................................231
5.3 Properties of cyclic codes.....................................................................................................234
5.4 Encoding using (n-k) bit shift registers..............................................................................240
5.5 Syndrome calculation...........................................................................................................248
5.6 Error detection and correction.............................................................................................249
Things to be remember
Descriptive Questions
Multiple Choice questions
References
235
Information: the negative
reciprocal value of
probability.
Claude. E. Shannon
236
5 BINARY CYCLIC CODES
Learning Objectives
5.1 Introduction
Binary Cyclic Codes (BCC) forms a subclass of linear block codes which was
discussed in previous chapter 4. The BCC has several advantages linear block codes
such as implementation of encoding and syndrome calculation circuits is easy with
simple shift register, basic gates with feedback registers. Also, cyclic codes provides
better algebraic structures which leads to detect and correct the errors in an efficient
manner. This chapter deals with the development of an efficient polynomial
representation for cyclic codes and makes use of codes for encoding and decoding
purpose.
237
Introduction to Information Theory and Coding
………………….5.2
If ‘V’ belongs to cyclic code then
V(1)=(Vn-1, V0, V1, V2 ….Vn-2)
V(i)x=(Vn-i+Vn-i+1x+Vn-i+2x2+….Vn-i-1xn-1)
………………….5.4
Where V0, V1, V2…Vn-1 belongs to binary and performs modulo 2 arithmetic such as
addition and multiplication. Table 5.1 provides the operation of modulo 2 addition
and multiplication procedure.
Table 5.1: Modulo-2 Addition and Multiplication
Modulo-2 Addition Modulo-2 Multiplication
0+0 0 0.0 0
0+1 1 0.1 0
1+0 1 1.0 0
1+1 0 1.1 1
238
Binary Cyclic Codes
f1(x) f2(x)=(1+x)(1+x+x2)
=1+x+ x2+x+ x2+x3
=1+ x3+ x2+ x2+x+x
=1+ x3+ x2(1+1)+x(1+1)
=1+ x3+0+0
Therefore
f1(x).f2(x)=1+ x3
Example 5.2: Show that the function (x4+x3+1)2= x8+x6+1 using modulo-2 algebra
(x4+x3+1)2= x8+x6+1
Solution: For the operation of division, ‘Q(x)’ and ‘R(x)’ denotes quotient and
remainder polynomial respectively.
x2+x+1) x8+x5+x ( x6+x5……….Q(x)
x8+x7+x6
x7+x6+x5+x
239
Introduction to Information Theory and Coding
x7+x6+x5
x…………R(x)
First Property:
The generator polynomial g(x) generated for the (n, k) cyclic code with a degree of (n-
k) is unique.
g(x)=g0 + g1x + g2x2+…..+gn-k xn-k
………………….5.5
Second Property:
The generator polynomial g(x)=g0 + g1x + g2x2+…..+gn-k xn-k generated for the (n, k)
cyclic code is a factor of xn+1.
xn+1=g(x) h(x)
………………….5.6
Where ‘h(x)’ is called Parity check polynomial.
Third Property:
A (n, k) cyclic code is generated, if g(x) is a polynomial of degree (n-k) and is a factor
of xn+1.
Fourth Property:
The code vector polynomial V(x) can be generated by
Fifth Property:
240
Binary Cyclic Codes
A systematic cyclic code is generated and obtains a remainder polynomial from the
division of Xn-k D(x) by g(x).
Example 5.4: Perform non-systematic cyclic code operation to generate a code for the
(6, 3) single error correcting code with D(x)=d0+d1x+d2x2 and g(x)=1+x2.
Now let us consider the message vector D=[d0, d1, d2] is [0 0 1]. Then its polynomial is
D(x)= d0+d1x+d2x2
D(x)= (0)+(0)x+(1)x2
D(x)= x2
Substituting D(x) in equation (5.7)
V(x) = (x2) (1+x2)
V(x)= x2+ x4
[V]=[0 0 1 0 1 0]
Now let us consider the message vector D=[d0, d1, d2] is [0 1 0]. Then its polynomial is
D(x)= d0+d1x+d2x2
241
Introduction to Information Theory and Coding
D(x)= (0)+(1)x+(0)x2
D(x)= x
Substituting D(x) in equation (5.7)
V(x) = (x) (1+x2)
V(x)= x+ x3
[V]=[0 1 0 1 0 0]
Now let us consider the message vector D=[d0, d1, d2] is [0 1 1]. Then its polynomial is
D(x)= d0+d1x+d2x2
D(x)= (0)+(1)x+(1)x2
D(x)= x+ x2
Substituting D(x) in equation (5.7)
V(x) = (x+ x2) (1+x2)
[V]=[0 1 1 1 1 0]
Now let us consider the message vector D=[d0, d1, d2] is [1 0 0]. Then its polynomial is
D(x)= d0+d1x+d2x2
D(x)= (1)+(0)x+(0)x2
D(x)= 1
Substituting D(x) in equation (5.7)
242
Binary Cyclic Codes
V(x) = 1 (1+x2)
V(x)= 1+ x2
V(x)= 1+ x2
The code vector for the message input [1 0 0] is
[V]=[1 0 1 0 0 0]
Now let us consider the message vector D=[d0, d1, d2] is [1 0 1]. Then its polynomial is
D(x)= d0+d1x+d2x2
D(x)= (1)+(0)x+(1)x2
D(x)= 1+x2
Substituting D(x) in equation (5.7)
V(x) = (1+x2) (1+x2)
V(x)= 1+ x4
[V]=[1 0 0 0 1 0]
Now let us consider the message vector D=[d0, d1, d2] is [1 1 0]. Then its polynomial is
D(x)= d0+d1x+d2x2
D(x)= (1)+(1)x+(0)x2
D(x)= 1+x
Substituting D(x) in equation (5.7)
V(x) = (1+x) (1+x2)
V(x)= 1+x2+x+ x3
243
Introduction to Information Theory and Coding
V(x)= 1+x+x2+x3
[V]=[1 1 1 1 0 0]
Now let us consider the message vector D=[d0, d1, d2] is [1 1 1]. Then its polynomial is
D(x)= d0+d1x+d2x2
D(x)= (1)+(1)x+(1)x2
D(x)= 1+x+x2
Substituting D(x) in equation (5.7)
V(x) = (1+x+x2) (1+x2)
V(x)= 1+x+x3+x4
[V]=[1 1 0 1 1 0]
244
Binary Cyclic Codes
Example 5.5: Perform systematic cyclic code operation to generate a code for the
(6, 3) single error correcting code with D(x)=d0+d1x+d2x2 with [D]=[0 1 1] and [1 0 0]
and g(x)= x2+1.
R(x)=
………………….5.8
For the message vector [D]=[0 1 1], the message vector polynomial will be
D(x)=x+x2
Therefore
=( )(x+x2)
=x5+x4
R(x)=
R(x)=1+x=1+(1)x+(0)x2
245
Introduction to Information Theory and Coding
[1 1 0 0 1 1 ]
For the message vector [D]=[1 0 0], the message vector polynomial will be
D(x)=1
Therefore
=( )
=x3
R(x)=
x2+1) x3 (x……….Q(x)
x3+x
x…………R(x)
Therefore the remainder polynomial is
R(x)=x=0+(1)x+(0)x2
[0 1 0 1 0 0]
246
Binary Cyclic Codes
gi…… if gi=0, its open and acts as a closed path for gi=1
And gate.
The encoding circuit using (n-k) shift register operates during two cases, when the
gate is turned ON and turned OFF respectively.
During gate ON, it is noticed that the switch is in position 1 and the message
digits (d0, d1,…..,dk-1) starting from ‘dk-1’ are shifted into the registers towards
247
Introduction to Information Theory and Coding
the channel. After completion of shifting procedure of ‘k’ message digits, now
the register holds the components of parity check bits (R0, R1,….., Rn-k-1).
During gate OFF, it is noticed that the switch is in position 2 and the contents
of shift register are moved to the channel. Hence, the code vector (R0, R1,….,
Rn-k-1, d0, d1,…..,dk-1) is generated and further fed to the communication
channel.
Example 5.6: Design an encoder for the (8, 5) binary cyclic code generated by
g(x)=1+x2+x3 and verify its operation using the message vectors [D]=[1 1 0 0 1].
Solution: To design encoder for BCC, from equation (5.5) we have in general
generator polynomial is given by
The number of flip-flops required is obtained by using Rn-k-1=R8-5-1=R2 (i.e., R0, R1 and
R2). Also the design requires two module- 2 adders.
248
Binary Cyclic Codes
For the message D= [1 1 0 0 1], the contents of shift registers are tabulated in Table 5.4
249
Introduction to Information Theory and Coding
Example 5.7: Design an encoder for the (31, 21) binary cyclic code generated by
g (x)=1+x3+x5 +x6+x8+x9+x10.
Solution: To design encoder for BCC, from equation (5.5) we have in general
generator polynomial is given by
g0=1, g1=0, g2=0, g3=1, g4=0, g5=1, g6=1, g7=0, g8=1, g9=1, g10=1
The number of flip-flops required is obtained by using Rn-k-1=R31-21-1=R9 (i.e., R0, R1, R2,
R3, R4, R5, R6, R7, R8 and R9). Also the design requires six module-2 adders.
Example 5.8: Find the code word in systematic form for the message [D] = [1010101],
250
Binary Cyclic Codes
Solution: To design encoder for BCC, from equation (5.5) we have in general
generator polynomial is given by
The number of flip-flops required is obtained by using Rn-k-1=R15-7-1=R7 (i.e., R0, R1, R2,
R3, R4, R5, R6 and R7). Also the design requires four module-2 adders.
251
Introduction to Information Theory and Coding
1 1 1 0 0 0 1 0 1 1 -
2 0 1 1 0 0 1 1 1 0 -
3 1 1 1 1 0 1 1 0 0 -
4 0 0 1 1 1 0 1 1 0 -
5 1 1 0 1 1 0 0 0 0 -
6 0 0 1 0 1 1 0 0 0 -
7 1 1 0 1 0 0 1 1 1 -
Now Switch ‘S’ moves to
position 2, indicates Gate is
turned OFF
8 X 0 1 0 1 0 0 1 1 1
9 X 0 0 1 0 1 0 0 1 1
10 X 0 0 0 1 0 1 0 0 1
11 X 0 0 0 0 1 0 1 0 0
12 X 0 0 0 0 0 1 0 1 0
13 X 0 0 0 0 0 0 1 0 1
14 X 0 0 0 0 0 0 0 1 0
15 X 0 0 0 0 0 0 0 0 1
From the Table 5.5, the remainder polynomial coefficients are 1 0 1 0 0 1 1. For
systematic code the code vector for the message vector [D] = [1 0 1 0 1 0 1] is given by
[V] = [1 0 1 0 0 1 1 1 0 1 0 1 0 1]
To verify the code vector using direct hand calculation: From the equation (5.8) we
have,
R(x) = =
Hence, the result code vector generated by shift register method and direct calculation
method are same.
[G]= [ ]
………………….5.9
Equation (5.9) is not in standard form[ ], so following operations are need to
be carried out
R3 R3–R1 and R4 R4–R1
253
Introduction to Information Theory and Coding
[G]= [ ]
R4 R4–R2
[G]= [ ]
[G]= [ ]
[H] =[ ]=[ ]
[H] = [ ]
With g0=1, g1=1, g2=0 and g3=1, the encoder circuit is given by
If the syndrome is zero, then the received vector polynomial R(x) is divisible
by g(x) and results that the received vector is a valid code vector.
For the syndrome of non-zero, it is noticed that there are some errors in the
received vector. Hence we have
(x)+
………………….5.10
Where Z(x) is a received polynomial, Q(x) represents quotient polynomial and S(x)
denotes syndrome polynomial of degree (n-k-1). For the error pattern E(x) caused by
the communication channel which is given in equation (5.11).
[ ]
………………….5.11
The syndrome calculation circuit using (n, k) cyclic code as shown in Fig.5.7 operates
for the combinations of when the gate 2 is turned ON and gate 1 is turned OFF. In the
second case, when the gate 2 is turned OFF and gate 1 is turned ON.
First initialize the register and the content of the received vector [Z] are
entered into the shift register with the positions of gate 2 is ON and gate 1 is
OFF.
Once all the received vector is shifted into the register, then it is noticed that
the contents of the register will be syndrome. With the positions of gate 2 is
OFF and gate 1 is ON, the syndrome vector is moved out of the register.
255
Introduction to Information Theory and Coding
gi…… if gi=0, its open and acts as a closed path for gi=1
And gate.
256
Binary Cyclic Codes
Step1: The received vector is shifted into the memory storage device such as buffer register
and Syndrome register.
Step2: After placing the syndrome in the syndrome register, the contents of the syndrome
Register are read into the detector.
Step3: The first received bit is shifted out of the buffer and the syndrome register is shifted
right once. These two operations must be performed at the same time.
Step4: Now the new syndrome is used to check the second received digit. At the right most
stage of the buffer register, is an erroneous digit. If so, it is corrected.
Step5: The decoder operates continuously on the received vector digit by digit until all the
received vector is shifted out of the buffer.
At the end of decoding process in cyclic codes, the errors are corrected with respect to
the error pattern built into the detector. It is observed that after correcting the errors,
the content in the syndrome register results all zeros. Suppose if the content in the
syndrome register does not contain all zeros, then an uncorrectable error pattern has
been detected.
Solution: To design syndrome calculation circuit for BCC, from equation (5.5)
we have in general generator polynomial is given by
g (x)=g0 + g1x + g2x2+…..+gn-k xn-k
For (7, 4) cyclic code we know that
g(x)=1+x2+x3
The number of flip-flops required is obtained by using Sn-k-1=S8-5-1=S2 (i.e., S0, S1 and
S2). Also the design requires two module-2 adders as shown in fig 5.8.
257
Introduction to Information Theory and Coding
For the received vector [Z] = [1 0 1 1 1 0 0], the contents of shift registers are tabulated
in Table 5.7.
Table 5.7: Contents of shift registers for [Z] = [1 0 1 1 1 0 0]
258
Binary Cyclic Codes
From the Table 5.7, it is noticed that 1 0 0 is appeared in the 12th shift, which indicates
error in the 5th bit from the right.
The received vector
So, the error vector for the above is considered as [E] = [0 0 1 0 0 0 0]. Therefore, the
corrected vector can be obtained as
[V] = [1 0 0 1 1 0 0]
259
Introduction to Information Theory and Coding
THINGS TO BE
REMEMBER
generated for the (n, k) cyclic code 8. For the syndrome of non-zero, it is
with a degree of (n-k) is unique. noticed that there are some errors
in the received vector. Hence we
g(x)=g0+g1x+g2x2+…..+gn-k xn-k have
(x)+
4. The generator polynomial
g(x)=g0+g1x+g2x +…..+gn-k
2 xn-k
Where Z(x) is a received
generated for the (n, k) cyclic code
polynomial, Q(x) represents
is a factor of xn+1.
quotient polynomial and S(x)
xn+1=g(x) h(x)
denotes syndrome polynomial of
degree (n-k-1).
5. A (n, k) cyclic code is generated, if
g(x) is a polynomial of degree (n-k)
9. For the Error pattern E(x) caused
and is a factor of xn+1.
by the communication channel
which is given by
[ ]
260
Binary Cyclic Codes
DESCRIPTIVE
QUESTIONS
1. Define Binary Cyclic code. Discuss (ii) Find code polynomial for
the features of Encoder and D(x)= 1+x2+x4 in systematic
Decoder used for Cyclic codes form.
using as (n-k) bit shift register. (iii) If v(x)=1+x4+x6+x8+x14 then
2. Explain briefly with relevant check whether it is valid code
examples polynomial or not.
(i) Hamming code 7. For the generator polynomial g(x)=
(ii) Cyclic codes 1+x+x3, find the generator matrix
3. List the distinct advantages of [G] and parity check matrix [H] of
cyclic codes over linear block (7, 4) cyclic codes.
codes. 8. Design an encoder for the (7, 4)
4. A generator polynomial of (7, 4) binary cyclic code generated by
cyclic code is G (P)=P3+P+1. Find g(x)=1+x+x3 and verify its
all the code vectors for the code in operation using the message
systematic and non-systematic vectors (1 0 0 0) and (1 1 0 0).
form. 9. For a (7, 4) cyclic code, the received
5. Consider (15, 11) cyclic code vector [Z]=[1 1 1 0 1 0 1] and the
generated by g(x)=1+x+x4. generator polynomial is g(x)=
(i) Device a feedback registers 1+x+x3. Draw the syndrome
encoder for this code. calculation circuit and correct the
(ii) Illustrate the encoding single error in the received vector.
procedure with message vector 10. For n 7, identify (n, k) values of
11001101011 by listing the the cyclic codes generated by the
states of the register. following generator polynomials.
6. A (15, 5) cyclic code has a generator (i) g(x)=1+x2+x3
polynomial (ii) g(x)=1+x+x2+x4
g(x)=1+x+x2+x4+x5+x8+x10 (iii) g(x)=1+x2+x3+x4
(i) Draw the block diagram of an
encoder and syndrome
calculator for this code.
261
Introduction to Information Theory and Coding
MULTIPLE CHOICE
QUESTIONS
1. The cyclic codes are designed using 6. For the message 1010001101, the
a. Shift register with feedback CRC using divisor polynomial
b. Shift register without feedback x5+x4+x2+1 is
c. Flip-flops a. 01110
d. None of the above b. 01111
2. The received code contains error, if c. 11110
the syndrome vector is d. 01010
a. Zero 7. For the generation of cyclic codes,
b. non-zero the generator polynomial should be
c. Infinity the factor of
d. none of the above a. xn+1
3. In the dividing circuit, the parity b. xn-1
polynomial is obtained by the c. xn-k+1
a. Quotient d. xn-k-1
b. Reminder 8. For designing of (4, 1) cyclic
c. Dividend repetition code, what would be the
d. Divisor order of generator polynomial?
4. A cyclic code can be generated using a. 4
a. Generator polynomial b. 2
b. Generator matrix c. 1
c. Parity check matrix d. 3
d. None of the above 9. According to the linearity property,
5. The feedback shift register is called the…….of the two code words in a
as cyclic code is also a valid code
a. Multiplying word.
b. Shifting a. Multiplication
c. Feedback b. Difference
d. Dividing c. Division
d. Sum
262
Binary Cyclic Codes
References
[1] R. E. Blahut, Algebraic Codes for Data Transmission, Cambridge University Press,
2002.
[2] T. K. Moon, Error Correction Coding: Mathematical Methods and Algorithms, Wiley,
2005.
[3] R. H. Morelos-Zaragoza, The Art of Error Correcting Coding, Wiley and sons, 2006.
[4] W. Stallings, Cryptography and Network Security: Principles and Practice, 4th Edition,
Prentice Hall, 2006.
[5] Shanmugam K San, Digital and Analog Communication System, John Wiley and Sons:
New York; 1989.
[6] Muralidhar Kulkarni and K S Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
[7] J. S. Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[8] K. Giridhar, Information Theory and Coding, Pooja Publications.
[9] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
[10] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
263
Introduction to Information Theory and Coding
Work Space
264
Chapter 6
Contents
Learning Objectives
6.1 Introduction...........................................................................................................................259
6.2 Galois field................................................................................................................. ............259
6.2.1 Galois field of 2n...........................................................................................................262
6.2.2 Representation of Polynomials..................................................................................263
6.2.3 Irreducible Polynomials..............................................................................................264
6.3 Bose-Chaudhuri-Hocquenqhem (BCH) codes..................................................................268
6.3.1 Generator Polynomial.................................................................................................268
6.3.2 Degree of BCH code....................................................................................................269
6.4 Reed Solomon codes.............................................................................................................271
6.4.1 Properties of Reed Solomon codes............................................................................271
6.4.2 Generator Polynomial.................................................................................................274
6.5 Golay codes........................................................................................................................ ...275
Things to be remember
References
265
Information is the Resolution
Of Uncertainty
-Claude. E. Shannon
266
6 SOME IMPORTANT CYCLIC CODES
Learning Objectives
6.1 Introduction
In cryptography, Galois field GF(2n) is often used because it supports all the
arithmetic operations such as addition, subtraction, multiplication and division. For
GF(2n), the ‘n’ can hold the values of 1, 2, 3…..which has a particular value that plays
a prominent role in network security. For the sets of polynomials in GF(2n), a group of
polynomials of degree ‘n’ is defined as the modulus. Such polynomials are referred to
as irreducible polynomials. This chapter deals with the polynomial representation for
some important cyclic codes such as Golay codes and BCH codes.
GF (p)
………………….6.2
267
Introduction to Information Theory and Coding
Equation (6.2) indicates that, ‘p’ can be any prime number and the set become (Zn*)
with Zp={0, 1,…..,p-1} with two arithmetic operations such as addition and
multiplication are supported. Now let us consider an example 6.1 to describe the
Galois field.
Example 6.1: Consider a smallest value of p=2 for a Galois field GF(p) where ‘p’ is a
prime number with the set {0, 1}.
Solution: For a Galois field GF(p)= GF(2) with the set {0, 1} and two arithmetic
operators such as addition and multiplication. We have
GF(2)
{0, 1} + X
+ 0 1
0 0 1
1 1 0
x 0 1
0 0 0
1 0 1
a 0 1 a 0 1
-a 1 0
-a 1 0
Example 6.2: Obtain an GF(5) on the set ‘Z5’ where ‘5’ is a prime number with
addition and multiplication operators.
Solution: For a Galois field GF(p)= GF(5) with the set {0, 1, 2, 3, 4} and two arithmetic
operators such as addition and multiplication. We have
GF(5)
{0, 1, 2, 3, 4} + X
+ 0 1 2 3 4
0 0 1 2 3 4
1 1 2 3 4 0
2 2 3 4 0 1
3 3 4 0 1 2
4 4 0 1 2 3
Fig. 6.2(b): Addition
x 0 1 2 3 4
0 0 0 0 0 0
1 0 1 2 3 4
2 0 2 4 1 3
3 0 3 1 4 2
4 0 4 3 2 1
a 0 1 2 3 4 a 0 1 2 3 4
-a 0 4 3 2 1 -a …. 1 3 2 4
Example 6.3: Let us define GF(22) field in which the set has four 2 bit words {00, 01,
10, 11}. Now we can redefine addition and multiplication for this code where all the
properties of these operations are satisfied.
Solution: For a Galois field GF(2n)= GF(22) with the set {00, 01, 10, 11} and two
arithmetic operators such as addition and multiplication. We have
GF(22)
+ 00 01 10 11
00 00 01 10 11
01 01 00 11 10
10 10 11 00 01
11 11 10 01 00
270
Some Important Cyclic codes
x 00 01 10 11
00 00 00 00 00
01 00 01 10 11
10 00 10 11 01
11 00 11 01 10
Irreducible Polynomial=x2+x+1
………………….6.3
Now the obtained polynomial x(1+x)= x2+x
is divided by irreducible polynomial of
x +x+1, then its remainder will be ‘1’ (i.e., 01). So the 01 is written in the multiplicative
2
table 6.3(c).
n-bit word
1 0 0 1 1 0 0 1
1x7 1x4 1 x3 1 x0
Finally after second simplification, for 8 bit word, the generated polynomial is
x7 x4 x3 1
Example 6.5: For an 8 bit word represented a polynomial x5+x2+x.Find the bit words.
Solution: Since n=8. It means that the polynomial is of degree (n-1)-(8-1)=7. The
expanded polynomial is
0 0 1 0 0 1 1 0
272
Some Important Cyclic codes
Example 6.6: Show that x2+1 is irreducible over the integer mod 7.
x2+1=(x+a) (x+b)
x2+1=(x2+xb+ax+ab)
x2+1= x2 +(a+b)x+ab
a+b=0
………………….6.5
ab=1
………………….6.6
If both the equations (6.5) and (6.6) are satisfied, then it is said to be reducible
polynomial otherwise, if any one of the equations (6.5) or (6.6) is not satisfied, then the
above polynomial is known as irreducible. So let us verify the polynomial for the
273
Introduction to Information Theory and Coding
different combinations of mod 7. i.e., Z7={0, 1, 2, 3, 4, 5, 6} is (0, 0), (1, 6), (2, 5), (3, 4),
(4, 3), (5, 2) and (6, 1).
Equation 6.5 is satisfied when (a, b)= (0, 0)=0
(1, 6)=0 (1+6=7.i.e., 7 mod 7 =1 with remainder is 0)
(2, 5)=0 (2+5=7.i.e., 7 mod 7 =1 with remainder is 0)
(3, 4)=0 (3+4=7.i.e., 7 mod 7 =1 with remainder is 0)
(4, 3)=0 (4+3=7.i.e., 7 mod 7 =1 with remainder is 0)
(5, 2)=0 (5+2=7.i.e., 7 mod 7 =1 with remainder is 0)
(6, 1)=0 (6+1=7.i.e., 7 mod 7 =1 with remainder is 0)
Equation 6.6 is not satisfied when (a, b)= (0, 0)=0
(1, 6)=6 (1x6=6. i.e., since 6 is small to 7, it is not possible to divide)
(2, 5)=3 (2x5=10. i.e., 10 mod 7 =1 with remainder is 3)
(3, 4)=5 (3x4=12.i.e., 12 mod 7 =1 with remainder is 5)
(4, 3)=5 (4x3=12.i.e., 12 mod 7 =1 with remainder is 5)
(5, 2)=3 (5x2=10.i.e., 10 mod 7 =1 with remainder is 3)
(6, 1)=6 (6x1=6.i.e., since 6 is small to 7, it is not possible to divide)
Now it is recorded that only equation 6.5 is satisfied whereas equation (6.6) is not
satisfied. Hence it is proved that polynomial x2+1 is irreducible over the integer
mod 7.
Example 6.7: Find out the polynomial x3-9 is irreducible or reducible over the
integer mod 11.
x3-9=(x+a) (x2+bx+c)
274
Some Important Cyclic codes
x3-9= x3+bx2+cx+ax2+abx+ac
x3-9= x3+(a+b)x2+(ab+c)x+ac
a+b=0
………………….6.7
ab+c=0
………………….6.8
ac=2
………………….6.9
So x3-9=0 for x=4. Therefore x-4 or x+7 is a factor. We can see by long division
x3-9=(x+7)(x2+4x+5)
If all the equations (6.7), (6.8) and (6.9) are satisfied, then it is said to be reducible
polynomial otherwise, if any one of the equations (6.7) or (6.8) or (6.9) is not satisfied,
then the above polynomial is known as irreducible. So let us verify the polynomial for
the values of a=7, b=4 and c=5. Equation 6.7 is satisfied, when (a, b, c) = (7, 4, 5)=0
(7+4=11. i.e., 11 mod 11=1 with remainder is 0). Equation 6.8 is satisfied, when (a, b, c)
= (7, 4, 5)=0 (7x4+5=33. i.e., 33 mod 11=3 with remainder is 0). Equation 6.9 is not
satisfied when (a, b, c) =(7, 4, 5)=2 (7x5=35. i.e., 35 mod 11=3 with remainder is 2).
Now it is recorded that all equations (6.7), (6.8) and (6.9) are satisfied. Hence it is
proved that polynomial x3-9 is reducible over the integer mod 11.
275
Introduction to Information Theory and Coding
n=2m-1
………………….6.10
Where ‘m’ is any positive integer and its value is m
(ii) The number of message bits in BCH codes is given in equation (6.11).
k
………………….6.11
Where ‘n’ is block length, ‘m’ is any positive integer, ‘t’ is number of errors that the
BCH codes can detect and correct the errors.
(iii) The minimum distance for BCH codes (dmin) is given in equation (6.12).
dmin 2t+1
………………….6.12
276
Some Important Cyclic codes
where ‘t’ is number of errors that BCH codes can detect and correct errors. For double
error correcting code, t=2 then the generator polynomial g(x) is given in equation
(6.14).
g(x)=LCM[m1(x), m2(x), m3(x), m4(x)]
………………….6.14
6.3.2 Degree of BCH Code (r):
K=n-r
………………….6.16
Example 6.8: Construct a triple error correcting BCH code with block length n=31
over GF(25).
m1(x)=x5+x2+1
m2(x)= m1(x)
m3(x)=x5+x4+x3+x2+1
m4(x)= m2(x)
m5(x)=x5+x4+x2+x+1
m6(x)= m3(x)
Now the generator polynomial g(x) after substitution of GF(25) values, we get
277
Introduction to Information Theory and Coding
g(x)=LCM[m1(x). m3(x).m5(x)]
………………….6.18
g(x)= x15+ x11+ x10+ x9+ x8+ x7+ x5+ x3+ x2+x+1
………………….6.19
From equation (6.10), we have
n=2m-1
31=2m-1
2m=32
Therefore
m=5
k=n-mt
After substitution we have
k=31-5x3
k=16
Therefore, we can say that it is (31, 16) triple error correcting BCH codes.
278
Some Important Cyclic codes
The RS encoder takes a block of digital data and adds extra redundant bits. During
the communication channel, there may be errors are generated due to the various
reasons such as noise or interference, scratches on a CD etc.,. The RS decoder
processes each block and attempts to correct the errors and recover the original data.
The number and type of errors that can be corrected depends on the characteristics of
RS code.
279
Introduction to Information Theory and Coding
(i) Reed Solomon codes are a subset of BCH codes and are linear block codes and it is
denoted as RS (n, k) with s-bit symbols.
(ii) The RS encoder takes ‘k’ data symbols of ‘s’ bits each and adds parity symbols to
make an ‘n’ symbol codeword.
(iv) A RS decoder can correct up to ‘t’ symbols that contain errors in a codeword.
Where 2t=n-k.
Data Parity
n
Fig.6.5: Typical diagram of RS codeword
It is also known as Systematic code because the data is left unchanged and the parity
symbols are appended.
Example 6.9: Describe a popular Reed-Solomon code is RS(255, 223) with 8-bit
symbols.
Solution: Each codeword contains 255 codeword bytes, of which 223 bytes are data
and 32 bytes are parity. For this code n=255, k=223, s=8, 2t=32, and t=16. This
indicates that the decoder can correct any 16 symbol errors in the codeword i.e., errors
up to 16 bytes positions in the codeword can be automatically corrected. It is given
that symbol size ‘s’ the maximum codeword length (n) for a Reed-Solomon code is
280
Some Important Cyclic codes
n=2s-1. This means that the maximum length of a code with 8-bit symbols (s=8) is 255
bytes. Reed Solomon codes may be shortened by making a number of data symbols
zero at the encoder (not transmitting them) and then re-inserting them at the decoder.
n=2m-1
Since n=31. Therefore
31=2m-1
32=2m
25 =2m
m=5
(ii) Block length is obtained by
nxm
31 x 5
155 bits
281
Introduction to Information Theory and Coding
dmin=2t+1
dmin=n-k+1
dmin=31-15+1
dmin=17
t=
t=
Therefore
t=8
m=5
g(x)=(x-ai)(x-ai+1)……… (x-ai+2t)
………………….6.20
282
Some Important Cyclic codes
c(x)=g(x) i(x)
………………….6.21
Where g(x) is the generator polynomial, i(x) is the information block, c(x) is a valid
codeword and is referred to as a primitive element of the field.
Example 6.11: Show that the (23, 12) binary code is a perfect Golay code.
Solution: For the (23, 12) Golay code that has capable of correcting up to three errors
in a block of 23 bits. It is a perfect binary code, since it satisfies the Hamming bound
with equality sign for t=3. For Golay code consider
2k=∑ = 212 ∑
283
Introduction to Information Theory and Coding
= 212 ∑
= 212 (2048)
=212. 211
=223
Therefore
2k=∑ =2n
284
Some Important Cyclic codes
THINGS TO BE
REMEMBER
285
Introduction to Information Theory and Coding
References
[1] R. Johannesson and K. S. Zigangirov, Fundamentals of Convolutional Coding, 2nd
Edition, Wiley‐IEEE Press, 2015.
[2] E. Biglieri, D. Divsalar, P. J. McLane and M. K. Simon, Introduction to Trellis Coded
Modulation with Applications, Macmillan, 1991.
[3] Shanmugam K San, Digital and Analog Communication System, John Wiley and Sons:
New York; 1989.
[4] Muralidhar Kulkarni and K S Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
[5] J. S. Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[6] K. Giridhar, Information Theory and Coding, Pooja Publications.
[7] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
[8] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
286
Chapter 7
Convolution Codes
Syllabus: Convolution Codes: Convolution Encoder, Time domain approach, Transform
domain approach, Code Tree, Trellis and State Diagram, The Viterbi Algorithm.
Contents
Learning Objectives
7.1 Introduction...........................................................................................................................281
7.2 Some definitions............................................................................................................. .......282
7.2.1 Code rate.............................................................................................................. .........282
7.2.2 Constraint length.........................................................................................................282
7.3 Analysis of convolution encoder using time domain approach......................................282
7.4 Analysis of convolution encoder using matrix method...................................................288
7.5 Analysis of convolution encoder using transform domain approach............................290
7.6 Graphical Approaches...........................................................................................................301
7.6.1 State diagram................................................................................................................301
7.6.2 Code tree.......................................................................................................................305
7.6.3 Trellis diagram.............................................................................................................307
7.7 Viterbi algorithm for convolution decoding......................................................................309
7.7.1 Some definitions...................................................................................................... ....310
Things to be remember
Descriptive Questions
Multiple Choice questions
References
287
I visualize a time when we will
be to robots what dogs are to
humans, and I am rooting for
the machines.
Claude. E. Shannon
288
7 CONVOLUTION CODES
Learning Objectives
7.1 Introduction
In the previous section we have discussed error control codes which are basically
classified into two categories as block codes and the convolution codes. Block codes
have k-message bits which are encoded into an n-bit code vector whereas convolution
codes generate parity symbols and works on input bits rather than input sequence. In
convolution codes, coding is done by combining the input bits which are in fixed
number.
Peter Elias in the year 1995 introduced convolution codes that are used to achieve
in various applications to transfer the data more effectively such as in digital videos,
radios, mobile and satellite communications. The difference between block codes and
convolution codes is entire input data sequence is encoded into code words in
convolution codes whereas in case of block codes, input data sequence gets
segmented into blocks and individual block gets encoded. Other difference is unlike
block codes convolution codes possess memory. The convolution code generates „n‟
symbol code words from „k‟-symbol message blocks. The Convolution encoder has m-
stage shift registers acts as a memory elements and a circuit to perform operation to
generate the code words. It says that the output is dependent on previous inputs as
well. Hence, the convolution codes are implemented not only by „n‟ and „k‟ values but
also the „m‟ memory elements used in encoder. So, the implementation of the
289
Introduction to Information Theory and Coding
convolution codes can be written as (n, k, m) where „n‟ indicates the number of
outputs, „k‟ indicates inputs and the „m‟ indicates memory elements.
Let us consider a sequence {g0(1), g1(1), g2(1),........, gm(1)} of impulse response of the
module-2 adder which generates an output x1 and similarly for an output x2 the
impulse response or generator sequence be {g0(2), g1(2), g2(2),........, gm(2)}. The resulted
output will be the combined impulse response of both the output1 and output2 and is
called as the generator sequence of the code. By considering the Fig 7.1, we have two
outputs i.e., n=2 and two memory elements m=2 with message bits k=1. Here, we
need to find the number output bits for both module-2 adders. Hence, for both the
outputs x1 and x2 we have to find the generator sequence.
x(i)(1)=∑
.............................7.2
Where
i= 0, 1, 2........indicates the bit index.
M = length of the generator sequences.
= message length.
Similarly for the output sequence for x(2)
291
Introduction to Information Theory and Coding
x(i)(2)=∑
.............................7.3
At the output side there is a multiplexer which switches between the two outputs. So,
the final output {Xi} is the multiplexed output of the two outputs i.e., one bit from x(i)(1)
and next bit from x(i)(2).
{Xi} ={ x(0)(1) , x(0)(2) , x(1)(1) , x(1)(2) ,..........}
.............................7.4
The length of the output should be L+M-1. Where, L and M indicates the length of the
message sequence and length of the two generator sequences respectively. To
understand the time domain approach let us consider the example 7.1.
Example 7.1: For the convolution encoder given in Fig 7.1, find the generator
sequence and the output sequence for the given message sequence m = {1 1 1 0 1} with
a convolution rate 1/2.
Solution: From the given Fig 7.1 it is noticed that there are two output bits i.e., n=2,
memory elements m=2 and the input bit k=1. So we can say that the convolution
encoder is of (2, 1, 2) code. So the generator sequence g(1) and g(2) are given as
For the given message sequence m= {m0, m1, m2, m3, m4} of length L= 5 and the length
of the two generator sequence m=3. So, the output sequence length is
L+M-1=5+3-1=7bits.
From the equation (7.2.1), the output sequence bit for x(1) is given by
x(i)(1)=∑
292
Convolution codes
Since we are not having the message bit value for so the first bit of the first adder
is only consist of
x(0)(1)=
x(0)(1)= = (1 x 1)=1
For i=1,
x(1)(1)=∑ = +
= (1 x 1) + (1 x 1) = 1 + 1 =0
For i=2,
x(2)(1)=∑ = + +
= (1 x 1) + (1 x 1) + (1 x 1) = 1 + 1 + 1=1
For i=3,
x(3)(1)=∑ = + +
= (1 x 0) + (1 x 1) + (1 x 1) = 0 + 1 + 1=0
For i=4,
x(4)(1)=∑ = + +
= (1 x 1) + (1 x 0) + (1 x 1) = 1 + 0 + 1=0
For i=5,
x(5)(1)=∑ = + +
x(5)(1)= +
293
Introduction to Information Theory and Coding
= (1 x 1) + (1 x 0)= 0 + 1 + 0=1
For i=6,
x(6)(1)=∑ = + +
Since, the values of m5 and m6 are not there we will consider x(6)(1) as
x(6)(1)=
= (1 x 1) = 1
NOTE: The value of i= n x m where n indicates the output bits and m indicates the
bits of generator sequence.
Similarly, From the equation (7.3), the output sequence bit for x(2) is given by
x(i)(2) =∑
Now, for i=0,
x(0)(2)=∑ = +
Since we are not having the message bit value for so the first bit of the first adder
is only consist of x(0)(2)= . Now, by substituting the values of . We
get
x(0)(2)= = (1 x 1)=1
For i=1,
x(1)(2)=∑ = +
= (1 x 1) + (0 x 1)= 1 + 0 =1
For i=2,
x(2)(2)=∑ = + +
= (1 x 1) + (0 x 1) + (1 x 1)= 1 + 0 + 1=0
For i=3,
294
Convolution codes
x(3)(2)=∑ = + +
= (1 x 0) + (0 x 1) + (1 x 1)= 0 + 0 + 1=1
For i=4,
x(4)(2)=∑ = + +
= (1 x 1) + (0 x 0) + (1 x 1)= 1 + 0 + 1=0
For i=5,
x(5)(2)=∑ = + +
x(5)(2)= +
= (0 x 1) + (1 x 0)= 0 + 0 =0
For i=6,
x(6)(2)=∑ = + +
Since, the values of m5 and m6 are not there we will consider x(6)(1) as
x(6)(2)=
= (1 x 1)=1
Finally, the two output bits are written as
x(1) ={1 0 1 0 0 1 1}
x(1) ={1 1 0 1 0 0 1}
The message sequence is of L=5 and the code rate is 1/2 which states that for 1 input
bit it should produce 2 output bits. But the output bits are of length 14 .For each
295
Introduction to Information Theory and Coding
message two output bits, for the last four bits the input is considered as 0 and 0. This
resets the encoder for the further operations.
={ ...... }
={ ...... }
Now let the message sequence m= {m1, m2, m3,....., mL} of length „L‟. The generator
matrix has „L‟ rows and n(L+m-1) columns. Hence, the matrix formed as
G=
[ ]
.............................7.5
Hence, the output of the convolution encoder „X‟ is written as
X= m x G
.............................7.6
X=[ m1, m2, m3,....., mL] x G
X=
[ ]
296
Convolution codes
Example 7.2: For the convolution encoder (2, 1, 2), the impulse response is
=[1 1 1] and =[1 0 1]. Construct the generator matrix and also find the
output code vector for the given message sequence m= [1 0 0 1 1].
Solution: For (2, 1, 2) convolution encoder the output bits n=2, memory elements
m=2, the input bit k=1 and the impulse response sequence bit M=3. The generator
sequences are
={ } =[ 1 1 1]
={ } =[ 1 0 1]
The message sequence
Generator Matrix will be having „L‟ rows i.e., 5 rows and the n x (L+M-1) columns i.e.,
2 x (5+3-1) = 14columns. Therefore, generator matrix „G‟ can be written as
G=
[ ]
G=
[ ]
X=m x G
Hence, the output sequence will become
297
Introduction to Information Theory and Coding
X= [1 0 0 1 1]
[ ]
X= [11 10 11 11 01 01 11]
Note: Two rows of the generator matrix is the output for the one message bit.
={ }
=
………………7.7
If we look at the equation (7.7) we can notice that the coefficients of the polynomial
are the generator sequences. Similarly, for the second output generator sequence is
given by
={ }
=
………………7.8
Step 2: Express the message sequences as polynomials. In general the message
sequence can be written as
m(D)=
………………7.9
Step 3: Calculate the output as a polynomial. Let the outputs be (D) and (D)
when expressed as a function of delay parameter „D‟. So, we can write the first output
of the convolution encoder as the product of the message sequence and the first
generator sequence with the delay parameter „D‟.
(D)= m (D)
………………7.10
Similarly, the second output of the convolution encoder is the product of the message
sequence and the second generator sequence with the delay parameter „D‟.
(D)= m (D)
………………7.11
{Xi} ={ x(0)(1) , x(0)(2) , x(1)(1) , x(1)(2) ,..........}
........................7.12
The sequences of the output can be written by taking the one bit from the first output
sequence and the first bit from the second output sequence. Hence, the equation
(7.10) and (7.11) gives the final encoded output equation (7.12) of the convolution
code in transform domain method.
299
Introduction to Information Theory and Coding
Example 7.3: For the convolution encoder (2, 1, 2), the impulse response is
= [1 1 1] and =[ 1 0 1]. Find the output code vector for the given message
sequence m= [1 0 0 1 1] with a code rate ½ and the Constraint length K=3.
Solution: From the given data for (2, 1, 2) convolution encoder the output bits n=2,
memory elements m=2, the input bit k=1.To obtain the output code vector the
following steps are followed.
={ = [1 1 1]
= =
This is the first generator sequence polynomial. Similarly, for the second output
generator sequence is given by
={ }=[1 0 1]
= =
300
Convolution codes
Step 2: Express the message sequences as polynomials. The given message sequence is
m (D)=
By substituting the values of the message sequence in the above equation we get
m (D)=
m (D)= 1+ +
Step 3: Calculate the output as a polynomial. From the equation (7.10) we can write
the first output of the convolution encoder as the product of the message sequence
polynomial and the first generator sequence polynomial with the delay parameter „D‟.
(D)= m (D)
(D)= (1+ + )( )
= 1+D+ + + + + + +
=1+ D+ + + (1+1)+ (1+1)+
(D)= 1+ D+ + +
301
Introduction to Information Theory and Coding
Similarly from the equation (7.11) the second output of the convolution encoder is the
product of the message sequence and the second generator sequence with the delay
parameter „D‟.
(D)= m (D)
(D)= (1+ + )( )
= 1+ + + + +
(D)= 1+ + + +
= [ 1 0 1 1 1 1 1]
X= [11 10 11 11 01 01 11]
Example 7.4: For the convolution encoder (3, 1, 2) with the impulse response is
=[1 1 0], =[1 0 1] =[1 1 1].
302
Convolution codes
Solution: (i) Convolution encoder can be constructed from the given impulse
response =[1 1 0], =[1 0 1] =[1 1 1]. The (3, 1, 2) convolution encoder
has output bits i.e., number of module -2 adders (n=2), number of memory elements
m=3 and the input bits (k=1).
(ii) From the equation (7.1) the code rate is defined as the ratio of input bits to the
output bits i.e.,
R= k/n= 1/3
It says that for every single input the encoder will produce output of three bits.
(iii) To construct a generator matrix we have impulse responses. We have impulse
responses = [ 1 1 0], =[ 1 0 1] =[ 1 1 1] .The number of rows is equal
303
Introduction to Information Theory and Coding
G=
[ ]
The output of the encoder for the message sequence m=[11101] is given by
X= m x G
X=[11101]
[ ]
For adder 1 i.e., from the equation (7.2) the output X is given by
x(i)(1)=∑
For i=0
x(0)(1)=∑ g
x(0)(1)=g
x(0)(1)=1x1=1
304
Convolution codes
x(5)(1)=g g = (1 x 1)+(0 x 0) = 1
x(6)(1)=g = (0 x 1) = 0
For adder 2 i.e., from the equation (7.3) the output X is given by
x(i)(2)=∑
For i=0
x(0)(2)=∑
x(0)(2)=g
x(0)(2)=1x1=1
x(5)(2)=g = (0 x 1)+(1 x 0) = 0
305
Introduction to Information Theory and Coding
= = (1 x 1) = 1
For adder 3,
=∑
For i=0
=∑
=1x1=1
= + =(1 x 1)+(1 x 1) = 0
= + = (1 x 1)+(1 x 1)+(1 x 1) = 1
= + = (1 x 0)+(1 x 1)+(1 x 1) = 0
= + = (1 x 1)+(1 x 0)+(1 x 1) = 0
= = (1 x 1)+(1 x 0) = 1
= = (1 x 1) = 1
= [ 1 1 0], =[ 1 0 1] =[ 1 1 1].
306
Convolution codes
=
,
= =
={ =[1 0 1]
= =
={ =[1 1 1]
= =
m (D)=
By substituting the values of the message sequence in the above equation we get
m (D)=
m (D)= 1
307
Introduction to Information Theory and Coding
=( )( 1 )
=1+D+ + + + +
=1+D(1+1)+ (1+1)+ + +
X(1)D=1+ + +
The sequence is
X(1)=[1 0 0 1 1 1 0]
To obtain the output at adder 2
X(2)D= m (D)
=( )+( 1 )
=1 + + + +
X(2)D=1+D+ +
The sequence is
X(2)=[1 1 0 1 0 0 1]
=1 + + + + + + + +
308
Convolution codes
X(3)D=1+ +
The sequence is
X(1)=[1 0 1 0 0 1 1]
If the convolution encoder is of (2, 1, 2) then the memory elements m=2. Then the
states are 22= 4 states.
Step 2: write down the states with respect to the combination of memory elements i.e.,
for convolution code (2, 1, 2).
m1 m2 State
0 0 S0
309
Introduction to Information Theory and Coding
0 1 S1
1 0 S2
1 1 S3
Step 3: Construct the state transition table by considering the states and the possible
input bits of the states. Also determine the output of the encoder by considering the
inputs and memory elements.
Step 4: Draw the state diagram with respect to the state transition table.
Example 7.5: Consider the convolution encoder (2, 1, 2) as shown in Fig. (7.3) below
and the impulse response is g(1)=[111]and g(2)=[101] Draw the state diagram.
310
Convolution codes
Step 2: Write down the states with respect to the combination of memory elements
i.e., for convolution code (2, 1, 2).
Step 3: Construct the state transition table. From the Fig (7.3) let us consider d1, d2
and d3 as input value and output of the memory element values X(1) and X(2) are given
as
X(1)= d1 + d2 + d3
X(2)= d1 + d3
X(1)= d1 + d2 + d3 = 0 + 0 + 0 =0
X(2)= d1 + d3 = 0 + 0 + 0 = 0
311
Introduction to Information Theory and Coding
So, the output for the state S0 is “00”when the input bit „0‟. Similarly id the input bit is
„1‟ then the output will be
X(1)= d1 + d2 + d3 = 1 + 0 + 0 =1
X(2)= d1 + d3 = 1 + 0 + 0 = 1
The output is 11. Similarly calculate the output for all the remaining states.
Step 4: Draw the state diagram with respect to the state transition diagram.
From the table 7.3 of state transition table , it is clear that when the present state „S0‟ is
input is „0‟ then the state transit to the next state „S1‟ by producing output “00” and for
input ‟1‟ transit to the next state „S2‟ with output “11”. Similarly for the remaining
states we have
A tree diagram is redrawn model of the state diagram considering the branches of the
tree. It is the most effective and efficient way to represent the encoder rather than the
state diagram. The features of the code tree are:
(i) Every input bit either „0‟ or „1‟ represents a branch of the tree.
312
Convolution codes
(ii) The upper divided branch of the tree represents a bit „0‟.
(iii) The lower divided branch of the tree represents a bit „1‟.
(iv) The path to trace the output of the encoded sequence should start from left
side to the right side.
(v) After every three branches the tree structure will repeat for the further
bifurcation.
Step 3: If the input value of the state „S0‟ is „1‟ then move to the downward of the
branch „S1‟ with the corresponding output value “11”.
Step 4: Divide the branches according to the states by referring to the table 6.2 of state
transition table with their output values for the corresponding input value.
Step 5: The bifurcation of the tree branches continues till the length of message input
stages i.e., „L‟ stages. The Fig (7.5) illustrates the tree diagram for convolution encoder
(2, 1, 2).
313
Introduction to Information Theory and Coding
314
Convolution codes
Construction:
Let us consider a convolution encoder (2, 1, 2) with the message sequence m = {1 0 0 1
1 } of L length and the constraint length K=3. The structure of trellis is as follows.
(i) There are L+K levels i.e., 5+3=8 levels. Index bit is denoted as J. So, the level of
indexing will be J=0, 1, 2, ….., L+K-1. i.e., from J=0 to J=7 levels.
(ii) The input bit „0‟ is indicated with solid line and the input „1‟ indicated with the
dashed line. The corresponding outputs are written in the lines.
0
315
Introduction to Information Theory and Coding
Initially we are at the stage „S0‟ of level J=0, for the input bit „0‟ the next state will be
„S0‟ draw the solid line with corresponding output “00”. Similarly, for the input bit „1‟
the next state is „S1‟ draw the dashed line with the corresponding output “11”. The
process will continue from the level J=1. We can observe here that the initial level j=0
is departure in to two stages at the level j=1.
(iii) At the level K-1 i.e., J=2 we got all the states connected and completely
departure from the initial state.
(iv) Now from the Fig (7.6) the structure is periodic from the K-1 to L level i.e.,
from j=2 to j=5.
(v) We can also observe that at the last K-1 levels i.e., J=7, the structure is similar
like the initial structure.
316
Convolution codes
Tracing:
For the input sequence m= {1 0 0 1 1} , tracing will start from the level J=0 . As the first
bit is „1‟ output of the dashed line of that branch will be considered i.e., “11”. For the
next message sequence bit „0‟ the corresponding output of the solid line at the stage
J=1 will be considered. Similarly, the process will repeat for the remaining message
sequences. The level J=6 and J=7 indicates the tail bit „0‟ the output of tail bits is also
considered. The final encoded output is written as [ 1 1 1 0 1 1 11 01 01 11]. The
periodic structure of trellis can be given in Fig (7.7) shown below.
Branch Metric: The hamming distance between the particular branch output and the
frame length of the particular received bit. For example if the output of the first
branch is “00” and the first frame of the received sequence is “10”then the Branch
metric or hamming distance d(00, 10) is „1‟.
Path Metric: The total metric accumulated by the each branch at the node is called as
the path metric.
Surviving Node: It is the path of the decoding sequence with the minimum path
metric.
Let us consider the received sequence R= [11, 10, 11] of 6 bits, decode the encoder (2,
1, 2). Assume that the states S0 as a0, S1 as b0, S2 as c0 and S3 as d0. Now, the decoder is
at S0 state means a0 state, from the trellis periodic diagram as shown in Fig 7.7 the
branch will bifurcate in two a0 and b0. The division of the branch continues according
to the trellis diagram with their corresponding output bits. The Fig 7.8 shows the
Viterbi decoding structure.
318
Convolution codes
From the Table (7.4) of path metric we can observe that the branch metric from a0 to
a1 is 2, a1 to a2 is 1 and a2 to a3 is 2 so the path metric will become 5 shown at the node
a3. So, we are going to neglect that path. Similarly, by calculating all the path metric
value we observe from the table that the path a0 – b1 – c2 – a3 is going to be the
surviving path with the minimum path metric value „0‟. To find the value of the
decoder trace the surviving path which possesses the least branch metric value. From
the Fig (7.8) by tracing the surviving path the branch metric value of a0 – b1 is 0, for the
input bit „1‟ indicated with the dashes line, branch metric value of b 1 – c2 is 0, for the
input bit „0‟ indicated with the solid line and the branch metric value of c 2 – a3 is „0‟,
for the input bit „0‟ indicated with the solid line. Hence, the decoded value is [1, 0, and
0].To verify the answer check the first three message sequence values for the first six
bits of the encoded output from the previous examples.
319
Introduction to Information Theory and Coding
320
Convolution codes
DESCRIPTIVE
QUESTIONS
1. For the (3, 1, 2) convolution encoder (iii)Using the time domain approach
with the generator sequences g(1) =[1 find the output sequence.
1 0], g(2) =[1 0 1], and g(3) =[1 1 1] (iv)Using the transform domain
(i) Draw the block diagram of approach find the output sequence.
encoder.
(ii)For the message sequence m= {1 4. Construct the state diagram and
1 1 0 1} construct the generator trellis diagram for the convolution
matrix and the find the output code encoder (2, 1, 3) with generator
vector. sequences mentioned in the above
(iii) By using the time domain question 3.
approach find the output sequence
5. For the encoder (2, 1, 2) construct
2. Repeat the above question and find the viterbi decoding algorithm for
the output code vector using the received sequence R= [11 01 10
Transform Domain approach. List 01 00].
the distinct advantages of cyclic 6. Explain the operation of the
codes over linear block codes. convolution code with an example.
3. For the (2, 1, 3) convolution encoder 7. For the (3, 1, 3) convolution encoder
with the generator sequences with with the generator sequences with
the code rate r =1/2 and constraint the code rate r =1/2 and constraint
length K=4 are length K=4 are g(1) =[1 0 1 1] g(1) =[1
1 1 1] and g(2) =[1 1 0 1].
g(1) =[1 1 1 1] and g(2) =[1 1 0 1]
(i) Draw the block diagram of
(i) Draw the block diagram of encoder.
encoder.
(ii)For the message sequence m= {1
(ii)For the message sequence m= {1
1 1 0 1 1 0 1} construct the generator
0 0 0 1}. Construct the generator matrix and the find the output code
matrix and the find the output code vector.
vector.
321
Introduction to Information Theory and Coding
322
Convolution codes
MULTIPLE CHOICE
QUESTIONS
1. In Frame Check Sequence, which horizontal axis represent/s?
code is used if character length is 6 a. Continuous time
bit and generates 12 bit parity b. Discrete time
check bits? c. Sampled time
a. CRC-12 d. All of the above
b. CRC-16 6. For the 4 states of an encoder on
c. CRC-32 vertical axis of Trellis diagram, what
d. CRC-CCITT do/does the solid line indicate/s?
2. Decoding of RS code comprises the a. ‘0’ input
determination of error …….. b. „1‟ input
a. Position c. Both „0‟ and „1‟
b. Angle d. None of the above
c. Position and magnitude
7. To obtain the transfer function of a
d. Frequency
convolution code, the splitting of
3. In RS code, the length is…….less all-zero state takes place into………
than number of symbols in symbol
a. Starting state
set (q).
b. First return to all zero state
a. One c. in-between state
b. Two d. Both a and b
c. Three
8. The distance between each symbol
d. Infinite
in given sequence and reference
4. In Minimum Distance Separable sequence is known as ………………
codes, the minimum distance is one
a. Euclidean Distance
more than the number of ………..
b. Distance between sequences
a. Parity check bits c. Manmattan Distance
b. Information bits d. Hamming Distance
c. Symbol bits 9. The term ‘dfree‟ is defined as the
d. None of the above Euclidean distance of coded signal
5. In Trellis diagram, what do/does the
323
Introduction to Information Theory and Coding
Answers
Q. No 1 2 3 4 5
Options a c a a b
Q. No 6 7 8 9 10
Options a d b a a
References
[1] R. Johannesson and K. S. Zigangirov, Fundamentals of Convolution Coding, 2nd
Edition, Wiley‐IEEE Press, 2015.
[2] E. Biglieri, D. Divsalar, P. J. McLane and M. K. Simon, Introduction to Trellis Coded
Modulation with Applications, Macmillan, 1991.
[3] Simon Haykin, An Introduction to Analog and Digital Communications, John Wiley
and Sons: 1989.
[4] T. K. Moon, Error Control Coding: Mathematical Methods and Algorithm, John Wiley &
Sons: New Jersey; 2005
[5] Shanmugam K San, Digital and Analog Communication System, John Wiley & Sons:
New York; 1989.
[6] H Meliani and A Benidir, Coding and Decoding Algorithms for BCH Codes, Al-Asha
College of Technology, KSA University of Blinda: Algeria.
324
Convolution codes
[7] Shuin and Daniel J Costello, Error Control Coding: Fundamentals and Applications,
Prentice Hall Series, Inc: Englewood Cliffs, NJ; 1983.
[8] Ranjan Bose, Information Theory, Coding and Cryptography, Tata McGraw Hill: New
Delhi; 2008.
[9] Peter Sweeney, Error Control Coding, John Wiley and Sons: New York; 1991.
[10] Muralidhar Kulkarni and K. S. Shivaprakasha, Information Theory and Coding, John
Wiley and Sons, 2015.
[11] J S Chitode, Information Theory and Coding, Technical Publications Pune, 2012.
[12] K Giridhar, Information Theory and Coding, Pooja Publications.
325
Introduction to Information Theory and Coding
Work Space
326
Appendix-A
INFORMATION THEORY AND CODING
MODEL QUESTION PAPER – 1 (CBCS)
As per VTU Syllabus
Note: Answer any FIVE full questions, choosing one full question from
each module.
Module-1
Q. No 1 a. For the given Markov source shown in fig Q. 1(a).
Fig. Q. 1(a)
Determine
(i) State Probabilities (ii) Entropy of each source (iii) Entropy of source iv) G1>G2>H(s).
(8 Marks)
b. A black and white TV picture consists of 256 lines of picture information. Assume that
each line is consists of 256 picture elements (pixels) and that each can have 255 brightness
levels. Picture is repeated at the rate of thirty frames/sec. Calculate the average rate of
information conveyed by a TV set to a viewer.
(4 Marks)
c. Define the following terms
(i) Self information (ii) Entropy (iii) Rate of information iv) Mutual information
(4 Marks)
327
Model Question Paper 1
OR
Q. No 2a. The binary source produces symbols ‘0’ and ‘1’ with a probability p and 1-p.
Determine the Entropy of this source and sketch the variations of the entropy
with p.
(5 Marks)
b. The output of an information source consists of 128 symbols. Sixteen of which
occurs with probability of occurs with the probability of . The source emits
1000 symbols per second. Assume that the symbols are chosen independently.
Find the average information rate of the source.
(5 Marks)
c. For the given Markov source shown in fig. Q. 2(c).
Fig. Q. 2(c)
Module-2
Q. No 3 a. A source emits symbols with probabilities 0.4, 0.2, 0.12, 0.08, 0.08, 0.08, 0.04.
Construct a binary Huffman code and Shannon-Fano code. Calculate the
efficiency in both the cases.
(8 Marks)
b. Explain Shannon’s noiseless encoding algorithm.
(4 Marks)
c. State all the properties of entropy and prove the Extremal property.
(4 Marks)
OR
328
Model Question Paper 1
Q.No 4a. The source emits messages consisting of two symbols each. These messages and their
probabilities are given in table 1. Design the source encoder using Shannon’s
encoding algorithm and also find encoder efficiency.
Messages (Mi) AA AC CC CB CA BC BB
Probabilities (Pi) ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄
(6 Marks)
b. Construct a Shannon Fano Ternary code for the following ensemble shown in table 2.
Calculate code efficiency and redundancy. Also draw the corresponding code tree.
Symbols (S) S1 S2 S3 S4 S5 S6 S7
Probabilities (Pi) 0.3 0.3 0.12 0.12 0.06 0.06 0.04
c. Obtain the code-words using Lempel-Ziv coding method for the given string
XXYYXXYYYXY.
(4 Marks)
Module-3
Q. No 5 a. For a given channel matrix, calculate H(x), H(y) and channel capacity given
P(x1)=0.6, P(x2)=0.3 and P(x3)=0.1
⁄ ⁄
⁄ ⁄
[ ⁄ ⁄ ]
(6 Marks)
329
Model Question Paper 1
(4 Marks)
OR
[ ]
Fig. Q. 3(c)
Where P[x=0]= and P[x=1]= . Determine I[X, Y] for =0.75 and =0.9 and also find the
capacity of channel for rs=1000 sym/sec.
(6 Marks)
Module-4
Q. No 7 a. For a systematic (6, 3) linear block code the parity matrix given by
330
Model Question Paper 1
[P]=[ ]
(i) Find generator matrix [G] and parity check matrix [H] for this code.
(ii) Prove that GHT=0
(iii) Find the minimum weight of this code.
(iv) Find error detecting and correcting capability.
(v) Draw encoder circuit and syndrome circuit for the same.
(8 Marks)
OR
Q.No 8a. A (15, 5) linear cyclic code has a generator polynomial g(x)=1+x+x 2+x4+x5+x8+x10.
Draw the cyclic encoder and find the codeword for the message polynomial
D(x)=1+x2+x4 in systematic form by listing the states of the shift register. Also draw
the syndrome calculator circuit for given g(x).
(8 Marks)
b. What is binary cyclic code? Describe the features of encoder and decoder used for
cyclic codes using an (n-k) bit shift register.
(8 Marks)
Module-5
Q. No 9 a. Write a note on Galois field, Golay code, RS code and BCH code.
(8 Marks)
331
Model Question Paper 1
b. Consider the (3, 1, 2) convolution code with g(1)=(1 1 0), g(2)=(1 0 1) and g(3)=(1 1 1).
(i) Draw the encoder block diagram.
(ii) Find the generator matrix.
Q.No 10a. Consider the (2, 1, 3) convolution encoder with g (1)=(1 1 0), g(2)=(1 1 0 1) and
g(3)=(1 0 1 1).
(i) Draw the encoder block diagram.
(ii) Write down the state transition table.
(iii) Draw the code tree.
(iv) Find the encoder output produced by the message sequence (1 1 1 0 1) by
traversing through code tree.
(12 Marks)
b. Explain BCH Code with a suitable example.
(4 Marks)
332
INFORMATION THEORY AND CODING
MODEL QUESTION PAPER-2 (CBCS)
As per VTU Syllabus
Note: Answer any FIVE full questions, choosing one full question from
each module.
Module-1
Q. No 1 a. A zero memory source emits one of the four symbols in every 1ms. The symbol
probabilities
are , -. Find
333
Model Question Paper 2
Module-2
Q. No 3 a. Apply Arithmetic Coding procedure to generate a tag that lies in between 0 to 1 for
the probabilities P(V)=0.4, P(T)=0.3, P(U)=0.2, P(E)=0.08, P(C)=0.02. Also find the
total tag value for the sequence „VTUEC‟.
(6 Marks)
b. Consider a discrete memory less source S={S1, S2, S3, S4, S5, S6} with the probabilities
P={ 0.4, 0.2, 0.1, 0.1, 0.1, 0.05, 0.05}. Construct a binary Huffman code by placing the
composite symbol as high as possible. Also calculate the variance of word length.
(6 Marks)
c. Encode the given string 1001101001 using Lempel-Ziv-Welsh algorithm
(4 Marks)
OR
334
Model Question Paper 2
Q.No 4a. A discrete memory-less source with alphabets “A to H” has respective probabilities
0.22, 0.20, 0.18, 0.15, 0.10, 0.08, 0.05 and 0.02. Construct binary code and ternary
codes for the same using Huffman‟s encoding algorithm. Determine code efficiency
in each case.
(6 Marks)
b. Explain briefly the Lempel-Ziv and Lempel-Ziv Welsh coding technique.
(6 Marks)
Module-3
Q. No 5 a. Consider a set of symbols A= {a1, a2, a3} at the transmitter and a set of symbols B=
{b1, b2, b3} at the reception. For the table 1, find the missing probabilities (*) and also
find P( ⁄ ) and P( ⁄ ).
b. Two noisy channels are cascaded whose channel matrices are given by
( ⁄ )=* +
and
( ⁄ )=[ ]
Q.No 6a. The noise matrix of a binary symmetric channel is given below, with the transmitted
symbols having probabilities of and respectively.
P( ⁄ )=* +
b. Calculate the capacity of the channel using Muroga‟s method for the fig Q. 6(c) and
P(X1)=0.5, P(X2)=0.3, and P(X3)=0.2 .
Module-4
Q. No 7 a. For the systematic (7, 4) linear block code. Calculate
(i) The Valid code vectors for the parity matrix [P] given below.
[P]=[ ]
336
Model Question Paper 2
[G]=[ ]
OR
Q.No 8a. Consider (15, 11) cyclic code generated by g(x)=1+x+x4.
(i) Device a feedback registers encoder for this code.
(ii) Illustrate the encoding procedure with message vector 11001101011 by listing
the states of the register.
(8 Marks)
b. For n 7, identify (n, k) values of the cyclic codes generated by the following
generator polynomials.
(i) g(x)=1+x2+x3
(ii) g(x)=1+x+x2+x4
(iii) g(x)=1+x2+x3+x4
(8 Marks)
Module-5
Q. No 9 a. Write a note on Galois field, RS code and BCH code.
(4 Marks)
b. Consider the binary convolution encoder shown in fig. Q 9(b). Draw the state table,
state transition table, state diagram and the corresponding code tree. Using the
code tree, find the encoded sequence for the message (1 0 1 1 1). Verify the output
sequence so obtained using the transform domain approach.
(12 Marks)
337
Model Question Paper 2
Fig. Q 9(b)
OR
Q.No 10a. Consider the (3, 1, 2) convolution encoder with g(1)=(1 1 0), g(2)=(1 0 1) and
g(3)=(1 1 1).
338
INDEX Digital communication
Discrete channel
Discrete communication channels
A Discrete memory less source
Average rate of information
Average information content per symbol E
Average amount of information per symbol
Efficiency of channel
Arithmetic coding
Encoding cyclic codes
Algorithm
Ensemble
Algebraic description of cyclic codes
Entropy
Automatic Repeat request
Equally likely events
Euclidean distance
B EXOR Operation
Binary symmetric channel (BSC) Equivocation
Binary Erasure Channel (BEC) Error control coding
Block codes Extended Huffman coding
Bose -Chaudhuri-Hocquenghen (BCH) codes
Branch Metric F
Burst Errors
Fixed length coding
Burst Error correction Capability
Factorial
Baye’s rule
Finite field
Binary code
Fixed length coding
Binary encoder
Binary Golay codes
G
Bir error rate (BER)
Generator
Galois field
C Generator sequence
Channel Capacity
Generator matrix
Convolution Encoder
Generator polynomial
Channel Diagram
Golay codes
Channel Transition Probability
Codeword H
Channel matrix Hamming codes
Continuous channel Hamming bound
Communication system Hamming distance
Convolution encoding Hamming weight
Constraint length Huffman codes
Cyclic codes
Code tree
I
Code vectors
Identity element
Compression
Information channels
Information rate
D Information source
Decoding of Convolution code Instantaneous codes
Division of code tree Information conveyed by event
339
Index
Information redundancy O
Irreducible polynomial Optimal codes
Outcome
J Operator
Joint Probabilities Output symbol probabilities
Joint probability
Joint occurrence of events P
Joint Probability Matrix Parity bits
Parity check matrix
K Periodic channel
K-bit message symbol Properties of probability
Kraft-McMillan inequality Perfect codes
Posteriori entropy
L Prefix codes
Lempel –Ziv algorithm Primitive element
Linear block codes Probability of an event
Lower bound entropy Probability of errors in the channel
Lempel –Ziv-Welsh algorithm Product codes
Linear feednack shift registers
Linearly independent vectors Q
Lossless compression Q-array BCH codes
Lossy compression
Lossy compression algorithms R
Reed Solomon (RS) codes
M Redundancy of the source
Markoff model Relative entropy
Markoff source
Maximum average information S
Multiplicative Inverse Self Information
Maximum entropy Shannon-Fano Algorithm
Minimum Hamming distance Shannon- Hartley Theorem
Muroga’s theorem Shannon- channel coding theorem
Mutual information Shannon first encoding theorem
Memory element Shifting register
Signal to noise ratio
N Source coding theorem
‘n’ bit codeword Source efficiency
(n-k) dimensional subspace Source encoder
noise matrix Source entropy
non-singular codes State transition table
non-systematic cyclic codes State diagram
nth order extension of source Symbol probability
nth order Markoff source Surviving path
Syndrome calculation
Second order extension of source
340
Index
T
Tail of the tree
Time domain approach
Transform domain approach
Trellis diagram
Turbo codes
U
Upper bound entropy
Uncertainty
Uniquely decodable codes
Units
Uniform distribution
V
Valid codewords
Variance
Viterbi algorithm
Vectors
Viterbi decoder
X
XOR operation
Z
Zero memory sources
Zero memory source extension
341