Scaling an audio signal to a given rms-in-dB value

7 次查看(过去 30 天)
I need to scale a given audio signal to a given acoustic rms-amplification (60dB) and a given base acoustic pressure (p0=20*10^(-6)). How to do this?
What I've tried so far:
signal=audioread('signal.wav');
RMS_signal_dB = 20*log10(rms(signal)/p0)
% Amplification difference to 60dB
Diff_signal_dB = 60 - RMS_signal_dB;
% Compute factor
Diff_signal = p0 * 10^(Diff_signal_dB/20);
% Scale
new_signal = Diff_signal*signal;
% New value on 60 dB?
new_RMS_signal_dB = 20*log10(rms(new_signal)/p0);
end
The new rms amplification value differs from 60 dB... Could be a mathematical fault, maybe someone can help. Thanks!

回答(0 个)

类别

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