Technical discussion about Matlab and issues related to Digital Signal Processing.
*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