Number of FFT points for an LED spectrum array

Status
Not open for further replies.
I have seen projects on the web and youtube regarding spectrum analyzer displays done by microcontrollers and an array of LEDs. I am attempting something like this using a DSPIC for FFT conversion, and a bunch of LED drivers.

If I plan on using 16 LED strings (16 frequency "bins", each bin 8 LEDs high), then is there any reason not to use a 16 point FFT? If I were to use, for instance, a 128 point FFT, will that give me any advantage?
 
To get 16 points from DC to near-nyquist, you'll have to do a 32 point FFT and throw away half of the results.

You'll want to go with more FFT points if you want to shape the FFT spectrum into a logarithmic frequency scale instead of a linear. But assuming you want a linear frequency scale, there's no real benefit in going with more points.

In my experience, if you want a log frequency audio graph a shaped FFT isn't the most efficient way to do it. You'll use less DSP by creating an IIR biquad for each frequency band of interest, and detecting the average level of each biquad output.
 
Wooohoo! Just as an update (and an additional question), my IIR filters work! Now, I have to interface them

I am using fourth order bandpass filters in 5 decades from 20Hz to 20kHz (they use a total of 9 samples - the current sample, and then 8 past samples). After my samples come out of the filters, I will compare them to a "scale" to determine the proper number of LEDs to light for that particular frequency range. Should I use the average value of the past 9 samples, or the peak value of the past 9 samples? Is there a preferred measure to do this in the audio community?


Just an FYI, I am using a PIC32 (Originally, I was using a Pic 18F, but 8 bits just didn't seem like it was enough to cover the entire audio spectrum with floating point filters, 80 kHz sampling for both left and right channels, and I2C communication to talk to the LED matrix driver).
 
Thank you Dave for your suggestion!

A question for you:
After reading your link, and others, about the Goertzel algorithm, it seems like it is suited in detecting single tones (single frequencies). I am using IIR filters to look for energy content in an entire band of frequencies. Just an FYI, my frequency bands are:

20 - 80 Hz
80 - 318Hz
318 - 1266Hz
1266 - 5040Hz
5040 - 20kHz

Do you have a suggestion on how I can use the Goertzel algorithm effectively? It seems like it would only be applicable to single frequencies, not bands of frequencies. Am I understanding it right?
 
Status
Not open for further replies.