14-02-2013, 04:54 PM
TRANSFORM BASED COMPRESSION TECHNIQUE
%Huffman coding
close all;
clear all;
clc;
b=repmat([3 3 1 3 3 3 2 3 3 3],1,100);
symbols=[1,2,3];
p=[.5,.25,.25];
dict=huffmandict(symbols,p);
huffmancode=huffmanenco(b,dict);
%Arithmetic coding
b=repmat([3 3 1 3 3 3 2 3 3 3],1,100);
counts=[10 10 80];
arithmeticcode=arithenco(b,counts);
whos;
OUTPUT:
Name Size Bytes Class
arithmeticcode 1x930 7440 double array
b 1x1000 8000 double array
counts 1x3 24 double array
dict 3x2 424 cell array
huffmancode 1x1900 15200 double array
p 1x3 24 double array
symbols 1x3 24 double array
Grand total is 3853 elements using 31136 bytes