No BSD License  

Highlights from
Huffman code

3.95

4.0 | 21 ratings Rate this file 142 Downloads (last 30 days) File Size: 18.6 KB File ID: #4900

Huffman code

by Giuseppe Ridinò

 

11 May 2004 (Updated 06 Jul 2004)

Simple Huffman code implementation.

| 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)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags

Use commas to separate your tags

Comments and Ratings (29)
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

好东西,谢谢~

19 Aug 2010 AMAR

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

01 Nov 2010 william ?

Thank you!

Rate this Submission

(Rating not required)

Comment on this Submission

 
 

Please remember the following when providing feedback on a submission:

  • Be considerate of the file's author and other community members.
  • Provide specific information on what you like and dislike about the submission.
  • Use examples to illustrate your point.
  • Share your experiences with similar submissions.
  • Comments containing profanity, vulgarity, or an offensive tone will be removed from the site.
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
codification Giuseppe Ridinò 22 Oct 2008 07:19:32
code 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
coding theory avinash gowda.M 10 Nov 2010 09:24:45
binary representation Adrien 16 May 2011 10:00:37
binary representation Adrien 16 May 2011 10:00:37
code dimitris 03 Jun 2011 18:35:36

Contact us at files@mathworks.com