5
$\begingroup$

I'm manually editing the WAV files for an audiobook. There are often sections where I have to amplify a section, and then amplify sub-sections due to the variability of the quality of the original audio. It occurs to me that it wouldn't be hard to write an algorithm to perform automated normalization based on an exponentially weighted moving average of the nearby loudness levels.

Except that, of course, if it were that easy, someone would have already done this. Probably several people, in several different ways. Searching the internet gives me an endless repetition of "compress then normalize," so I thought I'd ask people who should know. What algorithms and/or tools exist for dynamic normalization of spoken audio?

$\endgroup$
5
  • $\begingroup$ Does this help? $\endgroup$
    – Jdip
    Dec 15, 2023 at 4:55
  • $\begingroup$ Thanks, @Jdip. It doesn't actually answer the question, but it does provide the magic words "Automatic Gain Control" that will inform my search. The answer gives a good explanation of what AGC is and does, and the standards for what a "good" AGC looks like, but doesn't provide algorithms or links to them. $\endgroup$ Dec 15, 2023 at 5:23
  • $\begingroup$ Well, each of the steps described is by itself an algorithm… how advanced/simple depends on your requirements. A simple approach would be to compute the signal loudness frame by frame with a look ahead and applying a smooth gain envelope to your signal, based on the difference between your target loudness and the lookahead frame’s loudness. $\endgroup$
    – Jdip
    Dec 15, 2023 at 5:40
  • $\begingroup$ @Jdip, here's what I was looking for. $\endgroup$ Dec 15, 2023 at 6:16
  • $\begingroup$ Great! Glad you found something that fits your purposes :) $\endgroup$
    – Jdip
    Dec 15, 2023 at 7:20

1 Answer 1

1
$\begingroup$

Pretty much every Digital Audio Workstation (DAW) has a toolbox for that type of thing. A good open source one is Audacity https://www.audacityteam.org/

They offer "normalization"," loudness normalization",Compressor, etc.

A compressor is a probably the most useful one. It allows to define a input level dependent gain function with adjustable time constants. It's a "superset" of an Automatic Gain Control: it can do whatever an AGC can do and but has significantly more control.

The tricky part here is that the requirements for music and speech are quite different, so you may have to adjust settings based on content. You also want to avoid "modulating" the noise floor which can become very audible and annoying.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.