<< huffdeco Huffman Coding Toolbox huffmandict >>

Huffman Coding Toolbox >> Huffman Coding Toolbox > huffman

huffman

Huffman Coding based upon a histogram vector

Calling Sequence

[SB,h,L,QM,avglen,entr,eff]=huffman(H)

Parameters

H:

a histogram vector (also sparse input possible)

SB:

a vector, representing symbols

h:

the normalized histogram vector

L:

number of bits used for coding the corresponding symbol

QM:

the complete code table as string vector. The symbol, the bit sequence and the number of bits are contained.

avglen:

Average Length based on rel. propabilities and the Sybmol length

entr:

Entropy of H

eff:

Efficiency of the Huffman Coding

Description

This function creates the coding tree based upon a given histogram.

Examples

// Generate a Testmatrix
A=testmatrix('frk',10)+1;
H1=fasthist(A);
//
[SB,h,L,QM]=huffman(H1);
//SB contains the symbols
disp(SB);
// h is the normalized histogram
disp(h);
// L contains the number of bits used for the symbols
disp(L);
// QM is the complete code table,
// containing symbol, bits and no. of bits
disp(QM);

See also

Authors


Report an issue
<< huffdeco Huffman Coding Toolbox huffmandict >>