Discussion:
[SoX-devel] Extra documentation / question about stat -freq
Pander
10 years ago
Permalink
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 Failed to load image: https://i.imgur.com/Erk1ouN.png
- second Failed to load image: https://i.imgur.com/78tBJpZ.png
- third and last Failed to load image: 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 Failed to load image: https://i.imgur.com/ePpwM1d.png
and Failed to load image: https://i.imgur.com/NPkCSqA.png respectively but the last one is
also malformed, see Failed to load image: 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

Loading...