[LAD] Calculate R M S

Georg Holzmann grh at mur.at
Thu Feb 17 19:09:27 UTC 2011


Hallo!

> I wanna normalize my sound stream by loudness (energy / pressure /
> intensity) , not by peaks.
> How i do it ?
> Is available Jack plugin for so what ?

You might look into the replay gain standard:
http://replaygain.hydrogenaudio.org/

There is also a libreplaygain somewhere around - look also at 
http://en.wikipedia.org/wiki/Replay_Gain for implementations.
(I have also seen once a small commandline program for replay gain 
normalization, can't find it ATM ...)

> What is (we hear as) "loudness" ?
> RMS or +(average) or something else ?

That's not as easy as one might think ...
Calculating the RMS level is a good start, but there are other things to 
consider:

- from the replay gain side: "The human ear does not perceive sounds of 
all frequencies as having equal loudness. For example, a full scale sine 
wave at 1kHz sounds much louder than a full scale sine wave at 10kHz, 
even though the two have identical energy. To account for this, the 
signal is filtered by an inverted approximation to the equal loudness 
curves (sometimes referred to as Fletcher-Munson curves)."

- Try e.g. to calculate the loudness of speech: the RMS value will be 
much lower as perceived, because during speech there are periods of 
silence which are included in the RMS calculation, but we perceive the 
loudness only from the parts where the voice is active.
Replay gain tries to consider this problem by doing some statistical 
post-processing (see 
http://replaygain.hydrogenaudio.org/statistical_process.html).
However, there are different approaches for that: e.g. only calculate 
the RMS value from regions where the voice is active (requires some 
voice activity detection).

LG
Georg

-- 
http://grh.mur.at



More information about the Linux-audio-dev mailing list