Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Discussion Groups | Matlab DSP | Compression Ratio of Huffman Code

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

Compression Ratio of Huffman Code - maha devi - Feb 29 7:26:23 2008



*FEBRUARY 29,2008*
Hi friends,

*can anyone tell me how to calculate the compression ratio of huffman
code...*
**
actually the formula is   *compressed file size (bytes) *
*                                     original file size (bytes)*
**
i ran ma code in matlab..

in my MATLAB workspace,the original file is displayed as (1X 7386) char
array..and since 2 bytes are alloted for a char..its byte size is displayed
as 14772 bytes.

the encoded sequence array is displayed as (1X33153) double array...and
since it is double array .8 bytes are alloted for each symbol...so its byte
size is displayed as 265224 bytes.

i tried to save both original file and compressed file as txt file using the
"fopen" and "fwrite" command in matlab....still the encoded file has more
bytes..since the encoded "1's" and "0's" are written as integers and that
it
is taking 4bytes...

so how can i calculate my compression ratio???
ANY REPLY WOULD BE OF GREAT HELP..

Awaiting your replies...

Thanks In advance,

Regards,
Mahadevi



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )