Pander <pan...@users.sourceforge.net> writes:

> On 8/2/20 12:52, Måns Rullgård wrote:
>> Måns Rullgård <m...@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

Reply via email to