This document contains formulas and definitions related to information theory and source coding. It defines key terms like entropy, average length, source/code efficiency, and redundancy. It also provides formulas to calculate these metrics for sources with different probabilities, and extended sources. Formulas are given for encoding sources using Huffman coding in ternary and quaternary systems.
1. INFORMATION THEORY AND
CODING
5th SEM E&C
JAYANTHDWIJESH H P M.tech (DECS)
Assistant Professor โ Dept of E&C
B.G.S INSTITUTE OF TECHNOLOGY (B.G.S.I.T)
B.G Nagara, Nagamangala Tq, Mandya District- 571448
2. FORMULAS FOR REFERENCE
MODULE โ 2 (source coding)
๏ถ Entropy of source or Average information content of the source.
H(S) = ๐ท๐ ๐ฅ๐จ๐ (
๐
๐ท ๐
๐
๐=๐ ) bits/symbol or H(S) = ๐ท ๐ฒ ๐ฅ๐จ๐ ๐ ๐ (
๐
๐ท ๐ฒ
๐ต
๐ฒ=๐ ) bits/symbol
๏ถ Average length
L = ๐ท๐
๐
๐=๐ ๐๐ bits/symbol or L = ๐ท๐
๐ต
๐=๐ ๐๐ bits/symbol
๏ถ Source or code efficiency
๐ผ ๐บ=
๐ฏ(๐บ)
๐ณ
X ๐๐๐% or ๐ผ ๐ช=
๐ฏ(๐บ)
๐ณ
X ๐๐๐%
๏ถ Source or code redundancy
๐น ๐ผ ๐บ
= 1- ๐ผ ๐บ = (1 -
๐ฏ(๐บ)
๐ณ
) X ๐๐๐% or ๐น ๐ผ ๐ช
= 1- ๐ผ ๐ช = (1 -
๐ฏ(๐บ)
๐ณ
) X ๐๐๐%
๏ถ Compute the number of stages required for the encoding operation, which is
given by
๐ =
๐ตโ๐
๐โ๐
or ๏ก =
๐โ๐
๐โ๐
๏ถ The probability of โ0โs and โ1โs and โ2โ s in the code are found using the
formulas
P (0) =
๐
๐ณ
[๐๐ฎ๐ฆ๐๐๐ซ ๐จ๐ "0" s in the code for
๐
๐=๐ ๐ฟ๐ ] [๐๐ ] or
P (0) =
๐
๐ณ
[๐๐ฎ๐ฆ๐๐๐ซ ๐จ๐ "0" s in the code for๐ต
๐=๐ ๐ฟ๐ ] [๐๐ ] .
P (1) =
๐
๐ณ
[๐๐ฎ๐ฆ๐๐๐ซ ๐จ๐ "1" s in the code for
๐
๐=๐ ๐ฟ๐ ] [๐๐ ] or
P (1) =
๐
๐ณ
[๐๐ฎ๐ฆ๐๐๐ซ ๐จ๐ "1" s in the code for๐ต
๐=๐ ๐ฟ๐ ] [๐๐ ] .
P (2) =
๐
๐ณ
[๐๐ฎ๐ฆ๐๐๐ซ ๐จ๐ "2" s in the code for
๐
๐=๐ ๐ฟ๐ ] [๐๐ ] or
P (2) =
๐
๐ณ
[๐๐ฎ๐ฆ๐๐๐ซ ๐จ๐ "2" s in the code for๐ต
๐=๐ ๐ฟ๐ ] [๐๐ ] .
๏ถ The variance of the word length is calculated from
Var ( ๐๐ ) = E [( ๐๐ โ ๐ ) ๐
= ๐ท๐
๐
๐=๐ ( ๐๐ โ ๐ ) ๐
๏ถ The Smallest integer value of ๐๐ if found using
๐ ๐ ๐ ๏ณ
๐
๐ท๐
or ๐๐ ๏ณ ๐๐๐ ๐
๐
๐ท๐
๏ถ The average length ๐ณ ๐ of the 2nd
extension is given by
๐ณ ๐ = ๐ท๐
๐
๐=๐ ๐๐ bits/symbol or ๐ณ ๐ = ๐ท๐
๐ต
๐=๐ ๐๐ bits/symbol
3. ๏ถ The average length ๐ณ ๐ of the 3rd
extension is given by
๐ณ ๐ = ๐ท๐
๐
๐=๐ ๐๐ bits/symbol or ๐ณ ๐ = ๐ท๐
๐ต
๐=๐ ๐๐ bits/symbol
๏ถ The entropy of the 2nd extended
source is calculated as
H (๐บ ๐
) = 2 H(S)
๏ถ The entropy of the 3rd extended
source is calculated as
H (๐บ ๐
) = 3H(S)
๏ถ Source or code efficiency of the 2nd
extended source is
๐ผ(๐)
๐บ
=
๐ (๐บ ๐
)
๐ณ ๐
X ๐๐๐% or ๐ผ(๐)
๐ช
=
๐ (๐บ ๐
)
๐ณ ๐
X ๐๐๐%
๏ถ Source or code redundancy of the 2nd
extended source is
๐น(๐)
๐ผ ๐บ
= 1- ๐ผ(๐)
๐บ
= (1 -
๐ (๐บ ๐)
๐ณ ๐
) X ๐๐๐% or ๐น(๐)
๐ผ ๐ช
= ๐ โ ๐ผ(๐)
๐ช
= (1 -
๐ (๐บ ๐)
๐ณ ๐
)
๐ ๐๐๐%
๏ถ Source or code efficiency of the 3rd
extended source is
๐ผ(๐)
๐บ
=
๐ (๐บ ๐
)
๐ณ ๐
X ๐๐๐% or ๐ผ(๐)
๐ช
=
๐ (๐บ ๐
)
๐
X ๐๐๐%
๏ถ Source or code redundancy of the 3rd
extended source is
๐น(๐)
๐ผ ๐บ
= 1- ๐ผ(๐)
๐บ
= (1 -
๐ (๐บ ๐)
๐ณ ๐
) X ๐๐๐% or ๐น(๐)
๐ผ ๐ช
= ๐ โ ๐ผ(๐)
๐ช
= (1 -
๐ (๐บ ๐)
๐ณ ๐
)
๐ ๐๐๐%
๏ถ The average length ๐ณ ๐
of the Huffman ternary code is given by
๐ณ(๐)
= ๐ท๐
๐
๐=๐ ๐๐ trinits /Msg- symbol or ๐ณ(๐)
= ๐ท๐
๐ต
๐=๐ ๐๐ trinits / Msg- symbol
๏ถ The average length ๐ณ ๐
of the Huffman quaternary code is given by
๐ณ(๐)
= ๐ท๐
๐
๐=๐ ๐๐ quaternary digits /Msg- symbol or
๐ณ(๐)
= ๐ท๐
๐ต
๐=๐ ๐๐ quaternary digits / Msg- symbol
๏ถ The entropy in ternary units/ message symbol is found by using equation
๐ ๐(S) =
๐(๐)
๐๐๐ ๐ ๐
ternary units/ message symbol or
๐ ๐(S) = ๐ท ๐ฒ ๐ฅ๐จ๐ ๐ ๐ (
๐
๐ท ๐ฒ
๐ต
๐ฒ=๐ ) ternary units/ message symbol or
๐ ๐(S) = ๐ท๐ ๐ฅ๐จ๐ ๐ ๐ (
๐
๐ท ๐
๐
๐=๐ ) ternary units/ message symbol
๏ถ The entropy in quaternary units/ message symbol is found by using equation
๐ ๐(S) =
๐(๐)
๐๐๐ ๐ ๐
quaternary units/ message symbol or
4. ๐ ๐(S) = ๐ท ๐ฒ ๐ฅ๐จ๐ ๐ ๐ (
๐
๐ท ๐ฒ
๐ต
๐ฒ=๐ ) quaternary units/ message symbol or
๐ ๐(S) = ๐ท๐ ๐ฅ๐จ๐ ๐ ๐ (
๐
๐ท ๐
๐
๐=๐ ) quaternary units/ message symbol
๏ถ Source or code efficiency of the ternary is given by
๐ผ ๐(๐)
=
๐ ๐(๐)
๐ณ(๐)
X ๐๐๐% or ๐ผ ๐(๐)
=
๐ ๐(๐)
๐ณ(๐)
X ๐๐๐% or
๐ผ ๐บ=
๐ ๐(๐)
๐ณ
X ๐๐๐% or ๐ผ ๐ช=
๐ ๐(๐)
๐ณ
X ๐๐๐%
๏ถ Source or code efficiency of the quaternary is given by
๐ผ ๐(๐)
=
๐ ๐(๐)
๐ณ(๐)
X ๐๐๐% or ๐ผ ๐(๐)
=
๐ ๐(๐)
๐ณ(๐)
X ๐๐๐% or
๐ผ ๐บ=
๐ ๐(๐)
๐ณ
X ๐๐๐% or ๐ผ ๐ช=
๐ ๐(๐)
๐ณ
X ๐๐๐%
๏ถ Source or code redundancy of the ternary is given by
๐น ๐ผ ๐(๐)
= 1- ๐ผ ๐(๐)
= (1 -
๐ ๐(๐)
๐ณ(๐) ) X ๐๐๐% or
๐น ๐ผ ๐(๐)
= ๐ โ ๐ผ ๐(๐)
= (1 -
๐ ๐(๐)
๐ณ(๐) ) ๐ ๐๐๐% or
๐น ๐ผ ๐บ
= 1- ๐ผ ๐บ = (1 -
๐ ๐(๐)
๐ณ
) X ๐๐๐% or ๐น ๐ผ ๐ช
= 1- ๐ผ ๐ช = (1 -
๐ ๐(๐)
๐ณ
) X ๐๐๐%
๏ถ Source or code redundancy of the quaternary is given by
๐น ๐ผ ๐(๐)
= 1- ๐ผ ๐(๐)
= (1 -
๐ ๐(๐)
๐ณ(๐) ) X ๐๐๐% or
๐น ๐ผ ๐(๐)
= ๐ โ ๐ผ ๐(๐)
= (1 -
๐ ๐(๐)
๐ณ(๐) ) ๐ ๐๐๐% or
๐น ๐ผ ๐บ
= 1- ๐ผ ๐บ = (1 -
๐ ๐(๐)
๐ณ
) X ๐๐๐% or ๐น ๐ผ ๐ช
= 1- ๐ผ ๐ช = (1 -
๐ ๐(๐)
๐ณ
) X ๐๐๐%