3.83333

3.8 | 19 ratings Rate this file 369 downloads (last 30 days) File Size: 18.6 KB File ID: #4900

Huffman code

by Giuseppe Ridinò

 

11 May 2004 (Updated 06 Jul 2004)

No BSD License  

Simple Huffman code implementation.

Download Now | Watch this File

File Information
Description

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.

MATLAB release MATLAB 6.1 (R12.1)
Zip File Content  
Other Files
frequency.m,
huff2norm.m,
huffman_demo1.m,
norm2huff.m,
Discalmer.txt,
ReadMe.txt,
huffman_docs.zip,
huffcodes2bin.m,
huffman_bench1.m,
huffman_bench2.m,
huffman_demo2.m,
huffman_test1.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (27)
19 May 2004 A B  
02 Jul 2004 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)

29 Nov 2004 rakesh v

worst code i ever saw

08 Dec 2004 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.

21 Jan 2005 chau bao

huffman

22 Mar 2005 Michael Kleder

Works great. Thanks!

18 May 2005 Shoaib Iqbal  
19 Jun 2005 mic ed

thank u

25 Jun 2005 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

20 Feb 2006 Ketan Agrawal

No comments

06 Jul 2006 Amanuel Tadesse

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

02 Aug 2006 Jawed Qumar  
10 Oct 2006 amir suzzia  
19 Oct 2006 minh tin  
27 Oct 2006 pook pookie

good very

06 Nov 2006 RAMZI Allal

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

20 Feb 2007 shabnam zandesh  
29 Mar 2007 monmon monmon

i like matlab codes

09 Apr 2007 li quan

have a look

17 Apr 2007 ahmet seyit  
22 Dec 2007 Rodhwan Al-Hetar

thanks,Download Now

14 Jan 2008 Mahmoud ahmad

very nice

12 Feb 2008 abhishek karnattak

involve basic programming also...

15 Apr 2008 Ketan Agrawal

nice

27 May 2008 Edson Rodrigues

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

25 Mar 2009 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

14 May 2009 pingker

好东西,谢谢~

Please login to add a comment or rating.
Updates
25 May 2004

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'

06 Jul 2004

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

Tag Activity for this File
Tag Applied By Date/Time
coding theory Giuseppe Ridinò 22 Oct 2008 07:19:32
information theory Giuseppe Ridinò 22 Oct 2008 07:19:32
huffman compression Giuseppe Ridinò 22 Oct 2008 07:19:32
binary representation Giuseppe Ridinò 22 Oct 2008 07:19:32
code Giuseppe Ridinò 22 Oct 2008 07:19:32
codification Giuseppe Ridinò 22 Oct 2008 07:19:32
huffman compression Guida Henriques 12 May 2009 07:24:06
code Guida Henriques 12 May 2009 07:24:12
huffman compression Amir Junny 16 May 2009 04:46:26
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com