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.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 B6AB01F453 for ; Tue, 25 Sep 2018 20:09:55 +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 1g4teY-0007rL-GG; Tue, 25 Sep 2018 20:09:50 +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 1g4teX-0007rE-6X for sox-users@lists.sourceforge.net; Tue, 25 Sep 2018 20:09:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:To:From:Date: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=nAJiWtY00Z1jGdGRVx5UhcnhC18nsXkG5P/hFTnQo0w=; b=IkJ33/QwO/aShjU9fcGlnHsU0y oVEHofgVfWdvSiU9/5kMjhQY1DAfsqYeDZN1ZpYSACznF261pWs/hrW4milbe6L0+xGi3yMUmXJSu OWrchXfRvD1HcwvpevFkJ0wqvHoKSZJGH85G5XLqdOrQiX+N0fNbXCEhOkYqFIGmrKFQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To: From:Date: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=nAJiWtY00Z1jGdGRVx5UhcnhC18nsXkG5P/hFTnQo0w=; b=RZFt+sdHrRIdmc+c/weB44I2o9 Lxdzu4SPCQn4TChvr79zi2YfO2YW76ZO2jsyjnDeh2j22NvFne75WMGUfwIz922e2gZiU2qu8wNyq VtsqCZTp5f/2sZyzOKzjk67BsTUQseIS0RUyYQ6WsPCUAsqvqxrTdHCc5+JK7BiaKaCk=; Received: from mx.stare.cz ([79.98.77.229]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1g4teU-006RTl-9v for sox-users@lists.sourceforge.net; Tue, 25 Sep 2018 20:09:49 +0000 Received: from www.stare.cz (localhost [127.0.0.1]) by www.stare.cz (OpenSMTPD) with ESMTP id ca90a49b for ; Tue, 25 Sep 2018 21:42:55 +0200 (CEST) Date: Tue, 25 Sep 2018 21:42:55 +0200 From: Jan Stary To: sox-users@lists.sourceforge.net Message-ID: <20180925194254.GA13391@www.stare.cz> Mail-Followup-To: sox-users@lists.sourceforge.net References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Headers-End: 1g4teU-006RTl-9v Subject: Re: remove known sample from audio 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: sox-users-bounces@lists.sourceforge.net On Sep 25 12:26:36, molkko@gmail.com wrote: > What is the best way to subtract a known sample from given audio i.e. > extract/reconstruct the original.wav from final.wav when final.wav has been > created with commands: > > sox knownsample.wav knownsample_delay_gain.wav pad 0 vol > sox -m original.wav knownsample_delay_gain.wav final.wav First of all, by "sample", you mean "signal", not some one sample value, right? > original.wav is not anymore available. knownsample.wav and final.wav are > available. Do you also have knownsample_delay_gain.wav ? > pad delay and the vol parameter are known _roughly_ (X =~10ms, > Y=~0.1) So you want to reconstruct original.wav from the mix AND one of the originals - that's quite different than reconstructing from just the mix.wav (which I doubt would be possible). > PS1, I can reconstruct the original with the process below but this method > is very cumbersome: > repeat { > come up with some guessed X and Y > sox knownsample.wav knownsample_delay_gain.wav pad 0 vol - // is > also inverted > sox -m -v 1 original.wav -v 1 knownsample_delay_gain.wav final.wav stat > } until RMS amplitude reported by stat has reached local minimum You said you no longer have original.wav, but you are using it here. So what's there to reconstruct? > PS2, The original problem is a two musical instruments recorded > simultaneously in the same space. They have their own mics but the other > instrument is audible in each recording. I want to remove the "wrong > instrument" from each recording and have clean audio for both instruments. https://en.wikipedia.org/wiki/Spill_(audio) This should be your starting paragraph, not PS2. So show us the files: the mix (final.wav) and the non-delayed bleeding instrument (knownsample.wav). Also, name them more plainly (guitar, trumpet, mix - or whatever). It will be much easier to help you then. Jan _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users