SlideShare a Scribd company logo
1 of 64
Information Theory and Coding
System
PMSCS 676
Summer 2016
Prof. Dr. Md. Imdadul Islam
www.juniv.edu
Main objective of a communication system is to convey
information. Each message conveys some information where some
message conveys more information than other.
From intuitive point of view the amount of information depends on
probability of occurrence of the event. If some one says, ‘the sun will
rise in the east tomorrow morning’ will not carry any information
since the probability of the event is unity.
If some one says, ‘it may rain tomorrow’, will convey some
information in winter season since raining is an unusual event in
winter. Above message will carry very small information in rainy
season. From intuitive point of view it could be concluded that
information carried by a message is inversely proportional to
probability of that event.
Information Theory
Information from intuitive point of view:
If I is the amount of information of a message m and P is the
probability of occurrence of that event then mathematically,
To hold above relation, the relation between I and P will be,
I = log(1/P)
In information theory base of the logarithmic function is 2.






0
1;0
Pif
Pif
I
3
Let us consider an information source generates messages m1, m2,
m3,… … …,mk with probability of occurrences, P1, P2, P3,… …
…,Pk. If the messages are independent the probability of composite
message,
P = P1P2P3… Pk
Information carried by the composite message or total information,
IT = log2(1/ P1P2P3… Pk)
= log2(1/ P1)+ log2(1/ P2)+ log2(1/ P3)+… … … + log2(1/ Pk)
= I1+I2+I3+… … … +Ik
4
Information from engineering point of view
From engineering point of view, an amount of information in a
message is proportional to the time required to transmit the message.
Therefore the message with smaller probability of occurrence needs
long code word and that of larger probability need shorter codeword.
For example in Morse code each alphabet is presented by
combination of mark and space has a certain length. To maximize
throughput frequent letters like e, t, a and o are presented by shorter
code word and the letters like x, q, k and z which occur less frequency
are presented by longer code word.
If someone use equal length code like binary or gray code then it
become unwise to use equal code for frequent letters i.e. throughput
(information per unit time) of the communication system will be
reduced considerably. 5
Let the probability of occurrences of letters e and q in an English
message is Pe and Pq respectively. We can write,
qe PP 
qe PP /1/1 
   qe PP /1log/1log 22 
qe II 
If the minimum unit of information is code symbol (bit for binary
code) then from above inequality the number of bit required to
represent q will be greater than that of e. If the capacity of the channel
(in bits/sec) is fixed then time required to transmit q (with larger
codeword) will be greater than e (with shorter codeword). 6
If the capacity of a channel is C (bits/sec) then time required to
transmit e,
sec
sec/ C
I
bits
bits
C
I
T ee
e 
Similarly, time required to transmit q,
sec
C
I
T q
q 
qe II 
qe TT 
which satisfies the concept of information theory from engineering
point of view.
7
Central idea of information theory is that messages of a source has
to be coded in such a way that maximum amount of information
can be transmitted through the channel of limited capacity.
Example-1
Consider 4 equiprobable messages M = {s0, s1, s2, s3}.
Information carried by each message si is,
2)4(log)/1(log 22  iPI Bits Pi = 1/4
We can show the result in table-1.
Messages Bits
s0 00
s1 01
s2 10
s3 11
Table-1
What will happen for the information source of 8 equiprobable messages? 8
Average Information
Let an information source generate messages m1, m2, m3,… … … mk with probability
of occurrences, P1, P2, P3,… … … Pk. For a long observation period [0, T], L messages
were generated, therefore LP1, LP2, LP3,… … … LPk are the number of symbols of m1,
m2, m3,… … … mk were generated over the observation time [0, T].
Information
source
{m1, m2, m3,… … … mk}
{P1, P2, P3,… … … Pk}
Now total information will be,
IT = LP1log(1/ P1)+ LP2log(1/ P2)+ LP3 log(1/ P3)+… … … + LPk log(1/ Pk)


k
i
ii PLP
1
2 )/1(log
Average information,
H = IT/L 

k
1i
i2i )P/1(logP
Average information H is called entropy.
9
Information Rate
Another important parameter of information theory is information
rate, R expressed as:
R = rH bits/sec or bps; where r is symbol or message rate and its
unit is message/sec.
10
Lower message/symbol rate (r)
Higher message/symbol rate (r)
Information
source Three messages or symbols
11
11
Message or symbol rate, r = 20 symbols/sec
Higher message/symbol rate, r = 50 symbols/sec
Let on average each symbol requires 3 bits i.e. H = 3 bits/symbol.
For case 1,
The information rate, R = rH = 20 symbols/sec × 3 bits/symbol
= 60 bits/sec = 60 bpd
For case 2,
The information rate, R = rH = 50 symbols/sec × 3 bits/symbol
= 150 bits/sec = 150 bpd
3 bits
12
Example-1
Let us consider two messages with probability of P and (1-P) have the entropy,
  















P
P
P
PH
1
1
log1
1
log 22
   )2(log/)1(log1)(log eee PPPP 
      0)1(log11
1
1
1)(log.1
1
)2(log 








 P
P
PP
P
P
dP
dH
eee
for maxima
  0)1(log1)(log1  PP ee
)1(log)(log PP ee  PP  1
2/1 P
Information
source
{0,1}
13
%Matlab Code
p=0:0.01:1;
H=p.*log2(1./p)+(1-p).*log2(1./(1-p));
plot(p,H)
xlabel('Probability')
ylabel('Entropy')
14
Therefore the entropy is maximum when P = 1/2 i.e. messages are
equiprobable. If k messages of equiprobable: 1/P1=1/P2 =1/P3… …
… =1/Pk = 1/k the entropy becomes,
kk
k
H
k
i
2
1
2 log)(log
1
 
Unit of entropy is bits/message
15
Example-1
An information source generates four messages m1, m2, m3 and m4
with probabilities of 1/2, 1/8, 1/8 and 1/4 respectively. Determine
entropy of the system.
H = (1/2)log2(2)+ (1/8)log2(8)+ (1/8)log2(8)+ (1/4)log2(4) =
1/2+3/8+3/8+1/2 = 7/4 bits/message.
Example-2
Determine entropy of above example for equiprobable message.
Here, P = 1/4
H = 4(1/4)log2(4) = 2bits/message. The coded message will be 00,
01, 10 and 11.
16
Example-3
An analog signal band limited to 3.4 KHz sampled and quantized with
256 level quantizer. During sampling a guard band of 1.2 KHz is
maintained. Determine entropy and information rate.
For 256 level quantization, number of possible messages will be 256.
If the quantized sample are equiprobable then P = 1/256.
H = 256.(1/256)log2(256) = 8 bits/sample
From Nyquist criteria, Sampling rate,
R = 2× 3.4 +1.2 = 6.8+1.2 KHz = 8KHz = 8×103samples/sec.
Information rate,
r = Hr = 8× 8×103bits/sec = 64 ×103bits/sec = 64Kbps
17
If entropy, then prove that,

N
i i
iN
P
PPPPPH
1
2321
1
log),,,,( 
  







PP
P
PP
P
HPPPPPPHPPPPH NN
1
2
1
1
21321321 ,),,,(),,,,( 
Ex.1
18
Code generation by Shannon-Fano algorithm:
Message Probability I II III IV V No. of
bite/message
m1 1/2 0 1
m2 1/8 1 0 0 3
m3 1/8 1 0 1 3
m4 1/16 1 1 0 0 4
m5 1/16 1 1 0 1 4
m6 1/16 1 1 1 0 4
m7 1/32 1 1 1 1 0 5
m8 1/32 1 1 1 1 1 5
The entropy of above messages:
H = (1/2)log2(2)+ 2(1/8)log2(8)+ 3(1/16)log2(16)+ 2(1/32)log2(32)
= 2.31 bits/message
The average codelength,
=1×1/2+2×3×1/8+3×4×1/16+2×5×1/32 = 2.31 bits/message xxPL
19
The efficiency of the code,
H
HL 
1 = 1 =100%
If any partition of Shannon-Fano is not found equal then we have
to select as nearly as possible. In this case efficiency of the coding
will be reduced.
20
Message Probability
m1 1/2
m2 1/4
m3 1/8
m4 1/16
m5 1/32
m6 1/64
m7 1/128
m8 1/128
Ex.2
Determine Shannon-Fano code
21
An information source generates 8 different types of messages: m1,
m2, m3, m4, m5, m6, m7 and m8. During an observation time [0, 2hr],
the source generates 10,0000 messages; among them the individual
types are: 1000, 3000, 500, 1500, 800, 200, 1200 and 1800 (i)
Determine entropy and information rate (ii) determine the same
results for the case of equiprobable messages. Comment on the
results. (iii) Write code words using Shannon-Fano algorithm.
Comment on the result iv) determine mean and variance of code
length. Comment on the result.
Ex.3
Show that Entropy is maximum when
all messages are equiprobable
22
23
Let an information source generate messages {m1, m2, m3,… … …, mk}
with probabilities of occurrence: { P1, P2, P3,… … … Pk}. Another
source generates same message with different probability distribution
like: { q1, q2, q3,… … … qk}.
Let us consider the inequality, ln(x) ≤ x-1 of fig. below. Putting x = pi/qi
in above equality,
ln(pi/qi) ≤ pi/qi -1
)1/()/ln(  iiiiii qppqpp
24
)1/()/ln(  iiiiii qppqpp
0)/1(log)/1(log
0)(log)/1(log
0)/(log
0)/(log
)2ln(
1
011)(
)1/()/ln(
0
2
0
2
0
2
0
2
0
2
0
2
0
00


















k
i
ii
k
i
ii
k
i
ii
k
i
ii
k
i
iii
k
i
iii
k
i
ii
k
i
iii
k
i
iii
pqqq
pqqq
qpq
qpq
qp
qpqqpq
(1)
25
If all the messages of second source are equiprobable i.e. Pi=1/k then
from equation (1),
)(log)(log)(log)/1(log 2
0
2
0
2
0
2 kqkkqqq
k
i
i
k
i
i
k
i
ii  

 

k
i
ii
k
i
ii pqqq
0
2
0
2 )/1(log)/1(log (1)
)(log)/1(log 2
0
2 kqq
k
i
ii  

)(log2 kH  (2)
26
Let us find the entropy of first source for the case of equiprobale message.



k
i
e kkkH
0
22 )(log)(log)/1( (3)
From (2) and (3)
eHH 
Therefore entropy of an information source is the maximum when
all the messages are equiprobable.
27
Memoryless source and Source with memory:
A discrete source is said to be memoryless if the symbols emitted by
the source are statistically independent. If the source is discrete, it is
called a discrete memoryless source (DMS). For example an
information source generates symbols x1, x2, x3, … … … xm with
probability of occurrence p(x1), p(x2), p(x3), … … … p(xm). Now
the probability of generation of sequence, (x1, x2, x3, … xk) is:


k
i
ik xpxxxP
1
21 )()...,,(








k
i i
ik
xp
xpxH
1
2
)(
1
log)()(
28
A discrete source is said to have memory if the source elements
composing the sequence are not independent. Let us consider the
following binary source with memory.
10
P(0|0) = 0.95 P(1|0) = 0.05
P(0|1) = 0.45
P(1|1) = 0.55
The entropy of the source X is,
)1()1()0()0()( XHPXHPXH 
29
Which is the weighted sum of the conditional entropies that
correspond to the transition probability.
)01(
1
log)01(
)00(
1
log)00()0( 22
P
P
P
PXH Here
)11(
1
log)11(
)10(
1
log)10()1( 22
P
P
P
PXH 
From probability theorem,
)1()10()0()00()0( PPPPP 
)1()11()0()01()1( PPPPP 
1)0()1(  PP
From the state transition diagram,
P(0) = 0.9, P(1) = 0.1
30
286.0
)01(
1
log)01(
)00(
1
log)00()0( 22 
P
P
P
PXH
933.0
)11(
1
log)11(
)10(
1
log)10()1( 22 
P
P
P
PXH
)1()1()0()0()( XHPXHPXH 
= 0.9×0.286+0.1×0.933 = 0.357 bits/symbol
31
Let us consider the following binary code:
Message/symbol Code
a 00
b 01
c 10
d 11
0.899=0.9×0.95=)0()00()( PPaP 
0.045=0.1×0.45)1()10()(  PPbP
0.045=0.09×0.05)0()01()(  PPcP
0.055=0.1×0.55)1()11()(  PPdP
32
Again for three tuple case:
Message
/symbol
Code
a 000
b 100
c 001
d 111
e 110
f 011
g 010
h 101
0.8123=0.855×0.95)00()000()(  PPaP
0.0428=0.855×0.05)00()001()(  PPbP
0.0428=0.45×0.95)01()010()(  PPcP
0.0303=0.055×0.55)11()111()(  PPdP etc.
33
Channel Capacity is defined as the maximum amount information
a channel can convey per unit time. Let us assume that the average
signal and the noise power at the receiving end are S watts and N
watts respectively. If the load resistance is 1Ω then the rms value of
received signal is volts and that of noise is volts.
Therefore minimum quantization interval must be greater than
volts, otherwise smallest quantized signal could not be distinguished
from the noise. Therefore maximum possible quantization levels will
be,
NS  N
N
Channel Capacity
NSNNSM /1/ 
34
If each quantized sample presents a message and probability of
occurrence of any message will be for
equiprobable case. The maximum amount of information carries
by each pulse or message, bits.
If the maximum frequency of the baseband signal is B, then
sampling rate will be 2B samples/sec or message/sec. Now the
maximum information rate,
MNS /1/1/1 
 NSNSI /1log
2
1
/1log 22 
   NSBNSBC /1log./1log.2.
2
1
22  bits/sec
Above relation is known as the Hartly-Shanon law of channel
capacity.
35
In practice N is always finite hence the channel capacity C is finite.
This is true even bandwidth B is infinite. The noise signal is a
white noise with uniform psd over the entire BW. As BW increases
N also increases therefore C remains finite even BW is infinite.
Let the psd of noise is N0/2 therefore the noise of received signal,
N = 2BN0/2 = BN0



















0
2
0
00
2 1log1log
BN
S
B
S
BN
N
S
BN
S
BC
f
N
N0/2
B B
f
X(f)
36
x
BN
S

0
 x
xN
S
C 





 1log
1
2
0
 x
xN
S
Lt
BN
S
B
S
BN
N
S
CLt
xB




















1log
1
1log 2
0
0
0
2
0
0
     x
xN
S
Ltxe
xN
S
Lt e
x
e
x














1log
44.1
1loglog
1
0
0
2
0
0
0
32
0
0
44.1.........
32
44.1
N
Sxx
x
xN
S
Lt
x















which is finite
Putting
Now
Let us now consider an analog signal of highest frequency of B
Hz is quantized into M discrete amplitude levels.
The information rate, R = (sample/sec)*(bits/sample) = 2B. log2M
= 2Blog22n = 2Bn. If the coded data has m different amplitude levels
instead of binary data of m = 2 levels then, M = mn; where each
quantized sample is presented by n pulses of m amplitude levels.
Now the channel capacity,
C = 2B.log2(mn) = 2Bn.log2(m) = Bn.log2(m2)
37
Channel Capacity
3a/2
a/2
-a/2
-3a/2
t
0
Fig.1 NRZ polar data for m = 4 levels
Let us consider m = 4 of NRZ polar data for transmission.
The amplitude of possible levels for m levels NRZ polar data will
be, ±a/2, ±3a/2, ±5a/2, … … …, ±(m-1)a/2
38
The average signal power,
S = (2/m){(a/2)2+(3a/2)2+(5a/2)2+ … … … +(m-1)2(a/2)2}
= (a2/4) (2/m){12+32+52+ … … … +(m-1)2}
=(a2/4) (2/m)
The prove of sum of square of odd numbers is shown in appendix
2
2 12
1
a
S
m  C = Blog2(1+S/N )bits/sec
C = Bn.log2(m2)






 22
12
1log
a
S
BnC
If the level spacing is k times the rms value of noise voltage σ then,
a = kσ.






 222
12
1log
k
S
BnC 





 SNR
k
Bn 22
12
1log
39





 
6
12
m
m
S= a2(m2-1)/12
If the signal power S is increased by k2/12 the channel capacity will
attain the Shannon’s capacity.
40






 SNR
k
BnC 22
12
1log
Here n represents the number of pulses of base m per sample
and B for samples/sec. Therefore Bn is number of pulses of base
m/sec is represented as W as the BW of the baseband signal.






 SNR
k
WC 22
12
1logTherefore
If the signal power S is increased by k2/12 the channel capacity will
attain the Shannon’s capacity.
12+32+52+… … …+(2n-1)2
The rth term, Tr = (2r-1)2 = 4r2-4r+1
nrrS
n
r
n
r
nodd    11
2
_ 44Therefore
n
nnnnn
S nodd 




2
)1(
4
6
)12)(1(
4_








 1
6
)1(8 2
n
n
Putting n = m/2 




 
























6
1
1
6
1
4
2
2
2
_
m
m
m
m
m
S nodd
Appendix
41
42
The process by which data generated by a discrete source is
represented efficiently called source coding. For example data
compression.
Source Coding
Lossless compression
Prefix coding (no code word is the prefix of any other code word)
Run-length coding
Huffman Coding
Lempel-Ziv Coding
Lossy compression
Example: JPEG, MPEG, Voice compression, Wavelet based
compression
15.43
Figure 1 Data compression methods
15.44
Run-length encoding
Run-length encoding is probably the simplest method of
compression. The general idea behind this method is to replace
consecutive repeating occurrences of a symbol by one occurrence of
the symbol followed by the number of occurrences.
The method can be even more efficient if the data uses only two
symbols (for example 0 and 1) in its bit pattern and one symbol is more
frequent than the other.
15.45
Figure 1 Run-length encoding example
46
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Example-3
Consider a rectangular binary image
The image can be compressed with run-length coding like:
0, 32
0, 32
0, 9, 1, 4, 0, 19
0, 17, 1,5, 0,10
0,32
0,6, 1,11, 0,15
Run-length encoding for two symbols
• We can encode one symbol which is more
frequent than the other.
• This example only encode 0’s between 1’s.
There is no 0 between 1’s
48
Huffman coding
Huffman coding uses a variable length code for each of the elements within the information.
This normally involves analyzing the information to determine the probability of elements
within the information. The most probable elements are coded with a few bits and the least
probable coded with a greater number of bits.
The following example relates to characters. First, the textual information is scanned to
determine the number of occurrences of a given letter. For example:
‘e’ ‘i’ ‘o’ ‘p’ ‘b’ ‘c’
57 51 33 20 12 3
The final coding will be:
‘e’ 11
‘i’ 10
‘o’ 00
‘p’ 011
‘b’ 0101
‘c’ 0100
49
Example-2
50
Average code length
bits/message
Example-3
51
52
Average code length
bits/message
53
a 0
b 111
c 1011
d 1010
r 110
Prefix Codes No word in the code is a prefix of any
other word.
54
Lempel–Ziv–Welch (LZW) is a universal lossless data
compression algorithm created by Abraham Lempel, Jacob Ziv,
and Terry Welch. It was published by Welch in 1984 as an improved
implementation of the LZ78 algorithm published by Lempel and Ziv
in 1978.
The algorithm is simple to implement, and widely used Unix file
compression, and is used in the GIF image format.
Lempel Ziv encoding
15.55
Compression
In this phase there are two concurrent events: building an
indexed dictionary and compressing a string of symbols. The
algorithm extracts the smallest substring that cannot be
found in the dictionary from the remaining uncompressed
string. It then stores a copy of this substring in the dictionary
as a new entry and assigns it an index value.
Compression occurs when the substring, except for the last
character, is replaced with the index found in the dictionary.
The process then inserts the index and the last character of
the substring into the compressed string.
15.56
Figure 15.8 An example of Lempel Ziv encoding
15.57
Decompression
Decompression is the inverse of the compression process.
The process extracts the substrings from the compressed
string and tries to replace the indexes with the corresponding
entry in the dictionary, which is empty at first and built up
gradually. The idea is that when an index is received, there is
already an entry in the dictionary corresponding to that
index.
15.58
Figure 15.9 An example of Lempel Ziv decoding
Rule: Separate this stream of characters into pieces of text so
that the shortest piece of data is the string of characters that
we have not seen so far.
Sender : The Compressor
• Before compression, the pieces of text from
the breaking-down process are indexed from 1
to n:
• indices are used to number the pieces of data.
– The empty string (start of text) has index 0.
– The piece indexed by 1 is a. Thus a, together with the initial
string, must be numbered Oa.
– String 2, aa, will be numbered 1a, because it contains a,
whose index is 1, and the new character a.
62
Example-1
63
A drawback of Huffman code is that it requires knowledge of a
probabilistic model of source: unfortunately, in practice, source
statistics are not always known a priori.
When it is applied to ordinary English text, the Lampel-Ziv
algorithm achieves a compaction of approximately 55%. This is to
be contrasted with compaction of approximately 43% achieved with
Huffman coding.
64
Let's take as an example the following binary string:
001101100011010101001001001101000001010010110010110
String
Position
Number
of this
string
Position
Number
in binary
0 1 0001
01 2 0010
1 3 0011
011 4 0100
00 5 0101
0110 6 0110
10 7 0111
101 8 1000
001 9 1001
0010 10 1010
01101 11 1011
000 12 1100
00101 13 1101
001011 14 1110
0010110 15 1111

More Related Content

What's hot

What's hot (20)

Ch 03
Ch 03Ch 03
Ch 03
 
Chap 3
Chap 3Chap 3
Chap 3
 
Data and signals
Data and signalsData and signals
Data and signals
 
Satellite error detection and correction presentation
Satellite error detection and correction presentationSatellite error detection and correction presentation
Satellite error detection and correction presentation
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
Error Control Coding -Introduction
Error Control Coding -IntroductionError Control Coding -Introduction
Error Control Coding -Introduction
 
Modulation Techniques for Mobile Radio
Modulation Techniques for Mobile RadioModulation Techniques for Mobile Radio
Modulation Techniques for Mobile Radio
 
Digital modulation technique
Digital modulation techniqueDigital modulation technique
Digital modulation technique
 
Error Control coding
Error Control codingError Control coding
Error Control coding
 
Communication systems v4
Communication systems v4Communication systems v4
Communication systems v4
 
Digital Communication: Information Theory
Digital Communication: Information TheoryDigital Communication: Information Theory
Digital Communication: Information Theory
 
Information theory
Information theoryInformation theory
Information theory
 
Multiplexing and Multiple access
Multiplexing and Multiple accessMultiplexing and Multiple access
Multiplexing and Multiple access
 
Digital modulation techniques
Digital modulation techniquesDigital modulation techniques
Digital modulation techniques
 
Convolutional codes
Convolutional codesConvolutional codes
Convolutional codes
 
Call flow in gsm
Call flow in gsmCall flow in gsm
Call flow in gsm
 
Matched filter
Matched filterMatched filter
Matched filter
 
Digital modulation techniques...
Digital modulation techniques...Digital modulation techniques...
Digital modulation techniques...
 
Chapter 3 - Data and Signals
Chapter 3 - Data and SignalsChapter 3 - Data and Signals
Chapter 3 - Data and Signals
 
2. data and signals
2. data and signals2. data and signals
2. data and signals
 

Similar to Information Theory Coding 1

Information Theory and Coding
Information Theory and CodingInformation Theory and Coding
Information Theory and CodingVIT-AP University
 
Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Aref35
 
cis97003
cis97003cis97003
cis97003perfj
 
Unit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptxUnit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptxKIRUTHIKAAR2
 
Tele4653 l9
Tele4653 l9Tele4653 l9
Tele4653 l9Vin Voro
 
Unit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptxUnit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptxKIRUTHIKAAR2
 
6.1-Information Sources and Entropy.pptx
6.1-Information Sources and Entropy.pptx6.1-Information Sources and Entropy.pptx
6.1-Information Sources and Entropy.pptxDipakMahurkar1
 
A Mathematical Theory of Communication
A Mathematical Theory of CommunicationA Mathematical Theory of Communication
A Mathematical Theory of CommunicationSergey Oboroc
 
Information theory & coding PPT Full Syllabus.pptx
Information theory & coding PPT Full Syllabus.pptxInformation theory & coding PPT Full Syllabus.pptx
Information theory & coding PPT Full Syllabus.pptxprernaguptaec
 
A mathematical theory of communication
A mathematical theory of communicationA mathematical theory of communication
A mathematical theory of communicationSergio Zaina
 
Unit I.pptx INTRODUCTION TO DIGITAL COMMUNICATION
Unit I.pptx INTRODUCTION TO DIGITAL COMMUNICATIONUnit I.pptx INTRODUCTION TO DIGITAL COMMUNICATION
Unit I.pptx INTRODUCTION TO DIGITAL COMMUNICATIONrubini Rubini
 
Lecture1
Lecture1Lecture1
Lecture1ntpc08
 

Similar to Information Theory Coding 1 (20)

Information Theory and Coding
Information Theory and CodingInformation Theory and Coding
Information Theory and Coding
 
UNIT-2.pdf
UNIT-2.pdfUNIT-2.pdf
UNIT-2.pdf
 
Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2
 
cis97003
cis97003cis97003
cis97003
 
DC@UNIT 2 ppt.ppt
DC@UNIT 2 ppt.pptDC@UNIT 2 ppt.ppt
DC@UNIT 2 ppt.ppt
 
Unit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptxUnit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptx
 
Tele4653 l9
Tele4653 l9Tele4653 l9
Tele4653 l9
 
Unit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptxUnit-1_Digital_Communication-Information_Theory.pptx
Unit-1_Digital_Communication-Information_Theory.pptx
 
6.1-Information Sources and Entropy.pptx
6.1-Information Sources and Entropy.pptx6.1-Information Sources and Entropy.pptx
6.1-Information Sources and Entropy.pptx
 
Entropy
EntropyEntropy
Entropy
 
A Mathematical Theory of Communication
A Mathematical Theory of CommunicationA Mathematical Theory of Communication
A Mathematical Theory of Communication
 
Information theory & coding PPT Full Syllabus.pptx
Information theory & coding PPT Full Syllabus.pptxInformation theory & coding PPT Full Syllabus.pptx
Information theory & coding PPT Full Syllabus.pptx
 
Datacompression1
Datacompression1Datacompression1
Datacompression1
 
A mathematical theory of communication
A mathematical theory of communicationA mathematical theory of communication
A mathematical theory of communication
 
Shannon1948
Shannon1948Shannon1948
Shannon1948
 
Shannon1948
Shannon1948Shannon1948
Shannon1948
 
Unit I.pptx INTRODUCTION TO DIGITAL COMMUNICATION
Unit I.pptx INTRODUCTION TO DIGITAL COMMUNICATIONUnit I.pptx INTRODUCTION TO DIGITAL COMMUNICATION
Unit I.pptx INTRODUCTION TO DIGITAL COMMUNICATION
 
Arithmetic Coding
Arithmetic CodingArithmetic Coding
Arithmetic Coding
 
Shannon1948
Shannon1948Shannon1948
Shannon1948
 
Lecture1
Lecture1Lecture1
Lecture1
 

Recently uploaded

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 

Recently uploaded (20)

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 

Information Theory Coding 1

  • 1. Information Theory and Coding System PMSCS 676 Summer 2016 Prof. Dr. Md. Imdadul Islam www.juniv.edu
  • 2. Main objective of a communication system is to convey information. Each message conveys some information where some message conveys more information than other. From intuitive point of view the amount of information depends on probability of occurrence of the event. If some one says, ‘the sun will rise in the east tomorrow morning’ will not carry any information since the probability of the event is unity. If some one says, ‘it may rain tomorrow’, will convey some information in winter season since raining is an unusual event in winter. Above message will carry very small information in rainy season. From intuitive point of view it could be concluded that information carried by a message is inversely proportional to probability of that event. Information Theory
  • 3. Information from intuitive point of view: If I is the amount of information of a message m and P is the probability of occurrence of that event then mathematically, To hold above relation, the relation between I and P will be, I = log(1/P) In information theory base of the logarithmic function is 2.       0 1;0 Pif Pif I 3
  • 4. Let us consider an information source generates messages m1, m2, m3,… … …,mk with probability of occurrences, P1, P2, P3,… … …,Pk. If the messages are independent the probability of composite message, P = P1P2P3… Pk Information carried by the composite message or total information, IT = log2(1/ P1P2P3… Pk) = log2(1/ P1)+ log2(1/ P2)+ log2(1/ P3)+… … … + log2(1/ Pk) = I1+I2+I3+… … … +Ik 4
  • 5. Information from engineering point of view From engineering point of view, an amount of information in a message is proportional to the time required to transmit the message. Therefore the message with smaller probability of occurrence needs long code word and that of larger probability need shorter codeword. For example in Morse code each alphabet is presented by combination of mark and space has a certain length. To maximize throughput frequent letters like e, t, a and o are presented by shorter code word and the letters like x, q, k and z which occur less frequency are presented by longer code word. If someone use equal length code like binary or gray code then it become unwise to use equal code for frequent letters i.e. throughput (information per unit time) of the communication system will be reduced considerably. 5
  • 6. Let the probability of occurrences of letters e and q in an English message is Pe and Pq respectively. We can write, qe PP  qe PP /1/1     qe PP /1log/1log 22  qe II  If the minimum unit of information is code symbol (bit for binary code) then from above inequality the number of bit required to represent q will be greater than that of e. If the capacity of the channel (in bits/sec) is fixed then time required to transmit q (with larger codeword) will be greater than e (with shorter codeword). 6
  • 7. If the capacity of a channel is C (bits/sec) then time required to transmit e, sec sec/ C I bits bits C I T ee e  Similarly, time required to transmit q, sec C I T q q  qe II  qe TT  which satisfies the concept of information theory from engineering point of view. 7
  • 8. Central idea of information theory is that messages of a source has to be coded in such a way that maximum amount of information can be transmitted through the channel of limited capacity. Example-1 Consider 4 equiprobable messages M = {s0, s1, s2, s3}. Information carried by each message si is, 2)4(log)/1(log 22  iPI Bits Pi = 1/4 We can show the result in table-1. Messages Bits s0 00 s1 01 s2 10 s3 11 Table-1 What will happen for the information source of 8 equiprobable messages? 8
  • 9. Average Information Let an information source generate messages m1, m2, m3,… … … mk with probability of occurrences, P1, P2, P3,… … … Pk. For a long observation period [0, T], L messages were generated, therefore LP1, LP2, LP3,… … … LPk are the number of symbols of m1, m2, m3,… … … mk were generated over the observation time [0, T]. Information source {m1, m2, m3,… … … mk} {P1, P2, P3,… … … Pk} Now total information will be, IT = LP1log(1/ P1)+ LP2log(1/ P2)+ LP3 log(1/ P3)+… … … + LPk log(1/ Pk)   k i ii PLP 1 2 )/1(log Average information, H = IT/L   k 1i i2i )P/1(logP Average information H is called entropy. 9
  • 10. Information Rate Another important parameter of information theory is information rate, R expressed as: R = rH bits/sec or bps; where r is symbol or message rate and its unit is message/sec. 10 Lower message/symbol rate (r) Higher message/symbol rate (r) Information source Three messages or symbols
  • 11. 11 11 Message or symbol rate, r = 20 symbols/sec Higher message/symbol rate, r = 50 symbols/sec Let on average each symbol requires 3 bits i.e. H = 3 bits/symbol. For case 1, The information rate, R = rH = 20 symbols/sec × 3 bits/symbol = 60 bits/sec = 60 bpd For case 2, The information rate, R = rH = 50 symbols/sec × 3 bits/symbol = 150 bits/sec = 150 bpd 3 bits
  • 12. 12 Example-1 Let us consider two messages with probability of P and (1-P) have the entropy,                   P P P PH 1 1 log1 1 log 22    )2(log/)1(log1)(log eee PPPP        0)1(log11 1 1 1)(log.1 1 )2(log           P P PP P P dP dH eee for maxima   0)1(log1)(log1  PP ee )1(log)(log PP ee  PP  1 2/1 P Information source {0,1}
  • 14. 14 Therefore the entropy is maximum when P = 1/2 i.e. messages are equiprobable. If k messages of equiprobable: 1/P1=1/P2 =1/P3… … … =1/Pk = 1/k the entropy becomes, kk k H k i 2 1 2 log)(log 1   Unit of entropy is bits/message
  • 15. 15 Example-1 An information source generates four messages m1, m2, m3 and m4 with probabilities of 1/2, 1/8, 1/8 and 1/4 respectively. Determine entropy of the system. H = (1/2)log2(2)+ (1/8)log2(8)+ (1/8)log2(8)+ (1/4)log2(4) = 1/2+3/8+3/8+1/2 = 7/4 bits/message. Example-2 Determine entropy of above example for equiprobable message. Here, P = 1/4 H = 4(1/4)log2(4) = 2bits/message. The coded message will be 00, 01, 10 and 11.
  • 16. 16 Example-3 An analog signal band limited to 3.4 KHz sampled and quantized with 256 level quantizer. During sampling a guard band of 1.2 KHz is maintained. Determine entropy and information rate. For 256 level quantization, number of possible messages will be 256. If the quantized sample are equiprobable then P = 1/256. H = 256.(1/256)log2(256) = 8 bits/sample From Nyquist criteria, Sampling rate, R = 2× 3.4 +1.2 = 6.8+1.2 KHz = 8KHz = 8×103samples/sec. Information rate, r = Hr = 8× 8×103bits/sec = 64 ×103bits/sec = 64Kbps
  • 17. 17 If entropy, then prove that,  N i i iN P PPPPPH 1 2321 1 log),,,,(            PP P PP P HPPPPPPHPPPPH NN 1 2 1 1 21321321 ,),,,(),,,,(  Ex.1
  • 18. 18 Code generation by Shannon-Fano algorithm: Message Probability I II III IV V No. of bite/message m1 1/2 0 1 m2 1/8 1 0 0 3 m3 1/8 1 0 1 3 m4 1/16 1 1 0 0 4 m5 1/16 1 1 0 1 4 m6 1/16 1 1 1 0 4 m7 1/32 1 1 1 1 0 5 m8 1/32 1 1 1 1 1 5 The entropy of above messages: H = (1/2)log2(2)+ 2(1/8)log2(8)+ 3(1/16)log2(16)+ 2(1/32)log2(32) = 2.31 bits/message The average codelength, =1×1/2+2×3×1/8+3×4×1/16+2×5×1/32 = 2.31 bits/message xxPL
  • 19. 19 The efficiency of the code, H HL  1 = 1 =100% If any partition of Shannon-Fano is not found equal then we have to select as nearly as possible. In this case efficiency of the coding will be reduced.
  • 20. 20 Message Probability m1 1/2 m2 1/4 m3 1/8 m4 1/16 m5 1/32 m6 1/64 m7 1/128 m8 1/128 Ex.2 Determine Shannon-Fano code
  • 21. 21 An information source generates 8 different types of messages: m1, m2, m3, m4, m5, m6, m7 and m8. During an observation time [0, 2hr], the source generates 10,0000 messages; among them the individual types are: 1000, 3000, 500, 1500, 800, 200, 1200 and 1800 (i) Determine entropy and information rate (ii) determine the same results for the case of equiprobable messages. Comment on the results. (iii) Write code words using Shannon-Fano algorithm. Comment on the result iv) determine mean and variance of code length. Comment on the result. Ex.3
  • 22. Show that Entropy is maximum when all messages are equiprobable 22
  • 23. 23 Let an information source generate messages {m1, m2, m3,… … …, mk} with probabilities of occurrence: { P1, P2, P3,… … … Pk}. Another source generates same message with different probability distribution like: { q1, q2, q3,… … … qk}. Let us consider the inequality, ln(x) ≤ x-1 of fig. below. Putting x = pi/qi in above equality, ln(pi/qi) ≤ pi/qi -1 )1/()/ln(  iiiiii qppqpp
  • 24. 24 )1/()/ln(  iiiiii qppqpp 0)/1(log)/1(log 0)(log)/1(log 0)/(log 0)/(log )2ln( 1 011)( )1/()/ln( 0 2 0 2 0 2 0 2 0 2 0 2 0 00                   k i ii k i ii k i ii k i ii k i iii k i iii k i ii k i iii k i iii pqqq pqqq qpq qpq qp qpqqpq (1)
  • 25. 25 If all the messages of second source are equiprobable i.e. Pi=1/k then from equation (1), )(log)(log)(log)/1(log 2 0 2 0 2 0 2 kqkkqqq k i i k i i k i ii       k i ii k i ii pqqq 0 2 0 2 )/1(log)/1(log (1) )(log)/1(log 2 0 2 kqq k i ii    )(log2 kH  (2)
  • 26. 26 Let us find the entropy of first source for the case of equiprobale message.    k i e kkkH 0 22 )(log)(log)/1( (3) From (2) and (3) eHH  Therefore entropy of an information source is the maximum when all the messages are equiprobable.
  • 27. 27 Memoryless source and Source with memory: A discrete source is said to be memoryless if the symbols emitted by the source are statistically independent. If the source is discrete, it is called a discrete memoryless source (DMS). For example an information source generates symbols x1, x2, x3, … … … xm with probability of occurrence p(x1), p(x2), p(x3), … … … p(xm). Now the probability of generation of sequence, (x1, x2, x3, … xk) is:   k i ik xpxxxP 1 21 )()...,,(         k i i ik xp xpxH 1 2 )( 1 log)()(
  • 28. 28 A discrete source is said to have memory if the source elements composing the sequence are not independent. Let us consider the following binary source with memory. 10 P(0|0) = 0.95 P(1|0) = 0.05 P(0|1) = 0.45 P(1|1) = 0.55 The entropy of the source X is, )1()1()0()0()( XHPXHPXH 
  • 29. 29 Which is the weighted sum of the conditional entropies that correspond to the transition probability. )01( 1 log)01( )00( 1 log)00()0( 22 P P P PXH Here )11( 1 log)11( )10( 1 log)10()1( 22 P P P PXH  From probability theorem, )1()10()0()00()0( PPPPP  )1()11()0()01()1( PPPPP  1)0()1(  PP From the state transition diagram, P(0) = 0.9, P(1) = 0.1
  • 30. 30 286.0 )01( 1 log)01( )00( 1 log)00()0( 22  P P P PXH 933.0 )11( 1 log)11( )10( 1 log)10()1( 22  P P P PXH )1()1()0()0()( XHPXHPXH  = 0.9×0.286+0.1×0.933 = 0.357 bits/symbol
  • 31. 31 Let us consider the following binary code: Message/symbol Code a 00 b 01 c 10 d 11 0.899=0.9×0.95=)0()00()( PPaP  0.045=0.1×0.45)1()10()(  PPbP 0.045=0.09×0.05)0()01()(  PPcP 0.055=0.1×0.55)1()11()(  PPdP
  • 32. 32 Again for three tuple case: Message /symbol Code a 000 b 100 c 001 d 111 e 110 f 011 g 010 h 101 0.8123=0.855×0.95)00()000()(  PPaP 0.0428=0.855×0.05)00()001()(  PPbP 0.0428=0.45×0.95)01()010()(  PPcP 0.0303=0.055×0.55)11()111()(  PPdP etc.
  • 33. 33 Channel Capacity is defined as the maximum amount information a channel can convey per unit time. Let us assume that the average signal and the noise power at the receiving end are S watts and N watts respectively. If the load resistance is 1Ω then the rms value of received signal is volts and that of noise is volts. Therefore minimum quantization interval must be greater than volts, otherwise smallest quantized signal could not be distinguished from the noise. Therefore maximum possible quantization levels will be, NS  N N Channel Capacity NSNNSM /1/ 
  • 34. 34 If each quantized sample presents a message and probability of occurrence of any message will be for equiprobable case. The maximum amount of information carries by each pulse or message, bits. If the maximum frequency of the baseband signal is B, then sampling rate will be 2B samples/sec or message/sec. Now the maximum information rate, MNS /1/1/1   NSNSI /1log 2 1 /1log 22     NSBNSBC /1log./1log.2. 2 1 22  bits/sec Above relation is known as the Hartly-Shanon law of channel capacity.
  • 35. 35 In practice N is always finite hence the channel capacity C is finite. This is true even bandwidth B is infinite. The noise signal is a white noise with uniform psd over the entire BW. As BW increases N also increases therefore C remains finite even BW is infinite. Let the psd of noise is N0/2 therefore the noise of received signal, N = 2BN0/2 = BN0                    0 2 0 00 2 1log1log BN S B S BN N S BN S BC f N N0/2 B B f X(f)
  • 36. 36 x BN S  0  x xN S C        1log 1 2 0  x xN S Lt BN S B S BN N S CLt xB                     1log 1 1log 2 0 0 0 2 0 0      x xN S Ltxe xN S Lt e x e x               1log 44.1 1loglog 1 0 0 2 0 0 0 32 0 0 44.1......... 32 44.1 N Sxx x xN S Lt x                which is finite Putting Now
  • 37. Let us now consider an analog signal of highest frequency of B Hz is quantized into M discrete amplitude levels. The information rate, R = (sample/sec)*(bits/sample) = 2B. log2M = 2Blog22n = 2Bn. If the coded data has m different amplitude levels instead of binary data of m = 2 levels then, M = mn; where each quantized sample is presented by n pulses of m amplitude levels. Now the channel capacity, C = 2B.log2(mn) = 2Bn.log2(m) = Bn.log2(m2) 37 Channel Capacity
  • 38. 3a/2 a/2 -a/2 -3a/2 t 0 Fig.1 NRZ polar data for m = 4 levels Let us consider m = 4 of NRZ polar data for transmission. The amplitude of possible levels for m levels NRZ polar data will be, ±a/2, ±3a/2, ±5a/2, … … …, ±(m-1)a/2 38
  • 39. The average signal power, S = (2/m){(a/2)2+(3a/2)2+(5a/2)2+ … … … +(m-1)2(a/2)2} = (a2/4) (2/m){12+32+52+ … … … +(m-1)2} =(a2/4) (2/m) The prove of sum of square of odd numbers is shown in appendix 2 2 12 1 a S m  C = Blog2(1+S/N )bits/sec C = Bn.log2(m2)        22 12 1log a S BnC If the level spacing is k times the rms value of noise voltage σ then, a = kσ.        222 12 1log k S BnC        SNR k Bn 22 12 1log 39        6 12 m m S= a2(m2-1)/12
  • 40. If the signal power S is increased by k2/12 the channel capacity will attain the Shannon’s capacity. 40        SNR k BnC 22 12 1log Here n represents the number of pulses of base m per sample and B for samples/sec. Therefore Bn is number of pulses of base m/sec is represented as W as the BW of the baseband signal.        SNR k WC 22 12 1logTherefore If the signal power S is increased by k2/12 the channel capacity will attain the Shannon’s capacity.
  • 41. 12+32+52+… … …+(2n-1)2 The rth term, Tr = (2r-1)2 = 4r2-4r+1 nrrS n r n r nodd    11 2 _ 44Therefore n nnnnn S nodd      2 )1( 4 6 )12)(1( 4_          1 6 )1(8 2 n n Putting n = m/2                                6 1 1 6 1 4 2 2 2 _ m m m m m S nodd Appendix 41
  • 42. 42 The process by which data generated by a discrete source is represented efficiently called source coding. For example data compression. Source Coding Lossless compression Prefix coding (no code word is the prefix of any other code word) Run-length coding Huffman Coding Lempel-Ziv Coding Lossy compression Example: JPEG, MPEG, Voice compression, Wavelet based compression
  • 43. 15.43 Figure 1 Data compression methods
  • 44. 15.44 Run-length encoding Run-length encoding is probably the simplest method of compression. The general idea behind this method is to replace consecutive repeating occurrences of a symbol by one occurrence of the symbol followed by the number of occurrences. The method can be even more efficient if the data uses only two symbols (for example 0 and 1) in its bit pattern and one symbol is more frequent than the other.
  • 45. 15.45 Figure 1 Run-length encoding example
  • 46. 46 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Example-3 Consider a rectangular binary image The image can be compressed with run-length coding like: 0, 32 0, 32 0, 9, 1, 4, 0, 19 0, 17, 1,5, 0,10 0,32 0,6, 1,11, 0,15
  • 47. Run-length encoding for two symbols • We can encode one symbol which is more frequent than the other. • This example only encode 0’s between 1’s. There is no 0 between 1’s
  • 48. 48 Huffman coding Huffman coding uses a variable length code for each of the elements within the information. This normally involves analyzing the information to determine the probability of elements within the information. The most probable elements are coded with a few bits and the least probable coded with a greater number of bits. The following example relates to characters. First, the textual information is scanned to determine the number of occurrences of a given letter. For example: ‘e’ ‘i’ ‘o’ ‘p’ ‘b’ ‘c’ 57 51 33 20 12 3 The final coding will be: ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011 ‘b’ 0101 ‘c’ 0100
  • 51. 51
  • 53. 53 a 0 b 111 c 1011 d 1010 r 110 Prefix Codes No word in the code is a prefix of any other word.
  • 54. 54 Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lempel and Ziv in 1978. The algorithm is simple to implement, and widely used Unix file compression, and is used in the GIF image format. Lempel Ziv encoding
  • 55. 15.55 Compression In this phase there are two concurrent events: building an indexed dictionary and compressing a string of symbols. The algorithm extracts the smallest substring that cannot be found in the dictionary from the remaining uncompressed string. It then stores a copy of this substring in the dictionary as a new entry and assigns it an index value. Compression occurs when the substring, except for the last character, is replaced with the index found in the dictionary. The process then inserts the index and the last character of the substring into the compressed string.
  • 56. 15.56 Figure 15.8 An example of Lempel Ziv encoding
  • 57. 15.57 Decompression Decompression is the inverse of the compression process. The process extracts the substrings from the compressed string and tries to replace the indexes with the corresponding entry in the dictionary, which is empty at first and built up gradually. The idea is that when an index is received, there is already an entry in the dictionary corresponding to that index.
  • 58. 15.58 Figure 15.9 An example of Lempel Ziv decoding
  • 59. Rule: Separate this stream of characters into pieces of text so that the shortest piece of data is the string of characters that we have not seen so far.
  • 60. Sender : The Compressor • Before compression, the pieces of text from the breaking-down process are indexed from 1 to n:
  • 61. • indices are used to number the pieces of data. – The empty string (start of text) has index 0. – The piece indexed by 1 is a. Thus a, together with the initial string, must be numbered Oa. – String 2, aa, will be numbered 1a, because it contains a, whose index is 1, and the new character a.
  • 63. 63 A drawback of Huffman code is that it requires knowledge of a probabilistic model of source: unfortunately, in practice, source statistics are not always known a priori. When it is applied to ordinary English text, the Lampel-Ziv algorithm achieves a compaction of approximately 55%. This is to be contrasted with compaction of approximately 43% achieved with Huffman coding.
  • 64. 64 Let's take as an example the following binary string: 001101100011010101001001001101000001010010110010110 String Position Number of this string Position Number in binary 0 1 0001 01 2 0010 1 3 0011 011 4 0100 00 5 0101 0110 6 0110 10 7 0111 101 8 1000 001 9 1001 0010 10 1010 01101 11 1011 000 12 1100 00101 13 1101 001011 14 1110 0010110 15 1111