Same order of loudness - "rustling of leaves" and a "loud explosion" along a track

Hello, Senior Members of the Audacity forum, especially, Mr. Steve and Mr. Trebor,

I am trying to use the “Effect” ⟶ “Loudness” ⟶ “Normalization…” ⟶ Normalize “perceived Loudness” to “-23.0” LUFS. My intent is to have the two volumes of loudness, a Bomb Explosion and the “sweet nothings between two lovers” or “rustling of leaves”, at approximately the same loudness level along one track. I have a single mono track with sounds at various dB levels. I want them to be of the same order of loudness.

Algorithmically, I would search for and find the loudest volume along one track, then the lowest one above absolute silence. Then have an inverse exponential scale according to which every portion would be amplified proportionate to this inverse exponential scale, subject to the -1 dB limit, the objective of Normalize. This way I visualise that I would be able to achieve all sounds represented at the same order of loudness.

What is LUFS from a layman’s perspective?

BTW, wasn’t there an effect called “Leveler” earlier that has now gone under Distortion? Would it have served the objective?

In the Manual pages there aren’t Ab Initio definitions before various options for usage of each tool, which complicate matters.

Yes. IMO it shouldn’t be categorized along with distortion…

But you’ll probably get better results manually, by-ear, using the Envelope Tool.

Normalization adjusts the whole file together. It makes one adjustment like if you were to adjust the volume control before playback starts. It retains the dynamic contrast in music.

Regular normalization is peak normalization which is usually used to “maximize” the peaks at 0dB. (1) But peak normalization doesn’t correlate well with perceived loudness and if you normalize all of your music, some songs will still be louder than others.

LUFS tries to measure perceived loudness. If you loudness-normalize your whole file, the leaves & whispers will probably remain too quiet and/or the explosion may get pushed into clipping-distortion.

You can try selecting and loudness normalizing different parts of your recording separately, but you’ll probably hear sudden-distracting changes in the background noise. And your perception might not match LUFS, especially with different kinds of sounds.

The leveller (same as “automatic volume control” or “automatic gain control”) is a slow kind of dynamic compression. Dynamic compression reduces the dynamic range (or “dynamic contrast”) by making quiet parts louder and/or loud parts quieter. Limiting is a fast kind of compression and clipping is a bad kind of fast compression. Usually, we just say “compression” or “compressor effect” but it’s unrelated to file compression (like MP3) which makes smaller files.

(1) I have another application that calls it “maximize” which is a better English word, but “normalize” is the normal-correct audio terminology. (The terminology comes from math or statistics where the data is “normalized”.)

But it IS a distortion effect.
The version of “Leveller” in the Distortion effect uses the exact same algorithm as the original distortion effect, and it is a “waveshaper”.

If the sounds don’t change too rapidly, Audacity’s “Compressor” effect can do that sort of thing, though the sounds that were originally LOUD will still be a bit louder than those that were originally quiet.
You will probably want settings similar to this, but do experiment with the Threshold setting for best results:

I sort-of assumed all of the “distortion” effects were based on the same algorithm(s) but it’s not supposed to sound like distortion and if you feed-in a sine wave, hopefully you get a sine wave out.

You don’t get a sine wave out, and that is why it is a “distortion” effect (the waveform is distorted).

You can see that the waveform is distorted if you look closely, and the spectrogram of the “After Leveler” clearly shows lots of added harmonics:

The distortion is also clearly audible as overtones (attached file is quite loud):

(Before and after applying “Leveler” effect.)

That’s true for Audacity’s Distortion effect.
Audacity’s Distortion effect is technically a “waveshaper” effect. It acts directly on the waveform, modifying the shape according to a selected formula. “Loudness” implements one formula, whereas “Hard Clipping” implements another, and so on.

“Hard clipping” is probably the simplest formula, which in pseudo-code could be written as:

IF absolute(sample-value) > threshold-level:
THEN sample-value = threshold-level-with-same-sign

(where “with-same-sign” means that +ve sample values remain +ve, and -ve sample values remain negative).

Commercial “Distortion” effects may apply multiple effects, possibly including resonant filters, delay, reverb, filter, anything… but the defining characteristic is that they “distort” the waveform in some way.

In a sense, Audacity’s distortion effect could be called “pure distortion” as it applies waveshaping only.

By the way, selecting presets in Audacity’s Distortion effect does not work. This is a known bug that was introduced in Audacity 3.1, and is still broken in Audacity 3.4 alpha.

Thank you, DVDdoug and steve, for replying to my post.

I see that you flew ahead and got carried away, engrossed in your discussion.
What is the mathematical definition (or full form) of the “LUFS level”? This LUFS must be an abbreviation.

“Manually” is not possible for a fairly large enough audio file. Is it possible to achieve the objective programmatically? Something similar to the algorithm that I have posted?

DVDdoug, maximize is not the better word here. Since the max amplitude ratio is 1 normally other than amplification, this is analogous to a probabilistic distribution, between 0 and 1. So Normalization is the correct word in this aspect.

Compressor effect won’t help in this matter. “Hard Clipping” too isn’t very logical for my plan.

But a detailed Effect based on the algorithm that I have mentioned would help better. I have tried Loudness Normalization multiple times, but doesn’t work more than once.

One problem that I face with audacity is that I can’t get to understand the mathematical aspect of the various tools accompanying the software. It would have been better if I could get in touch with the core audacity programmers. The definitions in the manual too aren’t very mathematical. Also, not all definitions and explanations are found on the manual. But that is a problem with Free Software. I could write but finding a place to start is difficult.

May be, time for a new Effect to be born!

“LUFS” is an abbreviation of “Loudness Units Full Scale”. It is defined in ITU-R BS.1770 as “LKFS” (Loudness K-weighted Full Scale). ITU-R BS.1770 should be read in conjunction with EBU R 128 (another specification document).

“LUFS” is equivalent to “LKFS”, and “LUFS” is the version that complies with International naming conventions.

The definition is complex as it involves filters, depends on the number of audio channels, and has different versions for momentary, short term, and integrated measurements. (The integrated measurement also includes a gate to exclude very low level spaces in the recording from the measurement).

Audacity’s Loudness Normalization is based on the long-term “Integrated” measurement.

Why won’t a compressor effect help in this matter? You want to reduce the dynamic range, and that is what compressors do.

It may be that Audacity’s built-in compressor effect is not ideal for your purpose, but there are other compressors available that have different characteristics. For example, the “Level Speech” Nyquist plug-in (available from this page: Dynamics Processing - Audacity Plugins) copes very well with very large variations in the loudness. There is also the “Pop Mute” effect (available on the same page) that is great for reducing the level of sudden loud sounds.

or resurrect an old one : hyperexp … Dynamics Processing - Audacity Plugins

Yes, checked. Thank you. Downloaded the file, “LevelSpeech.ny”, but I am not sure how to install it. Or whether it will serve the purpose. In case it doesn’t how could I remove it cleanly?
Thank you, Mr. Trebor, for the information.

HyperExpand fulfills your brief, but it’s brutal …

hyperExpand fullfills the brief

Yes, Mr. Trebor, It indeed looks brutal. As a novice I thought I needed the other file, “LevelSpeech.ny”, but it seems I would indeed need the file, “hyperexp.ny”.

Now my next set of questions would be:
(a) How to add the plug-in within my audacity program?
and if it fails to satisfy,
(b) How to remove it completely and cleanly from the said program?

Thank you for your inputs. Much appreciated.

It’s a Nyquist plugin, (has the suffix “.ny”), so you could use the Nyquist installer …
After installing it you still have to enable it in the plugin manager before it appears in the effects menu.

Thank you, Mr. Trebor, for your guidance.

I did it a bit differently. I copied-pasted the .ny file as a superuser to the directory, usr/share/audacity/plug-ins/. The Effect works. It is brutal, not perfect, but works. So better to apply it independently to individual sections of a long audio, I figured.

However, I believe that the software team at audacity now has a project that could be improved and perfected.

So thank you, Mr. Trebor, Mr. Steve and Mr. DVDdoug, for your inputs. I would then consider this thread ‘closed’ with your consent.

If you need extreme, but not brutal, compression, OTT-type plugins are an answer …

This topic was automatically closed after 30 days. New replies are no longer allowed.