From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7BE5E1F62D for ; Sun, 8 Jul 2018 13:36:17 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fc9rJ-0001Yf-9j; Sun, 08 Jul 2018 13:36:13 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fc9rI-0001YZ-7o for sox-users@lists.sourceforge.net; Sun, 08 Jul 2018 13:36:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bhVgzz6EeKL78QvnDSe41DWrGYGC8gd537AGNm4KIt4=; b=VpeFRPPCYC/ZiOYenAAYzbscu q60l5jYfJXyiPDAKa6SMkfLVaUgh78zIqibZC5vjmIavCObn3nxqDCIucI8oSwCDWKuTA186QqFNF uRt4sUHBEdZy47fjoZB8kL1+++nDhhs1iIy/fsG3OMorgsSvTJfSBvvqmhyp0fO9f/SUs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:References:In-Reply-To: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=bhVgzz6EeKL78QvnDSe41DWrGYGC8gd537AGNm4KIt4=; b=ILyERlxvnhcQHp2F8bgdfBvzh/ HBTDqMKHTzS5vZ+FbTVZ22xxgWP8w04tH5yhc4xjYZ5HNWeZXB+k5vZQbOqx70VYpgCT7mTnFC7IB 952SsEO7bb3SzWCKj9olYeAo3N/UIm2QLFBhqV8tmnYTE0goVUztz14XLxwYA1Jb1GAs=; Received: from mail-lf0-f54.google.com ([209.85.215.54]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1fc9rG-00Cuas-9E for sox-users@lists.sourceforge.net; Sun, 08 Jul 2018 13:36:12 +0000 Received: by mail-lf0-f54.google.com with SMTP id l16-v6so13182501lfc.13 for ; Sun, 08 Jul 2018 06:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=bhVgzz6EeKL78QvnDSe41DWrGYGC8gd537AGNm4KIt4=; b=tC0R12WpZEbnCEts+qm03PZPnVHP1XhuHgt0H03Dx5J1xm7nWQY00UEjKQekQblhPg cfsyEfT5FKwmiDnKIf9rUjXLG2hmW/sF0W1gh6jiKMe6Wi39gA18EdXDhcxV2YM1uTEv P2jh3z3zJFOxGjpW2/e1fKXlSQWfNx9WUYcDY/Tr6FyqGFxgzDELXpS+zNp2nakx8M6T mDLglooAQ8u9BlkEZSZLRns8eBzEyaB1Ic8CL2Ey14xJmsaQEmSv4yCF5ya/uR1kr47e +rjewWG8UMXY5x6Bx9O9WB0vMvagO9dhy0pAA1mzm7qZ9U1yvOLxjo+625nKJZVLrcUB KxCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=bhVgzz6EeKL78QvnDSe41DWrGYGC8gd537AGNm4KIt4=; b=pvbCY2myH2NbIfU/DJQQJGCd9U6tqSd6LzOj1SETTMbdpDnGMOlcYq63xqvZ2rWOiw qXK5eBAmSmZIQv572nh4adc/K5ByzlZK/YWwLouotD8gQtLgSPkY54NQzOLK+Rs749mQ 0+bTjAprYfV92ZsOzSXEL06/bfCZxnzwNEdFN/9Qof73M7cKFmclRxtWwfKQOOgKXZhI EwFLd1YQBVN55p8V9LfhCHzY1k2pjBe8Fh7dbCZO9XcSfwKMeZuPS8k1QfM2kwbCR2Iq rOShYNzJ8wmt2/EDEGH7g33CaMChYvbI75IwEiYfHe8+HtWYGn9kYx0KMspCAC7Izb/t F/2w== X-Gm-Message-State: APt69E30f14RXnd1qq76f5J5+zAP0dmnUXDGIA72sO7Ohmy36ldJMeD7 Ub+POpyOtIUrN+IQxR5+D2fZ4tIt1ItRlu9eKgk= X-Google-Smtp-Source: AAOMgpcDLJhnV/o9H5CyBTQ9Cbu65y2lc2X4md86pEv2ZcKgdYFovRNTCRt1P4NLd3qTS4foZbti2My1SlKXAgwpHHM= X-Received: by 2002:a19:7403:: with SMTP id v3-v6mr7820119lfe.97.1531056963229; Sun, 08 Jul 2018 06:36:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:5701:0:0:0:0:0 with HTTP; Sun, 8 Jul 2018 06:36:02 -0700 (PDT) In-Reply-To: References: <109205cf6d76dd28724114e96149054e@wingsandbeaks.org.uk> From: Mikko Olkkonen Date: Sun, 8 Jul 2018 16:36:02 +0300 Message-ID: To: sox-users@lists.sourceforge.net X-Headers-End: 1fc9rG-00Cuas-9E Subject: Re: Creating files with RMS gain level instead of Peak X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Content-Type: multipart/mixed; boundary="===============7105541919912875684==" Errors-To: sox-users-bounces@lists.sourceforge.net --===============7105541919912875684== Content-Type: multipart/alternative; boundary="0000000000006c9bf405707cfa3d" --0000000000006c9bf405707cfa3d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=3D-12). You can verify the magic 4.77 with sox stats command o= r 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=C3=A5ns Rullg=C3=A5rd wr= ote: > Jeremy Nicoll - ml sox users writes: > > > On 2018-07-07 21:47, M=C3=A5ns Rullg=C3=A5rd wrote: > >> Jeremy Nicoll - ml sox users > 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 multip= ly > >> 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=C3=A5ns Rullg=C3=A5rd > > ------------------------------------------------------------ > ------------------ > 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 > Sox-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sox-users > --0000000000006c9bf405707cfa3d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think that, for this specific type of white noise, = the difference between RMS and peak is 4.77. Therefore, you get desired out= put by replacing "gain -12" in the original command with "ga= in -7.23"=C2=A0
( -7.23-4.77=3D-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=C3=A5ns= Rullg=C3=A5rd <mans@mansr.com> wrote:
Jeremy Nicoll - ml sox users <jn.ml.sxu.88@wingsandbeaks.org.uk> writes:=

> On 2018-07-07 21:47, M=C3=A5ns Rullg=C3=A5rd wrote:
>> Jeremy Nicoll - ml sox users <jn.ml.sxu.88@wingsandbeaks.org.uk> writes:<= br> >
>>> Yes.=C2=A0 So does that mean that the OP should use something = like the
>>> 'stat' effect to find out the peak RMS level of the au= dio 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.=C2=A0 It adjusts both RMS = and peak
>> values by the same amount because that is what happens when you mu= ltiply
>> 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.=C2=A0 If he's previously done that in terms of a pr= e-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.=C2=A0 The answe= r
is that RMS gain is equal to peak gain, so "gain -12" will perfor= m the
desired function.=C2=A0 If the question were how much gain to apply in orde= r
to obtain a specific RMS level, then of course the initial value would
have to be known.

--
M=C3=A5ns Rullg=C3=A5rd

-----------------------------------------------------------------= -------------
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
Sox-users@lists.sourcefo= rge.net
https://lists.sourceforge.net/lists/listi= nfo/sox-users

--0000000000006c9bf405707cfa3d-- --===============7105541919912875684== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot --===============7105541919912875684== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users --===============7105541919912875684==--