Coding-Part 2
Coding-Part 2
Moghe
Professor, Department of Information Technology
UIT RGPV-Bhopal
ShannonFano Coding
Examples with M=2
Example with M=3
Aims to construct reasonably efficient
separable binary codes.
Let [X] –ensemble of messages to be
transmitted.
[P] – be their corresponding
probabilities
C k - sequence of binary numbers of
length nk associated with xk message,
must fulfill following criteria
(1)No sequences of employed binary
numbers Ck can be obtained from each
other by adding more binary digits to the
shorter sequence(prefix property)
The
message set is then partitioned into two
most equi-probable subsets [X1] and [X2].
(1 / 16 4) (1 / 4 2) (1 / 16 4) (1 / 8 3)
2.75letters / message
8
H ( X ) pk log( pk )
k 1
7
H ( X ) pk nk [(0.4 log 0.4) (0.2 log 0.2) (0.12 log 0.12)
k 1
H (X ) 2.42
96.03%
L log M 2.52 log 2
[X] = [x1 x2 x3 x4 x5 x6 x7]
[p] = [0.4 0.2 0.12 0.08 0.08 0.08 0.04]
Message Probability Encoded Length(ni)
(pi) Message
X1 0.4 0 1
X2 0.2 1 0 0 3
X3 0.12 1 0 1 3
X4 0.08 1 1 0 0 4
X5 0.08 1 1 0 1 4
X6 0.08 1 1 1 0 4
x7 0.04 1 1 1 1 4
7
L pk nk (0.4 1) (0.2 3) (0.12 3) (0.08 4)
k 1
7
H ( X ) pk nk [(0.4 log 0.4) (0.2 log 0.2) (0.12 log 0.12)
k 1
H (X ) 2.42
97.6%
L log M 2.48 log 2
Shannon
Fano coding method is
ambiguous.
H (X ) 2.42
88.7%
L log M 1.72 log 3
R. P
Singh & S.D Sapre, Communication
Systems