huffcode Huffman Coding Toolbox huffman

Huffman Coding Toolbox >> Huffman Coding Toolbox > huffdeco

huffdeco

Decoding of a compressed bit sequence.

Calling Sequence

B=huffdeco(QT,QM);

Parameters

QT:

the compressed bit sequence, represented by a string containing 1s and 0s

QM:

The huffman code table, containing symbols, bit sequence of a symbol and number of bits per symbol

B:

the decoded (uncompressed) sequence.

Description

huffdeco is the reverse operation to huffcode. The output arguments of huffcode can directly be used as input arguments for huffdeco

Examples

// Generate a Testmatrix
A=testmatrix('frk',10)+1;
A=A(:).';
[QT,QM]=huffcode(A);
disp('compressed Bit sequence:');
disp(QT);
disp('Code Table:');
disp(QM);
// Now, the reverse operation
B=huffdeco(QT,QM);
disp('Original:');
disp(A);
disp('Result after Uncompress:');
disp(B);
plot2d(B-A);

See also

Authors

huffcode Huffman Coding Toolbox huffman