Calculating the SNR of quantized audio

1 Ansicht (letzte 30 Tage)
Vinci
Vinci am 5 Aug. 2018
Bearbeitet: Vinci am 6 Aug. 2018
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?

Antworten (1)

Image Analyst
Image Analyst am 5 Aug. 2018
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 Kommentare
Vinci
Vinci am 5 Aug. 2018
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.
Image Analyst
Image Analyst am 5 Aug. 2018
Why not try imquantize()?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulation, Tuning, and Visualization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by