Re: Creating files with RMS gain level instead of Peak

Mikko Olkkonen <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <CANWtmUC14HBEC2EvoOCBKfCOWNw63zNDyCCsZm8GB6YFF+JmXg@mail.gmail.com>
I think that, for this specific type of white noise, the difference between
RMS and peak is 4.77. Therefore, you get desired output by replacing "gain
-12" in the original command with "gain -7.23"
( -7.23-4.77=-12). You can verify the magic 4.77 with sox stats command or
analytically by calculating the ratio between the linear white noise
standard deviation and peak.
br, Mikko



On Sun, Jul 8, 2018 at 3:39 PM, Måns Rullgård <[email protected]> wrote:

> Jeremy Nicoll - ml sox users <[email protected]> writes:
>
> > On 2018-07-07 21:47, Måns Rullgård wrote:
> >> Jeremy Nicoll - ml sox users <[email protected]>
> writes:
> >
> >>> Yes.  So does that mean that the OP should use something like the
> >>> 'stat' effect to find out the peak RMS level of the audio file,
> >>> then work out how much gain or attenuation is needed, then use
> >>> a 'gain' effect with that calculated value?
> >
> >> No, he should just use the gain effect.  It adjusts both RMS and peak
> >> values by the same amount because that is what happens when you multiply
> >> each sample by a fixed amount, which is what the gain effect does.
> >
> > Yes, I understand that gain is gain, but he has to decide how much
> > gain to apply.  If he's previously done that in terms of a pre-gain
> > peak level, but now wants to bring RMS levels to a certain point,
> > he surely has to find out what the file's RMS levels are first
> > then decide how much to modify it by?
>
> The question posed was how to obtain an RMS gain of -12 dB.  The answer
> is that RMS gain is equal to peak gain, so "gain -12" will perform the
> desired function.  If the question were how much gain to apply in order
> to obtain a specific RMS level, then of course the initial value would
> have to be known.
>
> --
> Måns Rullgård
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Sox-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Sox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sox-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.