[MPlayer-dev-eng] [PATCH] audio filter volnorm2 - two-pass audio normalizer

Rich Felker dalias at aerifal.cx
Sat Jul 30 18:35:22 CEST 2005


On Sat, Jul 30, 2005 at 11:17:03PM +0700, Vladislav Naumov wrote:
> > > volnorm2 - two-pass audio normalizer.
> > > This filter should become a 2-pass audio normalizer:
> > > on first pass, it should analyze audio for peak value
> > > and store it in file, and on second act as "volume",
> > > amplifying sound.
> > > Currently only 1st pass is implemented.
> > > It can be used to find peak/gain values.
> > > Something like "cropdetect" filter, but for sound.
> > 
> > I'm against this if it's left as a peak normalizer. Peak normalization
> > is always incorrect and morons keep asking for it, so they'll do it
> > more if a filter is available and ruin the sound. Instead it should be
> > RMS normalization.
> 
> Well, it seems I'm one of those morons :-)
> I am not a sound processing guru, I'm just trying to guess how much can I
> amplify sound before encoding. Peak detection is very simple and it for
> sure won't cause any sound clipping.

It won't clip, but the encoder/decoder will. However most importantly
it just won't do what you want..

> So, as far as I see volnorm2 gives fast and safe answer for stated
> question.
> 
> Ruin a sound? What do you mean?
> You always have a source sound, won't you?
> 
> And what I like in volnorm2 the most - and this is the point!
> - I understand how it works :-)
> 
> Anyway, what is an RMS normalization?

Normalize the average of the squares of all the samples to a fixed
value (selected by the user). If the selected value is too high, some
samples may need to be clipped, so good soft clipping would be
advisible. However if the user chooses a sane value, only very extreme
content will need clipping.

> How it will be better then peak detection?
> (Let me guess: it will normalize more agressively?)

No. Peak has absolutely nothing to do with loudness. RMS does. For
example, suppose I make a wav file with one value of 32767 in it, and
the rest in the range -100 to 100. Your filter won't amplify it at
all, and it will still sound inaudibly quiet. This is an extreme
example, but it's quite often the case in reality that peak
normalization will leave the sound way too soft or make it way too
loud.

> Should I read http://en.wikipedia.org/wiki/Root_mean_square ?

Yes, probably. :)

> What else should I read?
> I want to make volnorm2 as good as I can.

:)

Rich




More information about the MPlayer-dev-eng mailing list