Calculating the SNR of quantized audio

1 次查看(过去 30 天)
I'm trying to calculate the SNR of my original audio signal and the quantization signal from 16 bits down to 1 bit.
My original audio signal is:
signal = getaudiodata(recording, 'int16');
I'm using bitshift to remove the LSB:
quantsignal = bitshift(quantsignal, -1);
How to I now calculate the SNR of signal and quantsignal?

回答(1 个)

Image Analyst
Image Analyst 2018-8-5
Looks like you're not scaling back up when you divide by 2. You're not just removing bits, you're cutting the amplitude in half also.
Why not just use bitset() to start clearing bits?
  2 个评论
Vinci
Vinci 2018-8-5
I've tried replacing:
% Remove LSB using division
quantsignal = quantsignal/2;
With:
% Remove LSB using bitshift
quantsignal = bitshift(quantsignal, -1);
But still not working correctly.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by