RMS Normalize

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.

Re: RMS Normalize

Permanent link to this post Posted by sertal » Thu Dec 14, 2017 8:54 pm

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 --> 5*3.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?
sertal
 
Posts: 5
Joined: Thu Dec 14, 2017 8:07 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: RMS Normalize

Permanent link to this post Posted by kozikowski » Thu Dec 14, 2017 11:54 pm

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.

viewtopic.php?f=64&t=96103

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/Test ... _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
kozikowski
Forum Staff
 
Posts: 39687
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: RMS Normalize

Permanent link to this post Posted by steve » Fri Dec 15, 2017 12:03 am

sertal wrote:Let' suppose, for sake of simplicity, to have an audio track whose samples are: 5, 2, 10

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 :D
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46541
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Permanent link to this post Posted by sertal » Fri Dec 15, 2017 8:25 am

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 = 20*log(RMSol)
RMStd = 20*log(RMStl)
Fd = RMSod - RMStd = 20*log(RMSol) - 20*log(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 --> 5*1.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.
sertal
 
Posts: 5
Joined: Thu Dec 14, 2017 8:07 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: RMS Normalize

Permanent link to this post Posted by steve » Fri Dec 15, 2017 9:49 am

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).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46541
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Permanent link to this post Posted by Breakfast » Sun Dec 31, 2017 10:33 am

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?
Breakfast
 
Posts: 19
Joined: Thu Nov 26, 2009 11:10 am
Operating System: Linux Mint

Re: RMS Normalize

Permanent link to this post Posted by steve » Sun Dec 31, 2017 12:25 pm

Breakfast wrote: it tends to push tracks into clipping.

What level are you normalizing to?

Breakfast wrote: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.

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.

Breakfast wrote: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

Sounds like you need to use a Compressor effect (http://manual.audacityteam.org/man/compressor.html)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46541
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Permanent link to this post Posted by kozikowski » Sun Dec 31, 2017 3:36 pm

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.

viewtopic.php?f=64&t=96103

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.

https://theaudacitytopodcast.com/chriss ... -audacity/

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
kozikowski
Forum Staff
 
Posts: 39687
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: RMS Normalize

Permanent link to this post Posted by kozikowski » Sun Dec 31, 2017 4:00 pm

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

viewtopic.php?p=332784#p332784

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
kozikowski
Forum Staff
 
Posts: 39687
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: RMS Normalize

Permanent link to this post Posted by Breakfast » Sun Dec 31, 2017 6:05 pm

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?
Breakfast
 
Posts: 19
Joined: Thu Nov 26, 2009 11:10 am
Operating System: Linux Mint

PreviousNext

Return to New Plug-Ins



Who is online

Users browsing this forum: No registered users and 3 guests