Huffman Coding Using MATLAB (PoojaS)
Huffman Coding Using MATLAB (PoojaS)
Huffman Coding Using MATLAB (PoojaS)
USING MATLAB
Internal Guide : SVMG Phani Kumar C
ECE-B Coordinator : Mrs. Neha Jain
S. Poojitha (14321A0474)
M. Rupa (14321A04A0)
B. Sai Sruthi (14321A04A6)
Contents
Aim
Block Diagram
Huffman Coding
Flow Chart of Huffman algorithm
Nature of Huffman coding
Matlab
Specific Syntaxes
Result
Advantages and Applications
Conclusion and Future scope
Aim
The most frequent character gets the smallest code and the least
frequent character gets the largest code.
Why Huffman coding is preferred?
• Now start encoding with last reduction which contains two ordered
probabilities. Assign ‘0’ to higher probability and ‘1’ to the lower.
• Trace back and assign 0 & 1 in the second digit for the two
probabilities by which it was obtained in the previous reduction
process.
100 %
0 1
45 % 55 %
a = 0
0 1
25 % 30 %
0 1 0 1
12 % 13 % 14 % 16 %
c = 100 b = 101 d = 111
0 1
5% 9%
f = 1100 e = 1101
Nature of Huffman Coding
• Prefix Code:
• Efficiency:
[dict,avglen]= huffmandict(symbols,p)
temp{i,2}=num2str(temp{I,2})
This encodes signal system using the Huffman codes described by the
code dictionary dict.
decod=huffmandeco(bits,dict)
This decodes the numeric Huffman code vector bits using the code
dictionary dict.
RESULT
Advantages
Applications
The result shows that higher code redundancy helps to achieve more
compression.
The result also reveals that original data used for coding is almost
same as the decoded output.
http://www.prepressure.com/library/compression-
algorithms/huffman