From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pander Newsgroups: gmane.comp.audio.sox.devel Subject: Extra documentation / question about stat -freq Date: Sun, 22 Mar 2015 21:14:13 +0100 Message-ID: <550F2295.4090805@users.sourceforge.net> Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1427055281 27299 80.91.229.3 (22 Mar 2015 20:14:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Mar 2015 20:14:41 +0000 (UTC) To: sox-devel@lists.sourceforge.net Original-X-From: sox-devel-bounces@lists.sourceforge.net Sun Mar 22 21:14:34 2015 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org X-ACL-Warn: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1YZmGK-0002hQ-8e X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:408 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YZmGS-000239-VK for gcasd-sox-devel@m.gmane.org; Sun, 22 Mar 2015 21:14:29 +0100 Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YZmGN-0002Lz-Km; Sun, 22 Mar 2015 20:14:23 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YZmGM-0002Lq-41 for sox-devel@lists.sourceforge.net; Sun, 22 Mar 2015 20:14:22 +0000 Received: from nodachi.mjopr.nl ([83.96.169.215]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1YZmGK-0002hQ-8e for sox-devel@lists.sourceforge.net; Sun, 22 Mar 2015 20:14:22 +0000 Received: from [192.168.1.12] (ip235-130-212-87.adsl2.static.versatel.nl [87.212.130.235]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sander) by nodachi.mjopr.nl (Postfix) with ESMTPSA id 1D2571F897 for ; Sun, 22 Mar 2015 21:16:26 +0100 (CET) Hi all, When running stat -freq, one gest a series of power spectra. The documentation states: "The -freq option calculates the input's power spectrum (4096 point DFT) instead of the statistics listed above. This should only be used with a single channel audio file." The implication is that it is not guaranteed that the last power spectrum consists of a result based on 4096 points. To illustrate this, make a 30 second recording of a 125 Hz signal with an 48kHz sample rate. The three resulting spectra look like this: - first https://i.imgur.com/Erk1ouN.png - second https://i.imgur.com/78tBJpZ.png - third and last https://i.imgur.com/oWsF7H4.png It is clear that the last one is proper on the outline but has many intermediate points which are not desirable. This is of course understandable (and correct?). However, should this be noted in the documentation as a warning to prevent wrong assumptions? I can reproduce this almost always. With a WAV file of 487 MB the first and one but last power spectra look like https://i.imgur.com/ePpwM1d.png and https://i.imgur.com/NPkCSqA.png respectively but the last one is also malformed, see https://i.imgur.com/qjrxCbr.png When using averages over multiple power spectra, is it wise to ignore the last one? Is there a way to calculate when the DFT fits exactly and the last one doesn't have to be ignored? Can automatic notification this be part of sox? Regards, Pander ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/