% -*- texinfo -*- % @deftypefn {Function File} {@var{sig} = } huffmandeco (@var{hcode}, @var{dict}) % % Returns the original signal that was Huffman encoded signal using % @code{huffmanenco}. This function uses a dict built from the % @code{huffmandict} and uses it to decode a signal list into a huffman % list. A restriction is that @var{hcode} is expected to be a binary code % The returned signal set that strictly belongs in the range @code{[1,N]} % with @code{N = length(@var{dict})}. Also @var{dict} can only be from the % @code{huffmandict} routine. Whenever decoding fails, those signal values a % re indicated by @code{-1}, and we successively try to restart decoding % from the next bit that hasn't failed in decoding, ad-infinitum. An exmaple % of the use of @code{huffmandeco} is % % @example % @group % hd = huffmandict(1:4,[0.5 0.25 0.15 0.10]) % hcode = huffmanenco(1:4,hd) % [ 1 0 1 0 0 0 0 0 1 ] % huffmandeco(hcode,h d) % [1 2 3 4] % @end group % @end example % @end deftypefn % @seealso{huffmandict, huffmanenco}