lordmulder / DynamicAudioNormalizer

Dynamic Audio Normalizer
Other
251 stars 36 forks source link

artifacts #19

Closed richardpl closed 4 years ago

richardpl commented 4 years ago

Input file: https://0x0.st/zdor.wav

Parameters: ./DynamicAudioNormalizerCLI/bin/DynamicAudioNormalizerCLI-DBG.bin -f 10 -g 3 -p 0.31 -m 100 -i zdor.wav -o out.wav

Notice clipping at beginning. This is extreme case, but it shows why idea of clipping to -peak .. +peak is not working well. In another words smoothing gains and fade function can create sample which is out of range (-peak .. +peak) which is then clipped. I would like to avoid clipping completely.

lordmulder commented 4 years ago

Actually, we apply a minimum filter with the same window size as the smoothing filter prior to the actual smoothing, so that we should never get any final (smoothed) gain factors that produce clipping.

If you look at these graphs, you will see that the final (smoothed) gain factors always are smaller than or equal to the max. local gain factor, but never greater than the max. local gain factor:

image

(max. local gain factor is the factor by which a particular frame could be amplified without clipping)

But you are using some very "extreme" settings here: The default window size, in frames, is 31; you are using 3. Also, the default frame size is 500 ms; you are using 10 ms. So, effectively, your filter is only about 1/500 of the default filter size, i.e. the effect is now about 500× "stronger" than normal! Also, allowing amplification factors of up to 100×, in silent sections, is probably not the best idea either.

Quite possible that, with such "extreme" settings, you are pushing things to the point where our algorithms start breaking. The defaults have been chosen conservatively, to ensure that audio quality won't degrade; I suggest you don't deviate too much from that. If you want a somewhat "stronger" effect, try lowering the filter size a bit without touching the frame size. Just cranking everything up to the maximum is almost certainly going to mess things up. Try finding a "decent" configuration 💡

Best Regards MuldeR

richardpl commented 4 years ago

Subtle clipping still occurs, it is mostly clearly obvious under this extreme settings.