File Exchange

image thumbnail

Huffman code

version 1.0.0.0 (18.6 KB) by Giuseppe Ridinò
Simple Huffman code implementation.

29 Downloads

Updated 06 Jul 2004

No License

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.

Cite As

Giuseppe Ridinò (2020). Huffman code (https://www.mathworks.com/matlabcentral/fileexchange/4900-huffman-code), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (40)

Yusuf Yasar

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

Xyz Kumar

X Y

nice

hadia kiran

v nice

Jian

thanks very much

Great

william ?

Thank you!

AMAR

It works perfectly but only for unsigned data. good work done Thanks

pingker

好东西,谢谢~

3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18

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

Edson Rodrigues

It's great nice job Giuseppe! thank you so mutch...

Ketan Agrawal

nice

abhishek karnattak

involve basic programming also...

Mahmoud ahmad

very nice

Rodhwan Al-Hetar

thanks,Download Now

ahmet seyit

li quan

have a look

monmon monmon

i like matlab codes

shabnam zandesh

RAMZI Allal

I ask for the huffman encode/decode.
th's

pook pookie

good very

minh tin

amir suzzia

Jawed Qumar

Amanuel Tadesse

I am student of communication engineering
therefore I am taking acourse on coding theory so let's cooperate.

Ketan Agrawal

No comments

george gabra

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

mic ed

thank u

Shoaib Iqbal

Michael Kleder

Works great. Thanks!

chau bao

huffman

Aytac Sen

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.

rakesh v

worst code i ever saw

Florian Füessl

Hi,

if you change the following lines of the code this is probably one of the fastest huffman codes for matlab:
--- norm2huff.m ---
% frequency
%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)

A B

Updates

1.0.0.0

Improved speed of frequency function. Added demo, test and benchmark.

New function added: huffcodes2bin.m
% [W,S] = HUFFCODES2BIN(HC) returns the Huffman representation HC returned
% by the function NORM2HUFF to the corresponding binary strings of '0' and '1'

MATLAB Release Compatibility
Created with R12.1
Compatible with any release
Platform Compatibility
Windows macOS Linux