Toxi has posted a useful comment on the nature of FFTs over on the Processing forum. It should be of interest to those who have been looking at the SoniaHelper library.

[...] Even if you’re thinking of analyzing only the range of formants of human voices you can work with ONE frequency band, but please don’t mix this up with the spectrum bins returned by the FFT… In most cases speaking about a band of frequencies will refer to a whole collection of bins. Escpecially if you want to target/analyze the behaviour of a specific frequency bin, you’ll need as many bins as possible to start with. In theory a spectrum of only one bin would cover the whole frequency range 0 Hz < f < 1/2 the sampling freq...

Since the FFT is attempting to break down the signal into a series of sinoids, at least 2 samples are required in order to work out the contributing frequencies of this signal (It's mathematically impossible to do it with one only).

Running danger of becoming too mathematical, the number of frequency bins required directly relates to the number of samples analyzed. In other words, the fewer bins you want in your spectrum the shorter (in time) the chunk of signal analyzed and so the poorer the quality/precision of the computed spectrum as well. For most applications a spectrum of anything under 128 bins will be pretty unusable since the related time window is too short (<3ms) and you might be better off just working with the average volume of the samples by using Ess's equivalent of Sonia's LiveInput.getLevel() method.

Toxi wrote the FFT code that is used in Sonia. You can download it here: http://www.toxi.co.uk/p5/fftDebug/.

Comment on this entry

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>