This is an implementation of Huffman code. Content:
%NORM2HUFF Huffman codification (encoder)
%HUFF2NORM Huffman codification (decoder)
%HUFFCODES2BIN Convert huffcodes to binary representation
Max codeword length is 51 bits.
Giuseppe Ridinò (2020). Huffman code (https://www.mathworks.com/matlabcentral/fileexchange/4900-huffman-code), MATLAB Central File Exchange. Retrieved .
1 0 2 0 0 0 3 4 5 4 4 4 4 9 8 5 2 1 0 1 0 1 1 1 9 9 8 7 7 7 7 7 7 5 7 7 6 8 8 6 6 6 6 6 6 0 1 2 2 3 3 4 4 5 2 2 2 4 7 7
thanks very much
It works perfectly but only for unsigned data. good work done Thanks
ru guys sure if a Matlab program works out a Huffman code for this source.
please help me.....
can u send d file as m file or text...
please help me
It's great nice job Giuseppe! thank you so mutch...
involve basic programming also...
have a look
i like matlab codes
I ask for the huffman encode/decode.
I am student of communication engineering
therefore I am taking acourse on coding theory so let's cooperate.
i want huffman code , because i have some project by it please send it to me in my e-mail if that possible . thank's
Works great. Thanks!
It worked perfectly and fast enough for me. The comment 'worst code i ever saw' is a discouraging comment for this submission! I was hesitating for downloading it, but then I gave it a go and it was a perfect solution. Thanks.
worst code i ever saw
if you change the following lines of the code this is probably one of the fastest huffman codes for matlab:
--- norm2huff.m ---
%f = frequency(vector);
% frequency function is obsolete
% hist function is much, much faster!!!
f = hist( double( vector(:) ), 0:65535 );
f = f/sum(f);
Note: I also updated the script to handle uint16 instead of uint8; so for uint8 maybe try the following hist function: ...hist(...,0:255)
Improved speed of frequency function. Added demo, test and benchmark.
New function added: huffcodes2bin.m