Function File: sig = huffmandeco (hcode, dict)

Decode signal encoded by huffmanenco.

This function uses a dict built from the huffmandict and uses it to decode a signal list into a Huffman list. A restriction is that hcode is expected to be a binary code

The returned sig set that strictly belongs in the range [1,N] with N = length (dict). Also dict can only be from the huffmandict routine. Whenever decoding fails, those signal values a re indicated by -1, and we successively try to restart decoding from the next bit that hasn’t failed in decoding, ad-infinitum. An example of the use of huffmandeco is:

hd    = huffmandict (1:4, [0.5 0.25 0.15 0.10]);
hcode = huffmanenco (1:4, hd);
back  = huffmandeco (hcode, hd)
    ⇒ [1 2 3 4]

See also: huffmandict, huffmanenco.

Package: communications