Scilab Function
Last update : 06/02/2007

huffman - Huffman Coding based upon a histogram vector

Calling Sequence

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

Parameters

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);
// End of demo

See Also

huffcode ,   fasthist ,  

Authors

Dr. Andreas Geissler geisslea@web.de