From: "Måns Rullgård" <mans@mansr.com>
To: Pander <pander@users.sourceforge.net>
Cc: Eric Wong <normalperson@yhbt.net>, sox-devel@lists.sourceforge.net
Subject: Re: [PATCH RESEND 9/9] Added average power spectrum for stat -freq -a
Date: Mon, 03 Aug 2020 14:41:24 +0100 [thread overview]
Message-ID: <yw1x4kpjyhh7.fsf@mansr.com> (raw)
In-Reply-To: <aa2e06ea-139a-3377-df40-d7b661ea094b@users.sourceforge.net> (pander@users.sourceforge.net's message of "Mon, 3 Aug 2020 14:44:14 +0200")
Pander <pander@users.sourceforge.net> writes:
> On 8/2/20 12:52, Måns Rullgård wrote:
>> Måns Rullgård <mans@mansr.com> writes:
>>
>>>> + if (stat->fft_average) {
>>>> + for (i = 0; i < samples / 2; i++) /* FIXME: should be <= samples / 2 */
>>>> + fprintf(stderr, " %f %f\n", ffa * i, re_average[i] / len);
>>>> + }
>>> I don't understand the idea here. Unless I'm mistaken, this prints the
>>> power spectrum averaged over however many FFT blocks happen to fit in
>>> the input chunk, which could be none.
>> Oh, and the "average" it calculates is bonkers too.
> It provides an average of only full blocks, as partly filled blocks mess
> up the average.
Yes, of course, but I can't see the value of printing the average (even
if calculated correctly) of some unspecified number of blocks. If audio
data is supplied in small chucks, most calls won't fill even one FFT
block, so you'll be printing a lot of zeros.
> This is still in development and I plan to continue with it soon,
> especially providing a test set demonstrating its value. Can you
> please elaborate on what you mean with bonkers here?
You're dividing the spectrum by the number of samples processed. That
doesn't make sense.
--
Måns Rullgård
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
next prev parent reply other threads:[~2020-08-03 13:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 9:37 [PATCH RESEND 0/9] some old accumulated patches Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 1/9] use non-blocking stdin for interactive mode Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 2/9] speed up "|program" inputs on Linux 2.6.35+ Eric Wong
2020-07-31 10:53 ` Måns Rullgård
2020-07-31 9:37 ` [PATCH RESEND 3/9] sox.1: fix section name Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 4/9] sndio: handle 24-bit samples properly on OpenBSD Eric Wong
2020-07-31 10:59 ` Måns Rullgård
2020-07-31 9:37 ` [PATCH RESEND 5/9] Handle vorbis_analysis_headerout errors Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 6/9] fix manpage warning: "table wider than line width" Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 7/9] spectrogram: remove arbitrary limit on height of spectrogram Eric Wong
2020-07-31 14:34 ` Måns Rullgård
[not found] ` <CAL4-wQpF-qOD=BRVPhgZFC7fjvFDV-rQx1stvwY_xCTyj5uooA@mail.gmail.com>
2020-08-13 16:20 ` Måns Rullgård
2020-08-13 16:30 ` Pander via SoX-devel
2020-08-13 16:38 ` Måns Rullgård
2020-07-31 9:38 ` [PATCH RESEND 8/9] Add spectrogram -n flag to normalise the output to maximum brightness Eric Wong
2020-07-31 9:38 ` [PATCH RESEND 9/9] Added average power spectrum for stat -freq -a Eric Wong
2020-08-01 11:52 ` Måns Rullgård
2020-08-02 1:03 ` Eric Wong
2020-08-02 10:43 ` Måns Rullgård
2020-08-02 10:52 ` Måns Rullgård
2020-08-03 12:44 ` Pander via SoX-devel
2020-08-03 13:41 ` Måns Rullgård [this message]
2020-07-31 10:13 ` [PATCH RESEND 0/9] some old accumulated patches Måns Rullgård
2020-07-31 21:16 ` Eric Wong
2020-07-31 21:44 ` Måns Rullgård
2020-08-01 16:57 ` Måns Rullgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yw1x4kpjyhh7.fsf@mansr.com \
--to=sox-devel@lists.sourceforge.net \
--cc=normalperson@yhbt.net \
--cc=pander@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).