DC Expt 6 - Huffman
DC Expt 6 - Huffman
Tech (ECE)
Trimester: V Subject: DC
Name: Class:
Roll No: Batch:
Experiment No: 6
Marks Teacher’s Signature with date
Performed on:
Submitted on:
Develop a MATLAB code for the same using functions huffmandict, huffmanenco,
huffmandeco
THEORY:
Procedure for implementation of Huffman algorithm:
User inputs:
1. Discrete memoryless Source probabilities.
Program outputs:
1. Source code i.e. List of Codewords corresponding to all source symbols.
2. Average codeword length
3. Efficiency of the source code
4. Verification of generation of unique and instantaneous decodable code using Kraft
inequality
5. Code variance, σ2
Avg. codeword length L = (Pi * Li) where Li is the length of ith codeword.
1
Also calculate Kraft inequality parameter K= (2-Li) and verify that K ≤1 and
Study questions:
1. What is the disadvantage of Huffman algorithm?
2. What is an Optimum source code?
3. What is prefix free condition?
4. State source coding theorem or Shannon’s first theorem.
5. A DMS with 5 symbols and probabilities as Pi = [ 0.2, 0.4, 0.1, 0.2, 0.1] is used.
Generate Huffman code for the DMS and verify your results using the MATLAB code.