How to calculate Compression Ratio for Signal?

Hi, I am looking for help. I need to calculate the compression ratio for signal in matlab. Pls any one know, the implmentation!

Answers (1)

compression_ratio = storage_required_for(CompressedSignal) / storage_required_for(OriginalSignal)
Remember to take into account that the required storage for a location depends upon the datatype (double, uint8, and so on.)

2 Comments

Thanks for suggestion, I am using type single, but i am confused with the formula used for image compression, which is CR=(uncompressed image size/compressed image size)!
"storage required for" is part of "size". "size" does not include only width times height: it has to take into account also bit-planes and the storage requirement per bit-plane per pixel.
Ah, I see I flipped the ratio around in what I wrote. Yes you would normally divide original by compressed size.
type single() uses 4 bytes per location.
If you are using the same datatype for both the compressed and uncompressed signal, then the amount of storage per location factors out of the top and bottom of the ratio. However, it is common in compression for the original source to be "pixels" or "single" or "double" but the compressed data to be in "bytes" or "bits", so it is generally safer to be explicit about the storage, as doing so can help guide your thinking about what the output "really means".

Sign in to comment.

Asked:

on 27 Dec 2013

Commented:

on 27 Dec 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!