# RMS Normalize

Perhaps you’re not looking low enough down the list of effects. By default it is below the dividing line.

You’re right; both of these effects appear below the dividing line. However, they (and most others below that line) appear only on my large external video monitor. When using my 15" laptop monitor only 6 of the 19 below-the-line effects appear, and no View setting or scrolling lets me see the rest of them. The Limiter and RMS Normalize effects are alphabetically below the visible 6. How can I see all installed plug-ins when using the 15" monitor?

On Windows you should be able to scroll down the list.

Also on Windows, when the Effect menu is open, pressing (for example) the “L” key, will jump down to the first effect beginning with “L”. Press “L” again to jump down to the next effect beginning with “L” … (obviously any letter can be used other than “L”).

An alternative, is that effects may be grouped according to type. See here for more info: Effects Preferences - Audacity Manual

This plug-in is been a lifesaver for me. With that I can set the RMS value within the allowed limitations anywhere within it on the ACX check plug-in. Just discovered this within the last couple of days after posting on it elsewhere in this forum.

And as I posted…

There is a simple process for ACX processing. You don’t have to guess at it.

https://forum.audacityteam.org/t/rms-levels/46906/4

Koz

Hi Steve, thanks for this plugin, it is very useful.

I’m trying to figure out how to implement a RMS normalization in a software development project I’m working to, where can I find the reference algorithm you used for this plugin?

This plug-in cleverly “cheats”. It lets Audacity do the heavy lifting of calculating the initial RMS value, then simply amplifies (multiplies the sample values by a constant value) as required.

The basic algorithm for measuring RMS is the square root of (the sum of squares of all sample values, divided by the number of samples).

In Audacity, the algorithm is considerably more complicated because Audacity uses cached values per block-file, which are then combined to give a value per audio clip, which are then combined to give a value for the selection, but the caching of block-file values makes the calculation very fast.

This plug-in cleverly “cheats”. It lets Audacity do the heavy lifting of calculating the initial RMS value,

I’m fine with that, I already implemented the routine to measure the actual RMS of an audio track in my application.

then simply amplifies (multiplies the sample values by a constant value) as required.

This is the missing part, for me: how to define the “constant value” to use? It is clearly related to the target RMS the user wants to achieve, but how?

Perhaps a little surprising, but it’s pretty much the same as “peak normalization”.
Just as amplifying a sound by +3 dB causes the peak level to increase by +3 dB, so it also causes the RMS level to increase by +3 dB.

To convert dB to linear:
10 ^ (dB / 20)

So, for example, if you measure the RMS as -24 and you want the RMS to be -20, then you need to amplify by +4 dB.
So to do that, you would multiply each sample value by 10^(4/20) = 1.584893192

Thanks again Steve!

Perhaps a little surprising, but it’s pretty much the same as “peak normalization”.
Just as amplifying a sound by +3 dB causes the peak level to increase by +3 dB, so it also causes the RMS level to increase by +3 dB.

Incredibly simple! Sorry, I’m a complete newbie in audio manipulation from the sw development perspective… well, time to coding now, thanks so much!

Hi Steve,
sorry for bothering you again, I’m still fighting with this without sorting it out.

Let’ suppose, for sake of simplicity, to have an audio track whose samples are: 5, 2, 10. Its RMS will be:

RMS = sqrt( (5^2 + 2^2 + 10^2) / 3) = 6.55

Following your suggestion, If I would to modify that track to have an RMS equal to 10, I should multiply each value by 10-6.55= 3.45. My new values will be:

5 → 53.45 = 17.25
2 → 2
3.45 = 6.9
10 → 10*3.45 = 34.5

the new RMS will be:

RMS’ = sqrt( (17.25^2 + 6.9^2 + 34.5^2) / 3 ) = 22.62

that’s a totally different value respect the desired target… What’s wrong?

A note that wildly varying volume in a voice performance will not respond to RMS Normalize. That’s where the as-you-go compressors are valuable. Also note, if you weave in and out from a directional microphone during your performance, the proximity effect will change the quality of your voice enough so it will not be recoverable.

I see I didn’t post the final for ACX Audiobook Mastering 4. The process has been reduced to two or three standard steps that should produce an ACX compliant submission and out the door.

https://forum.audacityteam.org/t/audiobook-mastering-version-4/45908/1

Please don’t leave out any steps or ad-lib. The suite is designed so each tool works from the tools that came before.

Are you the reader? You might want to read a standard test clip and either submit it, or run it through the Mastering Suite and see how you do.

http://www.kozco.com/tech/audacity/TestClip/Record_A_Clip.html

If you come up with a shorter or more graceful “universal” method, let us know how you did it. ACX Suite 4 was in development for months.

Koz

What are the units?

When dealing with sample values, we normally work on a linear scale range of +/- 1, or a dB range relative to full scale (where 0dB = full scale).
There’s a huge difference between multiplying by 5dB and multiplying by “5” (linear scale).

Let’s put in some realistic figures:

Say we have an audio track whose sample values are 0.5. 0.2 and 1.0 (linear scale).
RMS (root mean square) = sqrt (( 0.5^2 + 0.2^2 + 1^2) / 3)
= sqrt ( (0.25 + 0.04 + 1) / 3)
= sqrt (1.29 / 3)
= sqrt (0.43)
= 0.6557

In dBFS, that is:
20 * log10(0.6557)
= −3.6659

If we want the RMS to be -6dB, then we need to multiply (decrease the amplitude) by (-6 - -3.6659) = −2.334103673 dB
Notice that we are dealing with negative dB, because 0 dB is full scale, so all valid signals are less than 0.

−2.334103673 dB on a linear scale is:
10 ^ (−2.334103673 / 20)
= 10 ^ −0.116705184
= 0.764354482

So the new sample values will be:
0.5 * 0.764354482 = 0.3822
0.2 * 0.764354482 = 0.1529
1.0 * 0.764354482 = 0.7644

and, to check, the new RMS will be:
sqrt (( 0.3822^2 + 0.1529^2 + 0.7644^2) / 3) linear
= sqrt ((0.1461 + 0.0234 + 0.5843) / 3)
= sqrt (0.7538 / 3)
= sqrt (0.2513)
= 0.50125 (linear)

Which in dB is:
20 * log10(0.50125)
= 20 * −0.299943332
= −5.999 (close enough considering rounding errors)

and this is why we use computers

What are the units?

When dealing with sample values, we normally work on a linear scale range of +/- 1, or a dB range relative to full scale (where 0dB = full scale).
There’s a huge difference between multiplying by 5dB and multiplying by “5” (linear scale).

Your are right! In my example I was dealing with linear values totally abstracted from the audio world (in which, as you said, usually samples are in the range [-1,1]).

It is now clear to me where the error was: following your instructions I calculated the amplification factor as the difference between the original RMS and the target RMS but, due to the fact they were expressed in linear scale, I would perform a division, thanks to the logarithm difference property.

Let’s say:

RMSol —> original RMS in linear scale
RMSod —> original RMS in logarithmic scale
RMStl —> target RMS in linear scale
RMStd —> target RMS in logarithmic scale
Fl —> amplitude factor in linear scale to modify the track from original RMS to target RMS
Fd —> amplitude factor in logarithmic scale to modify the track from original RMS to target RMS

RMSod = 20log(RMSol)
RMStd = 20
log(RMStl)
Fd = RMSod - RMStd = 20log(RMSol) - 20log(RMStl) = 20 * (log(RMSol) - 20*log(RMStl) ) = 20 * (log(RMSol/RMStl))

Fl = 10^(Fd/20) = 10^( (20*log(RMSol/RMStl))/20) = 10^log(RMSol/RMStl) = RMSol/RMStl

And that’s the point: working in linear scale, the factor must be calculated as the division of original RMS by the target RMS.

Now my example works:

Fl = 10/6.55 = 1,5267

5 → 51.5267 = 7.6336
2 → 2
1.5267 = 3.0534
10 → 10*1.5267 = 15.2671

RMStd = sqrt( (7.6336^2 + 3.0534^2 + 15.2671^2) / 3 ) = 10.01

Said that, I want to thank you again for spending your time to help me to find the right way, you are a very kindly person.

Yes, it’s all about ratios. “dB” is not a unit, it’s a ratio.
(in signal processing, it is usually with respect to “full scale”, so full-scale = 0 dB).

This may be an indicator that I’m Doing It Wrong but although RMS Normalize is great for helping to even out levels on the podcast I am working on, it tends to push tracks into clipping.

It would be super-convenient to have something to either pre-check whether a certain normalisation value would cause the track to clip ( maybe on it’s own button ) or to suggest the loudest normalisation level that would avoid it.

The situation I’m working in is that my tracks tend to be pretty long and it’s a podcast so people have a tendency to get louder and quieter. In the past I have tended to use some amplify-limit loops to get everyone to roughly the same size of wave, but obviously that tends to result in uneven volume when you listen. Also if you have to do it a few times, it can start to distort a little. Am I right in thinking that if I use RMS Normalize to the maximum loudness I can without clipping and then run the limiter across the track I should be able to Normalize again and get up to a standard volume? Is that a good idea or could I get the volumes between tracks evened out in a simpler way? I’m sort of getting that loudness is relative so does it actually make a difference what the volumes are as long as they are balanced?

What level are you normalizing to?

This is where we run into the limitations of Nyquist plug-ins. They are “one shot” effects, in that they return one result then quit. The effect could measure the peak level before normalization and work out if it is going to clip, but if it is going to clip the effect has no way to ask you what to do. It can’t even tell you that it has clipped, other than as a “debug” message (which requires that you press the debug button). It could pop up a message to say “this will clip”, but that would be the one and only result - there’s no mechanism to allow a Nyquist plug-in to continue after returning a result.

Sounds like you need to use a Compressor effect (Compressor - Audacity Manual)

RMS Normalize … tends to push tracks into clipping.

Correct. That’s why you follow that with Effect > Limiter like it says in the mastering document.

You don’t have to limit at -3.5dB. That’s just the audiobook standard.

And to keep RMS Normalize from responding to excessive low frequency sounds, you start the processing with Effect > Equalize: Low Rolloff for Speech.

-=-

If your problem is widely varying volumes between performers, you might be a candidate for Chris’s Compressor.

I change the first value, Compress Ratio from the default 0.5 to 0.77 and it simulates the leveling/processing at the local radio station. It evens out volume variations and makes the show louder.

Koz

There was one odd thing that Chris does. I found the comments.

https://forum.audacityteam.org/t/chriss-compressor/46537/2

I process podcast versions of radio shows and I never ran into this problem.

It’s a look-ahead compressor, so if it doesn’t find anything when it looks ahead, it behaves oddly.

Koz

Thanks everyone!

Steve, I started out trying to normalise to -18 but when that kept pushing everything into the clip-zone I kept knocking it down until I got to around -30, at which point it stopped boosting the loud parts up past zero.

Kozikowski, I thought once you hit clipping you were sonic toast? I thought if I did this the RMS Normalize would knock the track up past zero in a few places and then the limiter would just make the distortion quieter- like when you record at too high a level and reducing the volume just makes it distorted and less loud. Are Audacity’s effects non-destructive once you are working with the recorded data?