
HuffmanBasic |
ptolemy.actor.lib.comm.HuffmanBasic |
Given a probability distribution, generate the Huffman code book.
The probability distribution is given by the <i>pmf</i> parameter.
The corresponding alphabet is given by the <i>alphabet</i> parameter.
The code book is in a format of an array of strings, each string
consists of '0' and '1's. The code book is sent to the
<i>huffmanCodeBook</i> output port.
Author(s): Ye Zhou
Version:$Id: HuffmanBasic.doc.html,v 1.1 2006/02/22 18:41:22 mangal Exp $
Pt.Proposed Rating:Red (zhouye)
Pt.Accepted Rating:Red (cxh)
huffmanCodeBook
A port that produces the Huffman code book generated
based on the probability mass function. It is an array
of strings.
pmf
The probability mass function. This parameter is an array
of doubles. Each element should be positive and the sum of
all elements should be 1.0. The default value is {0.5, 0.5}.
alphabet
The alphabet of the input. This parameter is an ArrayToken.
Its default value is {0, 1}.