Bug #1017

Normalisation has negative effect if there is e.g. a loud click in file

Added by Simon Dixon over 7 years ago. Updated over 7 years ago.

Status:NewStart date:2014-06-19
Priority:NormalDue date:
Assignee:Matthias Mauch% Done:


Target version:-


Try loading for example dou*-09-55-01-*mp3


#1 Updated by Matthias Mauch over 7 years ago

Ooh, oh, so something must be going terribly wrong there. I didn't know you could de-normalise -- I'll try to have a look tomorrow.

#2 Updated by Chris Cannam over 7 years ago

See CodedAudioFileReader.cpp:320 onwards for calculation of the normalisation gain during decoding.

Maybe I've done something stupid and this is simply a bug.

On the other hand, there's no reason an mp3 decoder couldn't produce samples outside the -1,1 range, in which case normalisation would indeed reduce the level. Any out-of-range samples are explicitly clipped when we're not normalising.

We could change it so that only "upward" normalisation is permitted and continue to clip any samples that start off out-of-range. That would kind of defeat the point of normalisation though: if there are samples outside the -1,1 range in the source material, normalisation surely should reduce the level.

Of course one thing we've overlooked in the whole normalisation discussion is that it's possible for the audio signal to clip even if none of the individual samples are outside the -1,1 range. Perhaps we should revisit the idea of normalising to RMS or other quasi-perceptual level instead.

#3 Updated by Simon Dixon over 7 years ago

Actually I don't think normalisation makes things worse, but it doesn't work as needed. I think we need to consider some type of non-linear compression i.e. locally adaptive normalisation. This is similar to normalising using the long-term RMS, which might result in individual samples being out of range. In our case, I don't think it matters if we get clipping at loud clicks, coughs, laughs, etc.

Tony now copes OK with the low-level files I've come across, but the manual correction is difficult as note onsets and offsets are not visible. This is the reason I filed the bug report.

Also available in: Atom PDF