Returns the Huffman encoded signal using dict. This function uses
a dict built from the huffmandict
and uses it to encode a
signal list into a Huffman list. A restrictions is that a signal set must
strictly belong in the range [1,N]
with N = length (dict)
.
Also dict can only be from the huffmandict
routine.
An example of the use of huffmanenco
is
hd = huffmandict (1:4, [0.5 0.25 0.15 0.10]); huffmanenco (1:4, hd) ⇒ [1 0 1 0 0 0 0 0 1]
See also: huffmandict, huffmandeco.
Package: communications