Cse3086 Itc Notes 30 Oct
Cse3086 Itc Notes 30 Oct
Page 1
INDEX SHEET
Sl
No. Unit & Topic of Discussion PAGENO.
1 Introduction 5
2 Measure of information 5
Average information content of symbols in long independent 8
3 Sequences
Average information content of symbols in long dependent 9
4 Sequences
5 Mark-off statistical model for information source, 11
6 Entropy and information rate of mark-off source. 19
7 Review questions 27
SOURCE CODING 29
8
9 Encoding of the source output 30
10 Shannon‟s encoding algorithm 31
11 Communication Channels 44
12 Discrete communication channels 45
13 Review questions 73
14 FUNDAMENTAL LIMITS ON PERFORMANCE 74
15 Source coding theorem 75
16 Huffman coding 75
17 Discrete memory less Channels 81
18 Mutual information 88
19 Channel Capacity 90
20 Review questions 110
21 Continuous Channel 112
Differential entropy and mutual information for continuous 119
22 Ensembles
23 Channel capacity Theorem 121
24 Review questions 129
25 INTRODUCTION TO ERROR CONTROL CODING 130
26 Introduction 131
27 Types of errors 133
28 Types of codes 133
29 Linear Block Codes: Matrix description. 136
30 Error detection and correction 146
31 Standard arrays and table look up for decoding 149
Page 2
32 Hamming codes 153
33 Review questions 155
34 Binary Cyclic Codes 157
35 Algebraic structures of cyclic codes 167
36 Encoding using an (n-k) bit shift register, 171
37 Syndrome calculation. 178
38 BCH codes 181
39 Review questions 182
40 Introduction 184
41 Golay codes and Shortened cyclic codes 188
42 R S codes 189
43 Burst error correcting codes 189
44 Burst and Random Error correcting codes 191
45 Review questions 196
46 Convolution Codes 198
47 Time domain approach 200
48 Transform domain approach. 206
49 Review questions 216
Page 3
Information Theory and Coding
PART A
Unit – 1: Information Theory
Syllabus:
Introduction, Measure of information, Average information content of symbols in long
independent sequences, Average information content of symbols in long dependent
sequences. Mark-off statistical model for information source, Entropy and information rate of
mark-off source. 6 Hours
Text Books:
• Digital and analog communication systems, K. Sam Shanmugam, John Wiley,
1996.
Reference Books:
• Digital Communications - Glover and Grant; Pearson Ed. 2nd Ed 2008
Page 4
Unit – 1: Information Theory
1.1 Introduction:
• Communication
Communication involves explicitly the transmission of information from one point to another,
through a succession of processes.
• Basic elements to every communication system
o Transmitter
o Channel and
o Receiver
Communication System
Source User
of Transmitter CHANNEL Receiver of
information information
INFORMATION
SOURCE
ANALOG DISCRETE
• Source definition
Analog : Emit a continuous – amplitude, continuous – time electrical wave
from. Discrete : Emit a sequence of letters of symbols.
The output of a discrete information source is a string or sequence of symbols.
1.2 Measure the information:
To measure the information content of a message quantitatively, we are required to arrive at
an intuitive concept of the amount of information.
Consider the following examples:
A trip to Mercara (Coorg) in the winter time during evening hours,
1. It is a cold day
2. It is a cloudy day
3. Possible snow flurries
Page 5
Amount of information received is obviously different for these messages.
o Message (1) Contains very little information since the weather in coorg is „cold‟ for most
part of the time during winter season.
o The forecast of „cloudy day‟ contains more informat ion, since it is not an event that
occurs often.
o In contrast, the forecast of „snow flurries‟ convey s even more information, since the
occurrence of snow in coorg is a rare event.
On an intuitive basis, then with a knowledge of the occurrence of an event, what can be said
about the amount of information conveyed?
It is related to the probability of occurrence of the event.
What do you conclude from the above example with regard to quantity of information?
Message associated with an event „least likely to occur‟ contains most information. The
information content of a message can be expressed quantitatively as follows:
The above concepts can now be formed interns of probabilities as follows:
Say that, an information source emits one of „q‟ po ssible messages m1, m2 …… m q with p1, p2 ……
pq as their probs. of occurrence.
th
Based on the above intusion, the information content of the k message, can be written as
I (mk) a 1
pk
Also to satisfy the intuitive concept, of information.
I (mk) must zero as pk 1
Therefore,
Another requirement is that when two independent messages are received, the total
information content is –
Sum of the information conveyed by each of the messages.
Thus, we have
I (mk & mq) I (mk & mq) = Imk + Imq ------ I
\ We can define a measure of information as –
1
------ III
p
Page 6
Unit of information measure
Base of the logarithm will determine the unit assigned to the information content.
Natural logarithm base : „nat‟
Base - 10 : Hartley / decit
Base - 2 : bit
Use of binary digit as the unit of information?
Is based on the fact that if two possible binary digits occur with equal proby (p1 = p2 =
½) then the correct identification of the binary digit conveys an amount of information.
I (m1) = I (m2) = – log 2 (½ ) = 1 bit
\ One bit is the amount if information that we gain when one of two possible and equally
likely events occurs.
Illustrative Example
A source puts out one of five possible messages during each message interval. The probs. of
these messages are p1 = 1 ; p2 = 1 ; p1 = 1 : p1 = 1 , p5 1
2 4 4 16 16
What is the information content of these messages?
1
I (m1) = - log2 = 1 bit
2
1
I (m2) = - log2 = 2 bits
4
1
I (m3) = - log = 3 bits
8
1
I (m4) = - log2 = 4 bits
16
1
I (m5) = - log2 = 4 bits
16
Page 7
Digital Communication System:
Estimate of the
Source of Message signal Message signal User of
Source Source
Receiver
Transmitter Encoder decoder
Source
code word source codeword
Channel
decoder
Channel of
code word channel codeword
Modulator Demodulator
Received
Channel signal
Page 8
M symbols of the source alphabet
M 1
bits
pi
i.e., Itotal = ∑NP1 log
i =1
I
\ Averageinforamtion content total M 1 bits per
H= ---- IV
= ∑ N P 1 lo g
p
per symbol in given by N i =1 i symbol
This is equation used by Shannon
Average information content per symbol is also called the source entropy.
1.4 The average information associated with an extremely unlikely message, with an extremely
likely message and the dependence of H on the probabilities of messages
consider the situation where you have just two messages of probs. „p‟ and „(1-p)‟.
1 1
Average information per message is H = p log + (1 - p) log
p 1-p
At p = O, H = O and at p = 1, H = O again,
The maximum value of „H‟ can be easily obtained as,
H = ½ log 2 + ½ log 2 = log 2 = 1
max 2 2 2
The above observation can be generalized for a source with an alphabet of M symbols.
Entropy will attain its maximum value, when the symbol probabilities are equal,
1
Hmax = ∑p M log
pM
Hmax = ∑p M log
1
1
M
Page 9
1
\ Hmax = ∑ M log 2 M = log 2 M
• Information rate
If the source is emitting symbols at a fixed rate of „‟r s‟ symbols / sec, the average source
information rate „R‟ is defined as –
R = rs . H bits / sec
• Illustrative Examples
1. Consider a discrete memoryless source with a source alphabet A = { so, s1, s2} with
respective probs. p0 = ¼, p1 = ¼, p2 = ½. Find the entropy of the source.
Solution: By definition, the entropy of a source is given by
M
1
H = ∑ pi log bits/ symbol
i =1 pi
Page 10
H = 1 log 8 + 3 log 8 + 3 log 8 +1 log 8
8 8 3 8 3 8
= 1.8 bits/ message.
3. Compute the values of H and R, if in the above example, the quantities levels are so chosen
that they are equally likely to occur,
Solution:
Average information per message is
H = 4 (¼ log 4) = 2 bits/message
2
A statistical model of a system that produces a sequence of symbols stated above is and which
is governed by a set of probs. is known as a random process.
i.e. A random process that produces a discrete sequence of symbols chosen from a finite set
may be considered as a discrete source.
Provides a statistical model for the symbol sequences emitted by a discrete source.
1. At the beginning of each symbol interval, the source will be in the one of „n‟ possible states 1, 2,
….. n
Page 11
m
n ≤ (M)
„m‟ symbols.
The source changes state once during each symbol interval from say i to j. The probabilityy of
this transition is Pij. Pij depends only on the initial state i and the final state j but does not depend on
the states during any of the preceeding symbol intervals.
Symbol emitted depends on the initial state i and the transition ij.
3. Let s1, s2, ….. s M be the symbols of the alphabet, and let x1, x2, x3, …… x k,…… be a sequence of
th
random variables, where xk represents the k symbol in a sequence emitted by the source.
th
Then, the probability that the k symbol emitted is sq will depend on the previous
symbols x1, x2, x3, …………, x k–1 emitted by the source.
When Sk in a discrete random variable representing the state of the system at the beginning of the
th
k interval.
Term „states‟ is used to remember past history or residual influence in the same context as the use
of state variables in system theory / states in sequential logic circuits.
System Analysis with regard to Markoff sources
Representation of Discrete Stationary Markoff sources:
o Are represented in a graph form with the nodes in the graph to represent states and the
transition between states by a directed line from the initial to the final state.
Page 12
o Transition probs. and the symbols emitted corresponding to the transition will be shown
marked along the lines of the graph.
A typical example for such a source is given below.
½
1
C P1(1) = /3
1
P2(1) = /3
1
P3(1) = /3
¼
C ¼
C
A B
¼ ¼
¼
B 3
1 B ½
½ A A
¼
To state 2
A 1 C ¼ To state 3
½ B
State transition and symbol generation can also be illustrated using a tree diagram.
Tree diagram
• Tree diagram is a planar graph where the nodes correspond to states and branches
correspond to transitions. Transitions between states occur once every Ts seconds.
Along the branches of the tree, the transition probabilities and symbols emitted will be
indicated.Tree diagram for the source considered
Page 13
Symbol
probs. Symbols Symbol
A 1 AA
emitted ½ sequence
¼ C 2 AC
1
A ¼ B
3 AB
1 ½ A 1 CA
/3 1 C
¼ C
2 2 CC
B
3 CB
¼ A 1 BA
B C
3 2 BC
B
3 BB
1
1 C 2 AC
B
3 AB
¼
1 1 CA
/3 C C
½ 2 2 CC
B
3 CB
¼
1 BA
B
3 2 BC
B
3 BB
1 AA
1 2 AC
B
¼ 3 AB
1 CA
1
/3 2 CC
B
Initial 3 CB
state ½
1 BA
3 2 BC
B
3 BB
State at the end of the State at the end of the
first symbol internal second symbol internal
Page 14
Use of the tree diagram
Tree diagram can be used to obtain the probabilities of generating various symbol sequences.
1 2 3
OR
2 1 3
OR
3 1 3
Therefore proby of the source emitting the two – s ymbol sequence AB is given by
P(AB) = P ( S1 = 1, S2 = 1, S3 =3)
Or
P ( S1 = 2, S2 = 1, S3 = 3 ) ---------- (1)
Or
P ( S1 = 3, S2 = 1, S3 = 3 )
Therefore P (AB) = P ( S1 = 1, S2 = 1, S3 = 3 ) + P ( S1 = 2, S2 = 1, S3 = 3 )
+ P ( S1 = 2, S2 = 1, S3 = 3 ) ------------- (2)
The first term on the RHS of the equation (2) can be written as
P ( S1 = 2, S2 = 1, S3 = 3 )
= P ( S1 = 1) P (S2 = 1 / S1 = 1) P (S3 = 3 / S1 = 1, S2 = 1)
= P ( S1 = 1) P (S2 = 1 / S1= 1) P (S3 = 3 / S2 = 1)
Page 15
Recall the Markoff property.
Transition probability to S3 depends on S2 but not on how the system got to S2.
1
Therefore, P (S1 = 1, S2 = 1, S3 = 3 ) = /3 x ½ x ¼
1 1 1 4 1
Therefore P (AB) = /3 x ½ x ¼ + /3 x ¼ x ¼ + /3 x ¼ x ¼ = =
48 12
Illustrative Example:
1. For the information source given draw the tree diagram and find the probs. of messages of lengths
1, 2 and 3.
¼
C
A 1 C 2 B3 /4
3
/ ¼
p1 = ½ P2 = ½
Tree diagram for the source outputs can be easily drawn as shown.
Page 16
AAA
AAC
ACC
3
/4 ACB
½ 1
CCA
¼ C CCC
CBC
3
B /4 CBB
CAA
CAC
CCC
3
/4 CCB
½ 2
BCA
¾ C BCC
BBC
3
/4 BBB
Page 17
Information Theory and Coding
Page 18
• A second order Markoff source
Model shown is an example of a source where the probability of occurrence of a symbol
depends not only on the particular symbol in question, but also on the two symbols proceeding it.
2
P1 (1)
/8 1/
18
2 7
3
(AA) / (AA) P2 (1)
18
B 3 7/ 8 7
/4 P3 (1)
(BB) 18
1 2
(AB) 4 1 3 /8 P4 (1)
B 18
m
No. of states: n ≤ (M) ;
2
4≤M
\M=2
Say the system in the state 3 at the beginning of the symbols emitted by the source were BA.
The probability of going from state i to j also doesn‟t depend on time, Entropy of state „i‟ is
defined as the average information content of the symbols emitted from the i-th state.
n
1
Hi = ∑ pij log2 bits / symbol -------------- (1)
p
j =1 ij
Entropy of the source is defined as the average of the entropy of each state.
n
Where,
Pi = the proby that the source is in state „i'.
Using eqn (1), eqn. (2) becomes,
Page 19
n n
H = ∑ pi ∑ pij log 1 bits / symbol -------------- (3)
p
ij
i =1 j =1
Page 20
As per the outcome of the previous session we have
Page 21
By definition Hi is given by
H =np 1
i ∑ log
ij
p ij
j=1
Put i = 1,
=n= 2 p 1
Hi ∑ 1j log
p
j=1 1j
p log 1 + p log 1
11 p 12 p
11 12
H = ∑pi Hi = ∑pi Hi
i =1 i=1
= 1 (0.8113) + 1 (0.8113)
2 2
= (0.8113) bits / symbol
To calculate the average information content per symbol in messages containing two symbols.
• How many messages of length (2) are present? And what is the information content of these
messages?
There are seven such messages and their information content is:
1 1
= log
(BB
I (AA) = I (BB) = log ( AA) )
1 = 1.83 bits
i.e., I (AA) = I (BB) = (9 /
log 32)
Similarly calculate for
other messages and
verify that they are
=
3
.
4
1
I (BB) = I (AC) = log 1 5
Page 22
b
i
t
s
(3 /
32)
I (CB) = I (CA) =
Page 23
I (CC) = log = 1 = 4 bits
P(2 / 32)
Thus, we have
7
= ∑Pi . Ii
i= 1
Where Ii = the I‟s calculated above for different messages of length two
• Computation of the average information content per symbol in messages containing two
symbols using the relation.
Page 24
G1 > G2 > G3 > H
• Statement
It can be stated that the average information per symbol in the message reduces as the length of
the message increases.
• The generalized form of the above statement
If P (mi) is the probability of a sequence mi of ‘N’ symbols form the source with the average
information content per symbol in the messages of N symbols defined by
- ∑P(mi ) log P(mi )
i
GN = N
Where the sum is over all sequences mi containing N symbols, then GN is a monotonic decreasing
function of N and in the limiting case it becomes.
¼C ¼
C
A B
¼
¼
Page 25
For the Mark off source shown, calculate the information rate.
½
½ S ½
S S 3 R 1
L 1 L 2 R /2
½ ¼ ¼
p1 = ¼ P2 = ½ P3 = ¼
Solution:
By definition, the average information rate for the source is given by
R = ------------------------------------------------
rs . H bits/sec (1)
Where, rs is the symbol rate of the source
And H is the entropy of the source.
To compute H
Calculate the entropy of each state using,
n
= p 1bits/ sym ------------------------ (2)
Hi ∑ log
p
iJ
j=1 ij
Put i = 1
\H = 3
i ∑p 1j log p1 j
j=1
H2 = - ∑p 2 j log p 2 j
j=1
i.e., H2 = - [p21 log p21 + p22 log p22 + p23 log p23 ]
Substituting the values given we get,
Page 26
1 1 1 1 1 1
log + log + log
H2 =-
4 4 2 2 4 4
1 1 1
=+ log 4 + log 2 + log 4
4 2 4
1 1
= log 2 + + log 4
22
\ H2 = 1.5 bits/symbol
With Hi computed you can now compute H, the source entropy, using.
H= 3
∑ Pi Hi
i= 1
= p1 H1 + p2 H2 + p3 H3
Substituting the values we get,
1 1 1
H= x1+ x 1.5 + x1
4 2 4
1 1.5 1
= + +
4 2 4
1 1.5 2.5
= + = = 1.25 bits / symbol
2 2 2
\ H = 1.25 bits/symbol
Page 27
Review questions:
(1) Explain the terms (i) Self information (ii) Average information (iii) Mutual Information.
(2) Discuss the reason for using logarithmic measure for measuring the amount of information.
(3) Explain the concept of amount of information associated with message. Also explain what
infinite information is and zero information.
(4) A binary source emitting an independent sequence of 0‟s and 1‟s with pro babilities p and (1-
p) respectively. Plot the entropy of the source.
(5) Explain the concept of information, average information, information rate and redundancy as
referred to information transmission.
(6) Let X represents the outcome of a single roll of a fair dice. What is the entropy of X?
(7) A code is composed of dots and dashes. Assume that the dash is 3 times as long as the dot and
has one-third the probability of occurrence. (i) Calculate the information in dot and that in a
dash; (ii) Calculate the average information in dot-dash code; and (iii) Assume that a dot lasts
for 10 ms and this same time interval is allowed between symbols. Calculate the average rate
of information transmission.
(8) What do you understand by the term extension of a discrete memory less source? Show that
the entropy of the nth extension of a DMS is n times the entropy of the original source.
(9) A card is drawn from a deck of playing cards. A) You are informed that the card you draw is
spade. How much information did you receive in bits? B) How much information did you
receive if you are told that the card you drew is an ace? C) How much information did you
receive if you are told that the card you drew is an ace of spades? Is the information content of
the message “ace of spades” the sum of the information contents of the messages ”spade” and
“ace”?
(10) A block and white TV picture consists of 525 lines of picture information. Assume that each
consists of 525 picture elements and that each element can have 256 brightness levels.
Pictures are repeated the rate of 30/sec. Calculate the average rate of information conveyed by
a TV set to a viewer.
(11) A zero memory source has a source alphabet S= {S1, S2, S3} with P= {1/2, 1/4, 1/4}. Find
the2 entropy of the source. Also determine the entropy of its second extension and verify that H
(S ) = 2H(S).
(12) Show that the entropy is maximum when source transmits symbols with equal probability.
Plot the entropy of this source versus p (0<p<1).
(13) The output of an information source consists OF 128 symbols, 16 of which occurs with
probability of 1/32 and remaining 112 occur with a probability of 1/224. The source emits
1000 symbols/sec. assuming that the symbols are chosen independently; find the rate of
information of the source.
3 BB
A 1 AA
C
Page 28
Syllabus:
Encoding of the source output, Shannon‟s encoding algorithm. Communication Channels,
Discrete communication channels, Continuous channels.
Text Books:
• Digital and analog communication systems, K. Sam Shanmugam, John Wiley,
1996.
Reference Books:
• Digital Communications - Glover and Grant; Pearson Ed. 2nd Ed 2008
Page 29
2.1 Encoding of the Source Output:
• Need for encoding
N
Suppose that, M – messages = 2 , which are equally likely to occur. Then recall that average
information per messages interval in H = N.
Say further that each message is coded into N bits,
H
\ Average information carried by an individual bit is = = 1 bit
N
If the messages are not equally likely, then „H‟ will be les s than „N‟ and each bit will carry
less than one bit of information.
• Is it possible to improve the situation?
Yes, by using a code in which not all messages are encoded into the same number of bits. The
more likely a message is, the fewer the number of bits that should be used in its code word.
• Source encoding
Process by which the output of an information source is converted into a binary sequence.
Symbol sequence
emitted by the Input Source Output : a binary sequence
information source Encoder
N ®¥ GN = H bits / symbol
Performance measuring factor for the encoder
Coding efficiency: ηc
ηc = H(S)
Page 30
2.2 Shannon’s Encoding Algorithm:
• Formulation of the design of the source encoder
Can be formulated as follows:
possible
messages
A unique binary
INPUT code word „c i‟ of
A message encoder length „n i‟ bits for
the message „m i‟
ni : an integer
• The objective of the designer
^
To find „n i‟ and „c i‟ for i = 1, 2, .... , q such that the average number of bits per symbol H N
used in the coding scheme is as close to GN as possible.
q
Where, H ^ = 1 ∑n p i i
N
N
i =1
1
q 1
and GN = ∑pi log
N
i =1 pi
i.e., the objective is to have
as closely as possible
Page 31
i-1
The codeword for the message ‘mi’ is the binary fraction expansion of Fi upto „ ni’ bits.
Step 5: Design of the encoder can be completed by repeating the above steps for all the messages of
block length chosen.
• Illustrative Example
Design of source encoder for the information source given,
¼
C
A 1 C 2 B3 /4
3
/ ¼
p1 = ½ P2 = ½
Compare the average output bit rate and efficiency of the coder for N = 1, 2 & 3.
Solution:
The value of „N‟ is to be specified.
Case – I: Say N = 3 ß Block size
Step 1: Write the tree diagram and get the symbol sequence of length = 3.
Tree diagram for illustrative example – (1) of session (3)
Page 32
A¾ 1 AAA
C ¼ 2 AAC
1 C ¼ 1 ACC
C ¼ 3
B /4 2 ACB
½
A ¾ 1 CCA
¼ 1
¼ C ¼ 2 CCC
2 C ¼ 1 CBC
B 2 3
B /4 2 CBB
A¾ 1 CAA
C ¼ 2 CAC
1 C ¼ 1 CCC
C ¼ 3
¼ B /4 2 CCB
½
1 BCA
B ¼ 1
¾ C C ¼ 2 BCC
2 C ¼ 1 BBC
2 3
/4 2 BBB
From the previous session we know that the source emits fifteen (15) distinct three symbol messages.
They are listed below:
Messages AAA AAC ACC ACB BBB BBC BCC BCA CCA CCB CCC CBC CAC CBB
CAA
Probability 27 9 3 9 27 9 3 9 3 3 2 3 3 9 9
128128 128 128 128 128 128 128 128 128 128 128 128 128 128
Page 33
i.e., 2.245 < n1 < 3.245
Step 4: Generate the codeword using the binary fraction expansion of Fi defined as
i- 1
Fi = ∑p k ; with F1 = 0
k =1
Step 6: Repeat the above steps and complete the design of the encoder for other messages listed above.
Page 34
3
CBC 108/128 6 110110 110110
128
3
CAC 128 111/128 6 1101111 110111
3
j =1 ij
Page 35
3 1 1 1
H1 = 4x log(3 / 4) +4 log 1/ 4
3 4 1
= x log + log (4)
4 3 4
\ H1 = 0.8113
Substituting we get,
1 1 3 1
H2 = x log + log
4 (1/ 4) 4 3/4
1 3 4
= x log (4)+ log
4 4 3
H2 = 0.8113
H = ∑pi Hi ;
j =1
th
Pi = Probability that the source is in the i state.
2
H = ∑ pi H i ; = p1H1 + p2H2
i =1
Page 36
• What is the efficiency of the encoder?
By definition we have
ηc= = H x 100 = H x 100 = 0.8113 x 100 = 62.4%
^ ^
H2 H3 1.3
Case – II
Say N = 2
The number of messages of length „two‟ and their probabilities (obtai ned from the tree diagram)
can be listed as shown in the table.
Given below
N=2
Message pi ni ci
AA 9/32 2 00
BB 9/32 2 01
AC 3/32 4 1001
CB 3/32 4 1010
BC 3/32 4 1100
CA 3/32 4 1101
CC 2/32 4 1111
^
Calculate H N and verify that it is 1.44 bits / sym.
\ Encoder efficiency for this case is
H
ηc = ^ x100 H
N
Page 37
^
H1 = 2 bits / symbol and
ηc = 40.56%
¼
C
A 1 C SOURCE
3
/4 ¼
p1 = ½ P2 = ½
INFORMN. SOURCE
Recall from the outcome of session (5) that for the source given possible three symbol
sequences and their corresponding code words are given by –
Message Codeword
ni
mi ci
AAA 3 000
BBB 3 001
CAA 4 0110
CBB 4 0111
BCA 4 1001 Determination of the
BBC 4 1010 code words and their
size as illustrated in
AAC the previous session
ACB 4 1100
CBC 6 110110
CAC 6 110111
CCB 6 111001
CCA 6 111010
BCC 6 111100
ACC 6 111101
Page 38
CCC 6 111111
Output of the encoder can be obtained by replacing successive groups of three input symbols by
the code words shown in the table. Input symbol string is
ACB
123
BCA
123
AAC
123
BBB
{
1100 1001 1011 011 ¬ Encoded version of the symbol string
II. If the encoder operates on two symbols at a time what is the output of the encoder for the
same symbol string?
Again recall from the previous session that for the source given, different two-symbol sequences
and their encoded bits are given by
N=2
Message No. of bits ci
mi ni
AA 2 00
BB 2 01
AC 4 1001
CB 4 1010
BC 4 1100
CA 4 1101
CC 4 1111
AC
{{{{{{
BB CA AA CB BB
100101110100 1010 01 ¬ Encoded message
DECODING
• How is decoding accomplished?
By starting at the left-most bit and making groups of bits with the codewords listed in the
table.
Case – I: N = 3
i) Take the first 3 – bit group viz 110 why?
ii) Check for a matching word in the table.
iii) If no match is obtained, then try the first 4-bit group 1100 and again check for the matching
word.
iv) On matching decode the group.
Page 39
NOTE: For this example, step (ii) is not satisfied and with step (iii) a match is found and the decoding
results in ACB.
Repeat this procedure beginning with the fifth bit to decode the remaining symbol groups.
Symbol string would be ACB BCA AAC BCA
Error bit
For the errorless bit string you have already seen that the decoded symbol string is
ACB BCA AAC BCA ----- (2)
(1) and (2) reveal the decoding problem with bit error.
Substituting we get,
H = - [p1 log p1 + p2 log p2 + p3 log p3 + p4 log p4 + p5 log p5 ]
= - [0.4 log 0.4 + 0.2 log 0.2 + 0.2 log 0.2 + 0.1 log 0.1 + 0.1 log 0.1]
Page 40
H = 2.12 bits/symbol
(ii) Some encoder with N = 2
Different two symbol sequences for the source are:
(s1s1) AA ( ) BB ( ) CC ( ) DD ( ) EE
(s1s2) AB ( ) BC ( ) CD ( ) DE ( ) ED
(s1s3) AC ( ) BD ( ) CE ( ) DC ( ) EC A total of 25 messages
(s1s4) AD ( ) BE ( ) CB ( ) DB ( ) EB
(s1s5) AE ( ) BA ( ) CA ( ) DA ( ) EA
Arrange the messages in decreasing order of probability and determine the number of bits „n i‟ as
explained.
Proby. No. of bits
Messages
pi ni
AA 0.16 3
AB 0.08
AC 0.08
BC 0.08 4
BA 0.08
CA 0.08
... 0.04
... 0.04
... 0.04
... 0.04 5
... 0.04
... 0.04
... 0.04
... 0.02
... 0.02
... 0.02
... 0.02
... 0.02 6
... 0.02
... 0.02
... 0.02
... 0.01
... 0.01
... 0.01 7
... 0.01
^
Calculate H1 =
^
Substituting, H1 = 2.36 bits/symbol
Page 41
groups. The messages in the first group are given the bit ‘O’ and the messages in the second
group are given the bit ‘1’. The procedure is now applied again for each group separately, and
continued until no further division is possible. Using this algorithm, find the code words for six
messages occurring with probabilities, 1/24, 1/12, 1/24, 1/6, 1/3, 1/3
m5 1/3 0 0
st
m6 1/3 0 1 ß 1 division
nd
m4 1/6 1 0 ß 2 division
m2 1/12 1 1 0
3rd
division
m1 1/24 1 1 1 0 th
ß 4 division
m3 1/24 1 1 1 1
m1 = 1110
m2 = 110
m3 = 1111
m4 = 10
m5 = 00
m6 = 01
Example (3)
a) For the source shown, design a source encoding scheme using block size of two
symbols and variable length code words
^
b) Calculate H 2 used by the encoder
c) If the source is emitting symbols at a rate of 1000 symbols per second, compute the
output bit rate of the encoder.
½
½ S ½
S S 3 R 1
L 1 L 2 R /2
½ ¼ ¼
p1 = ¼ P2 = ½ P3 = ¼
Page 42
Solution (a)
1. The tree diagram for the source is
½ 1 LL (1/16)
1
½ 2 LS (1/16)
¼
¼ 1
C ¼ 1
¼ 2 SL (1/32)
2 ½ 3 SS (1/16)
¼ SR (1/32)
½ 1 LL (1/16)
1 2 LS (1/16)
½ LL
¼ 1 SL (1/16)
½ ¼ LS
2 ½ 2 ½ 2 SS (1/8)
¼ 3 Different
¾ ½ (1/16) SS Messages
2 2 SR
of Length
½ 3 RS (1/8) Two
RS
¼ 1 SL (1/32) RR
2 2 SS (1/16)
½
¼ 3 SR (1/32)
½
¼ 3
C ½ 2 RS (1/16)
½
3
½ 3 RR (1/16)
2. Note, there are seven messages of length (2). They are SS, LL, LS, SL, SR, RS & RR.
3. Compute the message probabilities and arrange in descending order.
4. Compute ni, Fi. Fi (in binary) and ci as explained earlier and tabulate the results, with usual
notations.
Message
pi ni Fi Fi (binary) ci
mi
SS 1/4 2 0 .0000 00
LL 1/8 3 1/4 .0100 010
LS 1/8 3 3/8 .0110 011
SL 1/8 3 4/8 .1000 100
SR 1/8 3 5/8 .1010 101
RS 1/8 3 6/8 .1100 110
RR 1/8 3 7/8 .1110 111
Page 43
7
1 ∑- pi log 2 pi = 1.375 bits/symbol
G2 =
2 i -1
^ 7
1 pn
(b) H 2 = ∑ i i = 1.375 bits/symbol
2 i -1
^
1
Recall, H N ≤ GN + N ; Here N = 2
^
1
\ H 2 ≤ G2 +
2
(c) Rate = 1375 bits/sec.
Transmitter channel
• ‘Communication Channel’
Communication Channel carries different meanings and characterizations depending on its
terminal points and functionality.
Page 44
A discrete channel
• Is the output symbol in a symbol interval same as the input symbol during the same symbol
interval?
The discrete channel is completely modeled by a set of probabilities –
th
pit Probability that the input to the channel is the i symbol of the alphabet.
(i = 1, 2,.................. M)
and
th th
p ij Probability that the i symbol is received as the j symbol of the alphabet at the output of
the channel.
Page 45
Shown in Fig. – (2).
O P00 O
P10
Transmitted pij = p(Y = j / X=i)
Received t
p t = p(X = o); p1 P(X = 1)
digit X
digit X
P01 por = p(Y = o); p r P(Y = 1)
o 1
poo + po1 = 1 ; p11 + p10 = 1
1 p11 1
Fig. – (2)
• Its features
X & Y: random variables – binary valued
Input nodes are connected to the output nodes by four paths.
(i) Path on top of graph : Represents an input „O‟ appearing correctly
as „O‟ as the channel output.
Errors occur in a random fashion and the occurrence of errors can be statistically modelled
by assigning probabilities to the paths shown in figure (2).
t
Pe = p p01 + p t p10 ------ (1)
Page 46
r t t
po = po p00 + p1 . p10 , and
(2)
p1r = pot p01 + p1t p11
p11
1 1
p12 pit = p(X = i)
prj = p(Y = j)
2
p = p(Y = j / X = i)
ij
2
INPUT X OUTPUTY
j
pij
piM
M M
Fig. – (3)
This can be analysed on the same lines presented above for a binary channel.
M
p
P(error) = P e = ∑p it ∑ ij ----- (4)
i=1 j =1
j¹i
• In a DMC how many statistical processes are involved and which are they?
Two, (i) Input to the channel and
(ii) Noise
Page 47
• Definition of the different entropies for the DMC.
i) Entropy of INPUT X: H(X).
H(X) = - ∑p t log pi
i
( t ) bits / symbol ----- (5)
i= 1
H(XY) = - ∑ ∑p ( i, j) log p ( i, j)
i j
Page 48
i associated with variable X, white j with variable Y.
H(XY) = - ∑ ∑p ( i) p ( j / i) log [p ( i) p ( j / i) ]
ij
= -∑ ∑p ( i) p ( j / i) log p ( i) + ∑ ∑p ( i) p ( j / i) log p ( i)
ij
Say, „i‟ is held constant in the first summation of the first t erm on RHS, then we can write
H(XY) as
1. For the discrete channel model shown, find, the probability of error.
P(error) = 1 x (1 – p) + 1 (1 – p) = 1 -p +1 -p
2 2 2 2 2 2
\ P(error) = (1 – p)
Page 49
Y
P(Y/X)
0 1
0 2/3 1/3
X
1 1/3 2/3
If the input symbols are transmitted with probabilities ¾ & ¼ respectively, find H(X), H(Y),
H(XY), H(Y/X).
Solution:
Given = P(X = 0) = ¾ and P(Y = 1) ¼
i 4 3 4
Compute the probability of the output symbols.
x1 y1
x2 y2
p(Y = Y1) = p(X = X1, Y = Y1) + p(X = X2, Y = Y1) ------------ (1)
To evaluate this construct the p(XY) matrix using.
y1 y2
2 .3 1 . 3 x1 1 1
3 4 3 4 2 4
P(XY) = p(X) . p(Y/X) = = -----(2)
1 1 2 1 1 1
. . x
2
3 4 3 4 12 6
Page 50