03-11-2016, 09:24 AM
1463650972-HuffmanCodinganddecoding.docx (Size: 12.62 KB / Downloads: 3)
Aim: Write a program for generation and evaluation of variable length source coding
using
a) Shannon – Fanocoding and decoding
b) Huffman Coding and decoding
. Objective:
1. Calculate the efficiency of Shanon Fano Coding.
2. Calculate the efficiency of Huffman Coding.
Software Requirement: MATAB
Theory
SHANNON- FANO CODING:
It is a type of source coding Shannon theorem. The design of variable length code such that its
average code word length approaches the entropy of discrete less source is called entropy
coding.
An efficient code can be obtained by this method:
1. List the source symbol in order of decreasing probability.
2. Partition the set into two set that are as close as equiprobable and assign 0 to the each
msg. in upper set and 1 to each msg. in lower set.
3. Continue this process each time partitioning the sets with nearly equal probabilities as
nearly equal time partitioning is possible.
Algorithm:
1. Input ‘n’ number of messages.
2. Input the values of probabilities.
3. Arrange the messages in decreasing order of probabilities.
4. Divide the mes. Into two equiprobable set X1 and X2
5. Assign ‘0’ to all msg. in X1.
6. Assign ‘1’ to all msg. in X2.