

















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















































Average code length
Assume that symbols of a source alphabet
{ a 1 , a 2 ,…, aM } are generated with probabilities p 1 , p 2 ,…, pM
alphabet is encoded with codes of lengths l 1 , l 2 ,…, lM
M M
1 1 2 2
Variable Length Bit Codings
Variable Length Bit Codings
decoding
Source Symbol
P C 1 C 2 C 3 C 4 C 5 C 6
A 0.6 00 0 0 0 0 0 B 0.25 01 10 10 01 10 10 C 0.1 10 110 110 011 11 11 D 0.05 11 1110 111 111 01 0
Average code length = 1.
Add the generation probability of each symbol to the leaf node
Add 1 or 0 to each of the two branches The probability of the new node is the sum of the probabilities of the two connecting nodes
Huffman code Example
Character (or symbol) frequencies
C .
A .
D .
F .
BF .
B .
E .
Huffman code Example
C .
A .
D .
F .
BF .
B .
BFD .
AC .
E .
ABCDF .
ABCDEF Data Compression 1.
Huffman code Example
Huffman code
code length!