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.
kozikowski
Forum Staff
Posts: 69221
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: RMS Normalize

Post by kozikowski » Mon Apr 29, 2019 2:20 pm

@ BuckGodot
write down or screen grab the settings.
On a Mac, it's Shift-Command-3 for a whole screen and Shift-Command-4 to draw a box around the work.


Screen Shot 2019-04-29 at 7.17.48.png
Screen Shot 2019-04-29 at 7.17.48.png (11.15 KiB) Viewed 1925 times

I'm not sure how to do it on Windows.

Koz

kozikowski
Forum Staff
Posts: 69221
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: RMS Normalize

Post by kozikowski » Mon Apr 29, 2019 2:29 pm

Windows Snipping Tool

Start > All Programs > Accessories > Snipping Tool

Koz

marwalk
Posts: 1
Joined: Fri Jun 21, 2019 9:22 pm
Operating System: OS X 10.6 Snow Leopard or earlier

Re: RMS Normalize

Post by marwalk » Sat Jun 22, 2019 1:30 am

Hi, Steve. It's great to finally see an RMS normalization tool for Audacity. I'm curious about some discrepancies I've observed in the results from the RMS normalization plug-ins in Audacity and the Linux command line tool "normalize" (man page info: AUTHOR Chris Vaill <[email protected]>). I use Audacity on Linux, and have several books on Audible that I've narrated through ACX. All of those have passed muster in the ACX quality check upon upload. But my method is to export from Audacity to a 16-bit .wav file and then normalize it and do further CLI processing from there (such as re-encode to .mp3).

Is it possible that Audacity alters the RMS normalization level upon import and export? For example, if I normalize some audio using the rms-normalize.ny plug-in with it set to -20 and then export it to .wav, and then use the CLI normalize command to test its RMS normalization level, the reported level is -12.4488 dBFS with a peak right at 0 dBFS. If I then use the CLI normalize command to change the file to what it thinks is -20, it reports that it applied an adjustment of -7.55dB to result in its report of -20.0000dBFS RMS with a peak at -7.5509dBFS. Import that same .wav file with no further changes back into Audacity and the rms.ny analysis tool reports the level at -27.5512 dB.

What might be the explanation for these differences? I'm happy to provide before and after audio samples if that might help.

Thanks,
Mark
Moderator note: URL removed

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Post by steve » Mon Jun 24, 2019 3:27 pm

marwalk wrote:
Sat Jun 22, 2019 1:30 am
What might be the explanation for these differences?
If the files are stereo, they may handle RMS measurement differently from Audacity.
Audacity calculates the square root of the mean of all (squared) samples (both channels), which in my opinion is the correct way to measure stereo RMS, but is not the only way.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

MaxineD
Posts: 1
Joined: Wed Jul 03, 2019 6:36 pm
Operating System: macOS 10.15 Catalina or later

Re: RMS Normalize

Post by MaxineD » Wed Jul 03, 2019 6:39 pm

Hello!

I've tried everything to add RMS normalize to a macro. I updated everything and added the .ny file to the plugin section but I just cannot find it when I'm trying to insert a command in my macros section.

Can anybody help me with this?

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Post by steve » Wed Jul 03, 2019 11:36 pm

MaxineD wrote:
Wed Jul 03, 2019 6:39 pm
I updated everything and added the .ny file to the plugin section
Do you see the effect in the Audacity Effects menu? Are you able to use the effect manually (not in a Macro)?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ChasEnglish
Posts: 5
Joined: Mon Nov 25, 2019 5:27 pm
Operating System: macOS 10.15 Catalina or later

Re: RMS Normalize

Post by ChasEnglish » Mon Nov 25, 2019 5:32 pm

Steve,

I'm interested in the math of RMS Normalize. Do you run through all the samples, square them all, add the squares, then take a square root of the sum, then use that value to normalize?

Can you clarify the math, help me get my head around this? And if there's an article that explains this (for audio newbies), I'd appreciate a link.

Thanks in advance for any guidance you might have.

-- Chas

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Post by steve » Mon Nov 25, 2019 6:04 pm

ChasEnglish wrote:
Mon Nov 25, 2019 5:32 pm
Do you run through all the samples, square them all, add the squares, then take a square root of the sum,
Close.

1) Run through the samples
2) square all of them
3) divide by the number of samples (to get the "mean square")
4) take the square root (to get the "Root Mean Square")
Then use that value to normalize.
More info: https://en.wikipedia.org/wiki/Root_mean_square

In the latest version of this plug-in, most of the heavy lifting is actually done by Audacity rather than in the plug-in. The plug-in asks Audacity what the RMS is, and Audacity passes that information back to the plug-in. All that the plug-in then needs to do, is calculate the amount of amplification (based on the RMS level) and apply it.

If I recall correctly, older versions of this plug-in actually calculated the RMS within the plug-in, which is not so fast and requires a lot more RAM.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ChasEnglish
Posts: 5
Joined: Mon Nov 25, 2019 5:27 pm
Operating System: macOS 10.15 Catalina or later

Re: RMS Normalize

Post by ChasEnglish » Mon Nov 25, 2019 8:42 pm

Steve,
1) Run through the samples
2) square all of them
3) divide by the number of samples (to get the "mean square")
4) take the square root (to get the "Root Mean Square")
Then use that value to normalize.
Ah, got it. So once you have the Root Mean Square, do you reverse the math to come up with a scaling factor, multiply all the samples by that scaling factor?

I got the reverse math suggestion from this page, wasn't following:

https://www.hackaudio.com/digital-signa ... alization/

So once I have the R (which you described), do you invert to come up with "a", then multiply all the samples by a to normalize? Or am I still missing something?

Side note: Thank you very much for taking the time to answer a newbie question...

-- Chas

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: RMS Normalize

Post by steve » Tue Nov 26, 2019 1:07 am

ChasEnglish wrote:
Mon Nov 25, 2019 8:42 pm
So once you have the Root Mean Square, do you reverse the math to come up with a scaling factor, multiply all the samples by that scaling factor?
It's pretty easy really. Let's put in some arbitrary numbers to see how it works.

Converting between linear levels and dB is probably the trickiest bit, but we only use this for setting the target level. We could just as easily specify the RMS level as a linear value in the range 0 to 1. For completeness, these are the conversion formulae:
dB = 20 * log(linear)
linear = 10 ^ (dB / 20)

So let's say that we are aiming for a target RMS level of 0.5 linear (about -6 dB), but our actual, measured level is 0.2 (about -14 dB).

If our measured RMS level is 0.2, then we could scale it (amplify it) up to an RMS level of 1.0 by multiplying every sample by 1/0.2

But we want to amplify it to an RMS level of 0.5, not an RMS level of 1.0. Obviously 0.5 is half of 1, so to scale from 0.2 to 0.5, we need to amplify (multiply) by 0.5 * 1/0.2 = 0.5/0.2

In other words, we multiply each sample value by (<target-level> ÷ <measured-level>)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply