Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

matlab code for huffman code

Status
Not open for further replies.

adityabvmk

Junior Member level 2
Joined
Dec 23, 2010
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,402
can anybody please give the code for huffman coding in matlab....
 

can anybody please give the code for huffman coding in matlab....
Huffman Code is very easy..
MATLAB has an inbuilt code to get the Huffman coding, i.e. "Huffmanenco"
You can use it...Search fot this function in MATLAB and you will get the required details...
 
actually i want the code not the inbuilt function in matlab....thanks for reply
 

actually i want the code not the inbuilt function in matlab....thanks for reply

I think this will work.........
Code:
clc;
clear all;
close all;
sig=1:4;
Symbols=[1 2 3 4];
P=[0.1 0.3 0.4 0.2];
dict = huffmandict(Symbols,P);
temp=dict;
for i=1: length(temp)
    temp {i,2}= num2str(temp{i,2});
end
disp(temp);
hcode= huffmanenco(sig,dict)
dhsig= huffmandeco(hcode, dict)
 
that is ok...i want the background code for "huffmanenco" and "huffmandeco"....i think u got it now..
 

can you please help me to do a huffman compression on a character string. For eg., i need to perform huffman compression on the statement 'This is an eg for huffman compression. This is a working algorithm. This has a significant compression ratio'. Thanks in advance....


I think this will work.........
Code:
clc;
clear all;
close all;
sig=1:4;
Symbols=[1 2 3 4];
P=[0.1 0.3 0.4 0.2];
dict = huffmandict(Symbols,P);
temp=dict;
for i=1: length(temp)
    temp {i,2}= num2str(temp{i,2});
end
disp(temp);
hcode= huffmanenco(sig,dict)
dhsig= huffmandeco(hcode, dict)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top