huffmanenco
Encode sequence of symbols by Huffman encoding
Description
encodes input signal code
= huffmanenco(sig
,dict
)sig
using the Huffman codes described by input
code dictionary dict
. sig
can have the form of a
vector, cell array, or alphanumeric cell array. If sig
is a cell array,
it must be either a row or a column. dict
is an N-by-2 cell array,
where N is the number of distinct possible symbols to encode. The first
column of dict
represents the distinct symbols and the second column
represents the corresponding codewords. Each codeword is represented as a row vector, and no
codeword in dict
can be the prefix of any other codeword in
dict
. You can generate dict
using the huffmandict
function.
Examples
Input Arguments
Output Arguments
References
[1] Sayood, Khalid. Introduction to Data Compression. 2nd ed. San Francisco: Morgan Kaufmann Publishers, 2000.