lordmulder / DynamicAudioNormalizer

Dynamic Audio Normalizer
Other
251 stars 36 forks source link

RMS enhancements #10

Open cmrdt opened 7 years ago

cmrdt commented 7 years ago

if RMS-clip set too high no difference

whether to allow to specify an alternate RMS-value ratio/reduction/factor of [volume - if done using peak only) instead to multiple manual trial/error's

or a weighted average between this(alt), and orginal ver

whether to use a frequency-weighted RMS option (similar to EBU R128 ITU-R BS.1770-4 and internal oversampling (more accurate audio peak detection) )

lordmulder commented 7 years ago

The maximum "local" amplification of an audio frame is always bounded by the "loudest" peak that exists in that frame – provided that we do not want to apply "compression" (i.e. "cut off" the peaks). And the Dynamic Audio Normalizer does not apply "compression" by default, for good reasons 😄

Consequently, Peak-based normalization (the default) already gives the highest amplification factor that will ever be possible. RMS-based normalization can only result in lower amplification factor than the Peak-based normalization, because otherwise clipping would result! In other words, in RMS mode, you effectively get amp_final = MIN(amp_peak, amp_rms), where amp_final is the final amplification factor, amp_peak is the amplification factor that would have resulted from pure Peak-based normalization, and amp_rms is the amplification actor that would have resulted from a "clipping-permitting" (bad!) RMS-based normalization.


Regarding frequency weighting:

I understand that the goal here is to better "model" the human hearing, because the hearing threshold level differs between different frequency bands. But this would require to transform the input audio signal into the frequency domain, using FFT or a similar transform, so that we can analyze the magnitudes of the different frequency bands. This would much complicate the filter. I don't currently have plans to implement that.