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.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,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 BE3E71F4B4 for ; Tue, 20 Apr 2021 13:55:01 +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.92.3) (envelope-from ) id 1lYqpv-00070U-DS; Tue, 20 Apr 2021 13:54:43 +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.92.3) (envelope-from ) id 1lYqpt-00070L-Nv for sox-users@lists.sourceforge.net; Tue, 20 Apr 2021 13:54:41 +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:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: 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=H2gSuntjPECFnbZWNqL+KsUFzpCUPRCov6gaGmQxRpc=; b=Ge09bgsKWlTx7zn1GEH8LCXQcp H++2m7vW7iXfvHp1oQvAriy//VGMLm9uJV0pLpOTRetYVKAyD2aT83hM4CO/mitStX5Lx904vHVxl QxL0XHBibmSe/l61Lw1AwRSCL9p2+wU3oMG6qV0z+LGdQhbLj04SYp3KAEr11D0Bk3U8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: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=H2gSuntjPECFnbZWNqL+KsUFzpCUPRCov6gaGmQxRpc=; b=Tb4QFzPU5DKHTKlNeb8Pu7SahS tEGdToqI2XfpAsHcGwafv6XWoycgfLGGojM/zYTkVTSf9A6MobQ3qHuJpXYTtuJJI9MxbslFOFsY1 ROmhTkIH1UAD3ul39UHoqKizR7vn4HzsVmHuHA46CrFitkJa69A/d9x4p+KdDusTF+XM=; Received: from mout.gmx.net ([212.227.15.18]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lYqpi-00070u-Uv for sox-users@lists.sourceforge.net; Tue, 20 Apr 2021 13:54:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1618926861; bh=XWSNm2vmSBto6vJFHYtyqa8eUKlC7yEuMNQ4pqeJzIQ=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=idkaBNYHtsbNsxx6f74WLNK4LWzH7QQzsC2DUP7RJACHkabeu28uloLMsQk4RwYu0 PigjwDXzIOY993ZksHlcAmaT7fh8yZcYHlqhll+G8ioTuNs9q+qjZwO70GL9m0eQfx AvG/N9UXMtfydm21ufR0EDtn8GVb0q8sh9+5Fd4Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.13.137] ([178.27.171.42]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MmlXA-1lxUkN1HtO-00jrmg for ; Tue, 20 Apr 2021 15:54:21 +0200 To: sox-users@lists.sourceforge.net References: <8ab46d92-0fc3-f972-250e-c22659741c3a@gmx.de> <3d7b0ecc-585b-aae6-d5ad-01824cb3032f@gmail.com> From: "Dr. Thomas Tensi" Message-ID: Date: Tue, 20 Apr 2021 15:54:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <3d7b0ecc-585b-aae6-d5ad-01824cb3032f@gmail.com> X-Provags-ID: V03:K1:8/j337k8xGNnPn3HERln0lBse9AExFmzEqROKiOeues8JJeJosj CtXZDYCRBZABe+TJHBGW/qAXrWBT8wVXGlD6VeZNi6XgUDtGchxeGtsf0JtwbqEu9LUVMlB EgZvRY0hFhHGPVX3OY3ZpX3UQoTrxroqzjCyqaz2yLvJKwJlH6mYbPEuuAQwgysV8Dd+HB/ 9Qtha8Jl1jh3hsGfxTW7A== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZzApnYOLbyg=:yOE82M6tJWMmsyatHBglgL 7Bbj6j1VW9WQ8Ey42Vojfgd3uO8VgWsLCnS0I2uy85SkEOlmAsawGhLeSkPv+psI6dd6YvS8d Ti0r5LIpDxHm09RliHP/Kfnr6YEJ8bOR8rnYe9tJI21FQUl6Ce5AzkksWrqZvYFmLKN+fTlS5 Yux4y73Eq5kgVjA04Y3UJbfdqDA6tc9mc6OY2fqHV9wYMUqDM+637FHY8OxuJxxwMF+z4I1HF R9H7dzfTjs2rF3qq1o27zpT6/X8iUhpslw7nv7GhIBSaozgMZJMHZuhj5j/1LEsqx0DvAC3fL /F6+sUrKJLZhL9BY+LxS3lXYY52YiYgXdalJk5iG9KtsutS6JDqqjYnkNaH66xJRxq6IuHLv0 ZDcmwVymQerCC7J3q5fm3qNc+c1m4JlEJS0lpogFH5p2+PzuMgeXB9nYWy8V4O/d6uFpj2S98 PagnyL4BE3RP5tGPafbLBsIfZbRyXgem+mySD6f+6P/x5N8mvosMY41ZE21OgOANL0gHqWn8z JthgqjNGVPn2dqvQUnRS7QfIZKOlD8xZ+56Xs379VEuuFeN6HhS9y2K3AxDLKKYKOGo0xce5H qISDSILVLoM4upGFhUtmFGAJD8kFQsk8yXBwpX+KEyiLx8IVtsRoOMDXYkGQs6txIMFeBpHpk uvpJBBfOPg6ngWQscfYtpAOtAriejKTRLHLcCxFyanT6KeWaRaqPWfoGKaJ6tZUVrnLdOcDJe otAefVwmPsvia0Ku3rAMoGtmwiRAfwvV8nsMJ0TBWKZqVCTP1Y4ip8ZMOhKQK90UAFjtmbs7u uqaRVpcau2UO1THBbK9okPfkOUniXyc3NvWnLivgFvW+5N4rGAJuH//mKphdhiOvgVMKD7gC+ Czw6leMbIA/6+pV/EecZw4iXactEJzVW2u3el5qLkNI4E5uOU6F+ltOi7cThUeGNguuYZbfeJ FuELSyMJPwh+4PREOmrSP9Twart+WPFX2NV+QGifrt/dOsT9sBEdPlyo2UpzpZgkpMsk84Mph JS6HfdX3zu3k7ZngeQF0TPu7p67vLbHuYQO+znTGZ5YgHbaLXB9xIEYDJI8v7zGmcKc8hnus4 iwhjrb2vjV+Qmd6YnigbMNlb0T99FACEfGJiB/c+Ja4idlmZzHUplT4abikIcZ5nq+GE1WNqB jzcnHbISgnF8/jZ3LNhciVhMyL5xTgOT71dxPkSj5fk1GFi8cE/gcajOb8h3/L7Gmyufw= X-Headers-End: 1lYqpi-00070u-Uv Subject: Re: Multi Band Processor 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: sox-users-bounces@lists.sourceforge.net Hello Robert, you wrote: > Thanks for responding Thomas You're always welcome. Sorry to be that late, but I was busy... > my system starts with a compand function to iron out the > devastating differences in audio levels on our sources. > > This is followed by a mcompand 5 band process which has a > low end rolloff, a voice presence tweak, and a gentle high > end caress to mitigate hiss and sibilance. > > [results with compand plus mcompand are acceptable] This seems to me like a very good approach. > > [compand is just a special case of mcompand with a > > single band and a crossover frequency of 22kHz] > compand will do some things that don't work in mcompand. > The manual implies that the parameters are identical. Maybe I do not understand the problem. Doing a compand followed by an mcompand can be absolutely reasonable, because the first stage levels the signal overall and then the second stage does some individual tweaks on the frequency bands. So there is no disagreement on your approach at all. But definitely: although the implementation for compand and mcompand is separate in SoX (there is code duplication in the source code for mcompand.c and compand.c), they implement _exactly the same algorithm_. I have tested it against my reimplementation (where both approaches are unified) and a reimplemented mcompand with a single band behaves _exactly_ like the original SoX command-line compand. If this were not the case, you would just have crushed my mental model ;-) > mcompand has to have a global compand type item at the > end. This is not clearly explained. I have played with > this and arrived at something that works for me. No. The compand item at the end does not have a frequency specification because this compander band does not have an upper crossover frequency. The command line logic is mcompand band1CompanderSpec band1TopFrequency \ band2CompanderSpec band2TopFrequency \ ... \ band(n-1)CompanderSpec band(n-1)TopFrequency \ band(n)CompanderSpec The last compander has no explicit top frequency, but it is just infinity or - more precisely - the Nyquist frequency (e.g. for a 48kHz sample rate signal this is 48kHz/2 = 24kHz). In command-line SoX an mcompand with one band behaves exactly like a compand. I did not check whether you can specify such an mcompand, but if yes, there must be no difference. You just have the additional double quotes with mcompand. Let me clarify this with an ASCII-art picture (hope this works). This is the signal flow in mcompand: Input Signal | v +----+ +----+ +------+ +...+ |LR1 |-->|LR2 |--> ... -->|LRn-1 |-->.LRn.--> x +----+ +----+ +------+ +...+ | | | | v v v v +----+ +----+ +------+ +----+ |CMP1| |CMP2| ... |CMPn-1| |CMPn| +----+ +----+ +------+ +----+ | | | | v v v v +-----------------------------------------+ | Signal Adder | +-----------------------------------------+ | v Output Signal So the input signal is split by so-called Linkwitz-Riley crossover filters that take a signal and split it into two signals at their crossover frequency: a low frequency signal below that frequency and a high frequency signal above that frequency. In the picture "low" goes down into a compander and "high" goes right into the next LR-filter. The last filter LRn (with the x-output) is not specified in the mcompand command line, because it does not really do anything complicated: its crossover frequency is the Nyquist frequency, hence x must be the null signal and everything coming in from the left goes directly down to CMPn (the n-th compander). Finally all compander outputs are summed up into the output signal. Reduced to one band this gives you: an LR-filter with no signal change (the filter parameters degenerate to an identity filter without phase issues), a standard compander and finally an adder with just one signal. Looks like a compander to me. >> Your functions look okay, but you could consider rounding >> off the corners of the transfer function by adding a knee >> value of e.g. 4dB. > I copied someone else's and then modified. It came without > knee. I have added the knee and it certainly smooths the > transitions. Thanks for that. I guess you really can't hear the difference with your rough material and your compression settings, but it does no harm. > > What you could do is factor out the common parameters and > > just put in the changed values instead; you already did > > that in part, but putting this further would make your > > script more modular. > At the prototype stage it was easier for me to keep each > band seperate. I found that to much difference between > band parameters caused phase issues. It works best when > each band is processed more or less the same and the > outputs are combined in the desired ratio. I roll off the > low end. Allow voice frequencies I didn't check that, but I can imagine that this is generally a problem with multiband companders. Frequencies near the crossover frequency behave completely differently depending on whether they are below it (and in band i-1) or above it (and in band i). Hence your approach is reasonable. > > [extreme release times of 1.2s or even 2.0s] > The audio sourced from three different TV channels, > typically comes crashing in at high level. 20db above the > average level. Either a device or an operator cranks it > down. Given the consistency it's a device. To even things > out a fast attack and a slow release works. The noise > floor [ hum hiss air condx passing traffic etc ] is about > -32. Long release prevents the noise being sucked up. I am > dealing with speech. Sources run from reverberant studios > to less than ideal remote locations. Camera operators have > the high pass filter useful for lapel mic's in circuit > when the reporter is using a hand held ENG mic. Automatic > level controllers [that don't] at venues used for Press > Conferences or to deliver speeches defeat everything in > the subsequent path. > I have been able to get a consistent clear result. Today > there was a vox pop segment recorded at a bus station with > several diesel buses running in the background. The > processed version was better then the original broadcast > audio. Congratulations! That requires a lot of tweaking and expertise from your side. > The 'processor' can be run in a shell script that is > invoked when an operator edits the source audio and sends > it 'to be carted'. Our low budget LPFM can't afford the > $7k processor, which I am not so sure could be tuned as > sweetly as this. That's the advantage of command-line open-source tools. > I have a set of processors, one for each of our sources. > The goal is to deliver a consistent sound to our listener > but not have the processing so heavy as to be tiresome. > mcompand has enabled me to build a virtual device which > achieves this. I am really appreciative of all the work > done in sox and associated code by a legion of people. I myself am not active in the SoX development, which is a great work in my opinion. Standing on the shoulders of giants... > I wish I had the skill to be able to read the source code > and perhaps write manuals. We as developers are typically not good at the latter; so we appreciate people getting along with the software anyway ;-) Best regards, Thomas _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users