File Exchange

image thumbnail

Huffman code

version 1.0 (18.6 KB) by

Simple Huffman code implementation.

3.34375
27 Ratings

22 Downloads

Updated

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.

Comments and Ratings (37)

Xyz Kumar

X Y

X Y (view profile)

hongzhi yang

nice

hadia kiran

v nice

Jian

Jian (view profile)

thanks very much

Great

william ?

Thank you!

AMAR

AMAR (view profile)

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

pingker

好东西,谢谢~

avinash mitta

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

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
MATLAB 6.1 (R12.1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video