ITC Lectures Merged
ITC Lectures Merged
Coding
06/29/2023 2
1. All notices and related study materials will be shared via CMS only, and thus
you need to register in CMS.
06/29/2023 4
• Source Coding
• Channel Coding
• Cryptography
06/29/2023 5
Reference Books:
06/29/2023 7
06/29/2023 8
Takeaways:
The length of the sentence is not related to information content.
The Uncertainty of an event (probability of occurrence)
enhances information content.
If the output is exactly known, there is no need for
transmitting information.
06/29/202 9
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Uncertainty and Information
06/29/202 10
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Why Logarithm?
Example 1
Consider a binary source which tosses a fair coin and produces an
output equal to 1 if a head appears and a 0 if a tail appears.
Indeed, we have to use only one bit to represent the output from this
binary source (say, we use a 1 to represent a Head & 0 to represent
a Tail)
06/29/202 11
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Why Logarithm?
Example 1
• Now, let us say that the successive outputs from this binary
source is statistically independent (source is memoryless).
• If we consider m binary digits. We have 2m possible and
equiprobable m-bit blocks.
• Thus the probability of each block pattern is 2 -m
I(x ) = -log2P(x ) = -log2 2 -m = m
i i
06/29/202 12
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Why Logarithm?
Example 2
• Now, consider a source C which is a combination of two binary
sources A and B.
• The possible outputs are therefore equiprobable {00, 01, 10, 11}.
• P(C) = P(A)P(B) = 0.5 * 0.5 = 0.25
• Intuitively, the information content of the aggregate source C
should be the sum of the information content of independent
sources A and B. Recall from previous example.
06/29/202 13
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Why Logarithm?
Takeaway
Independent Event => Probabilities Multiply
Independent Sources => Information should add up
06/29/202 14
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Mutual Information
06/29/202 15
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Mutual Information
• Let us look at the two extreme situations
• X and Y are independent -> In this case, the occurrence of
provides no information about .
• X and Y are fully dependent -> In which case the occurrence of
determines the occurrence of the event
• A possible measure
• Simplifying
06/29/202 16
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Mutual Information
• We call the log of this measure as mutual information.
• Mutual information
• =
• When X and Y are statistically independent
=0
• When occurrence of Y = yj uniquely identifies X = xi ;
=1
• Therefore,
06/29/202 17
3
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Mutual Information
06/29/2023 18
06/29/2023 19
Similarly,
06/29/2023 20
• If p = 0.5
What if p = 1?
06/29/2023 21
06/29/2023 22
06/29/2023 23
Back to example
• If p = 0.1
• If p = 0.9
• If p = 1
06/29/2023 24
06/29/2023 25
06/29/2023 26
06/29/2023 27
06/29/2023 28
06/29/2023 30
Example
• Consider a discrete binary source that emits a sequence of
statistically independent symbols. The output is either 0 with
probability p or 1 with probability ).
06/29/2023 31
Example
• The entropy of the source
is maximum when p = 0.5,
i.e., both 1 and zero are
equally likely.
• Find this by principles of
Maxima/minima.
06/29/2023 32
06/29/2023 33
06/29/2023 34
Generalizing
𝑡 1 𝑓 ( 𝑥 1 )+𝑡 2 𝑓 ( 𝑥 2 )+ … 𝑡 𝑛 𝑓 ( 𝑥 𝑛 ) ≥ 𝑓 (𝑡 1 𝑥1 +𝑡 2 𝑥2 +… 𝑡 𝑛 𝑥 𝑛 )
𝑡𝑖 = 𝑃 ( 𝑋 = 𝑥 𝑖 )
𝐸[ 𝑓 ( 𝑋)]≥ 𝑓 (𝐸 [ 𝑋 ])
is convex
06/29/2023 35
( )
𝑛 𝑚
P(𝑥𝑖, 𝑦𝑗)
𝐼 (𝑋 ;𝑌 )=∑ ∑ P(𝑥𝑖, 𝑦 𝑗)𝑙𝑜𝑔
𝑖=1 𝑗=1 P(𝑥 𝑖) P( 𝑦 𝑗)
( )
𝑛 𝑚
P(𝑥𝑖)P( 𝑦 𝑗)
¿− ∑ ∑ P(𝑥𝑖, 𝑦 𝑗)𝑙𝑜𝑔
𝑖=1 𝑗=1 P(𝑥𝑖, 𝑦𝑗)
( ( )
𝑛 𝑚
P(𝑥𝑖)P(𝑦 𝑗)
≥−𝑙𝑜𝑔 ∑ ∑ P(𝑥𝑖, 𝑦 𝑗)
𝑖=1 𝑗=1 P(𝑥 𝑖, 𝑦𝑗)
(∑ )
𝑛 𝑚
¿−𝑙𝑜𝑔 P(𝑥𝑖)∑ P( 𝑦 𝑗)
𝑖=1 𝑗=1
¿ −𝑙𝑜𝑔 ( 1 )
¿0
06/29/2023 36
• Since
• Which means that X and Y are independent.
• Since is the average amount of uncertainty in X after we observe
Y and is the average amount of uncertainty of X, is the average
amount of uncertainty about X having observed Y.
• Since , the observation of Y does not increase the entropy. It can
only decrease entropy. Meaning, observing Y cannot reduce
information about X, it can only add information.
06/29/2023 37
06/29/2023 38
06/29/2023 40
06/29/2023 41
06/29/2023 42
Example
• Suppose we have only eight alphabets of the English letter (A-H),
then the FLC would be
06/29/2023 43
Example
• An example variable length code could be
06/29/2023 44
Example
• Suppose we want to have code for the sequence A BAD CAB,
the fixed length and the variable length code representation
would be.
06/29/2023 45
Example
• Let us look into another variable code sequence
06/29/2023 46
Example
• However there is a problem with VLC2.
• Consider the sequence of bits 0 1001 0001 which is used to
represent A BAD CAB in the second variable length coding
scheme.
• We could regroup the bits in a different manner to have [0] [10]
[0][1] [0][0][01] which A EAB AAD.
• We can also group the [0] [1][0][0][1] [0][0][0][1] which gives A
BAAB AAB.
• This problem is not present in VLC1, as no codeword form the
prefix of another codeword. (Prefix Condition)
06/29/2023 47
06/29/2023 48
Example
• Code 0, 01, 011, 111 for the symbols s1, s2, s3, s4, respectively is
not instantaneous (although it is uniquely decodable).
• To see this, consider the bit stream 011111 · · · 1.
• We can’t tell if the first symbol is s1, s2, or s3, although it’s clear
that after this first symbol we have a sequence of s4’s. Once we
see the last 1, we can then work backwards to eventually find out
what was the first symbol.
06/29/2023 49
06/29/2023 50
06/29/2023 51
06/29/2023 52
06/29/2023 54
06/29/2023 55
06/29/2023 56
06/29/2023 57
06/29/2023 58
06/29/2023 59
06/29/2023 60
06/29/2023 61
06/29/2023 62
06/29/2023 63
06/29/2023 64
06/29/2023 65
06/29/2023 66
06/29/2023 67
06/29/2023 68
06/29/2023 69
06/29/2023 70
It uses the Cumulative Distribution Function to allocate the codewords. The Cumulative
distribution function is defined as
06/29/2023 71
06/29/2023 72
The entropy for this distribution is 1.75 bits. However, the average codeword length
for the Shannon-Fano-Elias coding is 2.75 bits.
06/29/2023 73
06/29/2023 74
06/29/2023 75
Example
Let our alphabet consists of only three symbols A, B and C with probabilities of
occurrence P(A) = 0.5, P(B) = 0.25, P(C) = 0.25. Suppose we are sending symbols
stream B A C A … Thus, the variable A corresponds [0, 0.5), B corresponds to [0.5,
0.75), C corresponds to [0.75,1).
06/29/2023 76
06/29/2023 77
06/29/2023 78
06/29/2023 79
06/29/2023 80
06/29/2023 82
06/29/2023 83
06/29/2023 84
06/29/2023 85
06/29/2023 86
06/29/2023 88
06/29/2023 89
06/29/2023 90
06/29/2023 91
06/29/2023 92
Where and
06/29/2023 93
06/29/2023 94
06/29/2023 95
06/29/2023 96
06/29/2023 97
06/29/2023 98
The units of channel capacity is bits per channel use (provided the base of the
logarithm is 2). If the base of the logarithm is e, the units of capacity is in nats
per channel use (coming from the use of natural logarithm).
06/29/2023 99
06/29/2023 100
06/29/2023 101
06/29/2023 102
06/29/2023 103
06/29/2023 104
06/29/2023 105
06/29/2023 106
06/29/2023 107
06/29/2023 108
06/29/2023 109
06/29/2023 110
06/29/2023 111
06/29/2023 112
Observations
• As code rate decreases, there is a steep fall in the probability
of error (Pe).
• The decrease in Pe, is much more rapid than the decrease in
code rate.
• Hence, repetition code exchanges code rate for message
reliability.
• However, for repetition codes, code rate tends to zero, if we
want Pe to be tending to zero.
• Channel coding Theorem just states that code rate has to be
less than the channel capacity C.
• Finding a code is a challenge.
06/29/2023 113
06/29/2023 114
06/29/2023 115
06/29/2023 116
06/29/2023 117
06/29/2023 118
06/29/2023 119
If
06/29/2023 120
06/29/2023 121
06/29/2023 122
06/29/2023 124
06/29/2023 125
06/29/2023 127
06/29/2023 128
06/29/2023 129
06/29/2023 130
06/29/2023 131
06/29/2023 132
06/29/2023 133
06/29/2023 134
06/29/2023 135