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

5 ビュー (過去 30 日間)
mahack
mahack 2017 年 5 月 23 日
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 Center および File ExchangeAudio Processing Algorithm Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by