How to calculate Compression Ratio for Signal?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I am looking for help. I need to calculate the compression ratio for signal in matlab. Pls any one know, the implmentation!
0 个评论
回答(1 个)
Walter Roberson
2013-12-27
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 个评论
Walter Roberson
2013-12-27
"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".
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Denoising and Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!