No BSD License  

Highlights from
Huffman

Be the first to rate this file! 7 Downloads (last 30 days) File Size: 35.82 KB File ID: #15109
image thumbnail

Huffman

by Jaun Dough

 

24 May 2007 (Updated 24 May 2007)

Generates a static minimum-variance Huffman code tree.

| Watch this File

File Information
Description

HUFFMAN Huffman encoder.

C = HUFFMAN(D,W) generates a static minimum-variance Huffman tree and corresponding codebook C for the source symbols with nonnegative weights given by vector W, using a D-ary output code alphabet,
e.g. D = 2 for a binary output code alphabet.
W is an N-vector of nonnegative source symbol weights, where N is the number of source symbols.
The generated Huffman code C minimizes the weighted codeword length,
e.g. if the weight is the probability of the source symbol, then C minimizes the expected codeword length.
C is an N-vector of strings (i.e. cell array) giving the codewords for each of the N source symbols in W.

C = HUFFMAN(D,W,L,'screen') additionally displays a simple text rendition of the resulting Huffman code tree, with the source symbol labels given by L. L is an N-vector of strings (i.e. cell array)
containing the labels for each of the N source symbols.

C = HUFFMAN(D,W,L,'dot') additionally creates a DOT file describing the resulting Huffman code tree, and runs Graphviz DOT to create the
corresponding PNG image. The output files are automatically time-stamped. The source symbol labels are given by L, which is an N-vector of strings (i.e. cell array) containing the labels for each of the N source symbols. Please ensure that Graphviz DOT is accessible from the current directory (e.g. by adding it to the path).

Multiple output can be requested using a single command, e.g.
C = HUFFMAN(D,W,L,'dot','screen')

MATLAB release MATLAB 7.4 (R2007a)
Other requirements (optional) Graphviz DOT for generating an image of the Huffman code tree
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
29 Nov 2007 boris vargas

that good site

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
coding theory Jaun Dough 22 Oct 2008 09:13:44
information theory Jaun Dough 22 Oct 2008 09:13:44
huffman Jaun Dough 22 Oct 2008 09:13:44
encoder Jaun Dough 22 Oct 2008 09:13:44
code tree Jaun Dough 22 Oct 2008 09:13:44
static minimum Jaun Dough 22 Oct 2008 09:13:44
variance Jaun Dough 22 Oct 2008 09:13:44
codebook Jaun Dough 22 Oct 2008 09:13:44
c Jaun Dough 22 Oct 2008 09:13:44

Contact us at files@mathworks.com