From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 8D86C1F461 for ; Tue, 23 Jul 2019 19:45:15 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hq0ik-00016d-Ex; Tue, 23 Jul 2019 19:45:10 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hq0ii-00016M-PC for sox-users@lists.sourceforge.net; Tue, 23 Jul 2019 19:45:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Date:Message-ID:Subject:From:Reply-To:To:Sender:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sLe8TJOloTwEqwiNIG2nmKj2jWBfBaewL0IOqfiOCHE=; b=OFOs0P72g3PR75fe6Mbf3ZqghS Ld4PYpvXlUCrW/JksSgMmV6Nj7qgkZ2f4F8XBiPqOyElVfHYfKeQ522a24yJ1jNFJ0a1O6NnX1q2N A07AqXe8Lu5jgpT7BPFhT8HquzyFegtwu1yiN50DMuT0/2Nih9EW+TGj4BboxBY02pFg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Message-ID: Subject:From:Reply-To:To:Sender:Cc:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=sLe8TJOloTwEqwiNIG2nmKj2jWBfBaewL0IOqfiOCHE=; b=D vxRLiZIEjjsmqrO0LtgUIBWQTv6u+5SShLlgXUqDhFmzEBf1PkvzaKjCfsQ8Kne4nnFKNVH6kGhfs +nWdjtjnYOnjzMKlRQXMph4rkyHDhPdEQNv5YxcsnPPkeeXVupJ6zTHFyCpwRki/eUtFArXjTxlpp WlP6Ps/Lo4Wa0JMM=; Received: from mout.gmx.net ([212.227.17.22]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1hq0ie-00Ev95-2q for sox-users@lists.sourceforge.net; Tue, 23 Jul 2019 19:45:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563911097; bh=x0Vv+7Ed3rLtMl/swio1JTDxu8ftpe9zkuUynRFHnNI=; h=X-UI-Sender-Class:To:Reply-To:From:Subject:Date; b=jRMT6a1Uq2F6GIWQ5TuuRRbKiUZ7FojZ8o/ARlc/ajT/pzsPmeejCPSzury9UXIJr vLO1buuNDbrh4aGXLTdz/gkCuylh0BPN6SeHOKBLEcmH9tdMuKoLmHUDpvLeLIulia MkBSAEVktMYM3W1ufUUIhh6mF4ChryuFalT0vRwU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.13.23] ([178.27.180.88]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6KYb-1iVajY1JBB-016gqg for ; Tue, 23 Jul 2019 21:44:57 +0200 To: sox-users@lists.sourceforge.net From: "Dr. Thomas Tensi" Message-ID: <22dd29a2-219a-3fb3-7c0f-2eb2b2e2b4da@gmx.de> Date: Tue, 23 Jul 2019 21:44:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:T1q9oBidWkU0h7iIdqxq3a/xrn5r/XUIO0bc1kFWjSV+QoBLckb SP7jQt+0v/cFJjRqoTE7JwQxQXHKh8SVtZXN1A86/biwg03yoDYo7We1IlfPYoTvF9fGAM2 GxnkkaUqj6i7SAvzFzx8A9aun49v4Ux8XMbkmFBvnk6yh7dRYeqWLHPHbEz0Os22IGOdwQP ZUcphA8fyNXtORyE3N57Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:M2eyStyN5GM=:w2HtlcfSlKNovQWxQc7Lkv yFNb/YFcOTjpdTK12Tdx4VL5kooOSTYo2lpgpCyKQpPU1kb7ibCAY+aI5JVP/IsFXAssiBWnR rH9J1SulN1B9mK7ioftu3pXCptTYQBdvrcHVheZOFDFlYM3/EdMF3ehCg+msIN8N3B5+mfBeb l5eNAngzKO+93yu9VcfhYuk5QfOTfBtScUmMHyqbRkdz/dViigB21BTY+rRJTpjWJCGmBmeg/ 4mYGDaDQLYBt7orab4WjygNiEeO0Ymkh35+Kqwf39SfBXDtnxz5ZGGv6ZDaW/ii0ftVKtGACM TCOqXRJYFFZts6hELF05L78bq8wG+5wk4KlEjhiMAuvWaDi6EH8//oKyAKMTsc5rTKYXmslik YzA0kofrwlOAJpIC3lvMlqinkuT3rKBhQGdVx/eRLXAhviA+68wz6D5kl7eDqdt1U2zDnRvDw t/9uEfCZKUz/UaxHroi2G0QLgu6gFHdME1kUoTLkLtiIOGmlMxUhn3C0R2eBfN7AoSuyuvW8J f+YaD5nqOKmnH8vz4RBw6PRQL59s7JwbNDGRjhxfT6bl5e34XyKxHD7JZiAyJNOlAe2f4rbBz DYeq6qc5jQpCMyou+tdI7NEAiq/R7Ch+N15TNGGEWXRQ6dtT8/eaZ395jYqFAEH0iMCgkM9xj ha09o9jPWogtqrQox9xUFay37nYlTv8Khzv/CeGQGq+rJ16FSG1Or3EsrpJKJDU071R1mMlhq 1Yzph+JH85YpD8ymS1bEDLT8XazR+CNRkndcL0kJ6Gpj83Xmp1ZW8su92AXffFWLFSWHM8IbC O1rLgk1oRM8Y8ewNFUNyF2fItj2DdQR8YTI8Y5yq60+tZ+uELbVOL/EV0cDlT8v8wT9uqb9k2 ZoIEogdPQZwOPSgH32sa4mIrj5etq42pLHerN1M2D0Sa0qinLbzUX19uUbWW+QS5drosp2gQn Y41F2fo3r8KYc9d9N/jKk2W1Ry8erAov8JCuiKzgqlPWjz052agug/bqhzdFMlJLIPGcDSQ6B 0tTRhnqI/NIh+CqS1AMvMxwKJaglH/tBhtq5u3YjCKVfFwMpPdqBHYvvHwLGiBd+S6mDhCRpn GNMHASYu8ReKpw= X-Headers-End: 1hq0ie-00Ev95-2q Subject: SOX mcompand crossover algorithm? 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: t.tensi@gmx.de, sox-users@lists.sourceforge.net Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: sox-users-bounces@lists.sourceforge.net Dear all, I am currently trying to emulate some of the sox effects by scripting them in Reaper. I need those for exactly mirroring an external effects chain in sox within a DAW. For most of the effects reprogrammed, this works fine (the results are bit-exact). But I have significant problems with mcompand. mcompand uses a 4-th order Linkwitz-Riley-filter for crossovers. I am able to reproduce the crossover algorithm quite faithfully, but nevertheless I am not convinced about the filter coefficients. sox biquad filters produce the following IIR coefficients for a sample rate of 44.1kHz and a crossover frequency of 1kHz (the numbers gained by checking the source-code): ====================================== butterworth 2 biquad filters from sox: ====================================== lb = [ 4.604E-03, 9.208E-03, 4.604E-03 ] hb = [ 9.042E-01, -1.808E+00, 9.042E-01 ] a = [ 1.000E+00, -1.799E+00, 8.175E-01 ] Those perfectly match the values from scipy.signal: signal.iirfilter(2, 1000/22050, btype="lowpass") signal.iirfilter(2, 1000/22050, btype="highpass") ========================================== butterworth 2 crossover from scipy.signal: ========================================== bLow2 = [ 0.004604, 0.009208, 0.004604 ] bHigh2 = [ 0.9041522, -1.80830441, 0.9041522 ] a2 = [ 1., -1.79909641, 0.8175124 ] Using full debug mode for mcompand with a 1kHz crossover frequency reveals the following coefficients: ================================= butterworth 4 crossover from sox: ================================= DBUG mcompand_xover: lb=[2.119680195800917e-005 8.47872078320367e-005 0.000127180811748055 8.47872078320367e-005 2.119680195800917e-005] DBUG mcompand_xover: hb=[0.8174912065828001 -3.2699648263312 4.9049472394968 -3.2699648263312 0.8174912065828001] DBUG mcompand_xover: a=[1 -3.598192818969336 4.871772697390141 -2.9415672592774 0.6683265296879234]; This does _not_ match the output from scipy.signal: ========================================== butterworth 4 crossover from scipy.signal: ========================================== lb=[2.15209512e-05, 8.60838049e-05, 1.29125707e-04, 8.60838049e-05, 2.15209512e-05 ] hb=[ 0.82999258, -3.31997033, 4.97995549, -3.31997033, 0.82999258 ] a=[ 1., -3.6278442, 4.95122513, -3.01192428, 0.68888769 ] They are near, but not identical. Is the coefficient transformation for the iir filter cascade in mcompand_xover.h possibly incorrect? Best regards, Thomas _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users