The basic idea was to create color organ / spectrum analyzer on arduino board, trying to minimize quantity of external components, like analog filters, LED display drivers, etc.
Spend a lot of time in search on internet I was able to find only two ! project , which implemented FFT in order to solve a problem. One of them is: http://elm-chan.org/works/akilcd/report_e.html in a few days it will celebrate 6-th anniversary. The obstacle, at least for me, was to compile / adapt his software for Arduino IDE platform, as it written in assembly and C. So, I've moved on, and was lucky to discover an excellent chunk of code dated back to 1989! They didn't have floating point co-processor or "blue deep" around at that time, so mathematical skills were in high demand.
Video on youtube.
FFT algorithm could find application in wide variety of projects, for example, musical note recognition, voice recognition, sound localization etc. It could be done in Arduino, or in combination with PC. To use the the data provided by Arduino board in different application on PC (like interactivity / processing), you can just pull data over serial link, as it was done for debugging purposes with "f" command.
After FFT-processing input data array x, generated output array fx with 32 elements, "bins", each representing a range of frequencies. The width of a bin equals: D = 1 / T, where T is input array sampling timing, in our case T = 14.6 millisecond.
D = 1 / (14.6 * 10^-3) = ~ 70 Hz.
So, the value of fx is amplitude DC offset up to 35 Hz;
fx is amplitude in a range 35 <---> 105 Hz;
fx is amplitude in a range 105 <---> 175 Hz;
fx is amplitude in a range 175 <---> 245 Hz;
fx is amplitude in a range 245 <---> 315 Hz;
fx is amplitude in a range 2135 <---> 2170 Hz;
Upper limits could be extended up to 76 KHz.(*)
Sum up first 10 fx bins, I'm getting 35 <---> 735 Hz frequency range for red LED's, from 11-th to 20-th consequently provides me 735 <---> 1435 Hz for green LED's, and from 21-st to 31-st 1435 <---> 2170 Hz range for blue LED's.
Now hardware part.
I was considering two way to build display, using PWM or BarGraph. In my opinion, PWM is not quite suited with LED, due nonlinearity in their current-brightness response. Probably, PWM approach would be O'K with incandescent lights.
BarGraph design gives better impression, when higher sound volume highlighted bigger area. Just imagine, how beautiful Fireworks are!
I've used Christmas LEDs, that left over since last holiday :) This is why I put 3 of them in each string, and have to use ULN2003 with 12V power source. Basically, all you need is 12 Leds ( 4 - red, 4 - green and 4 blue ) and 12 resistors, connect led+resistor between output of arduino board and ground.
For sound input I used a kit MK136 ( 2 mic's + amplifier IC NE5532 ), powered up from arduino board +5V. Why kit? It provides a board and components. Next, you can easily reconfigure input circuitry for different sound sources as:
1. signal from 3.5 mm jack connector
2. pick up sound using microphone.
3. configure one channel with mic and another with 3.5 jack, that is what I did.
Plus it has a pot, to adjust sensitivity on the fly. Don't install DC blocking capacitors at the outputs.
Sparkfun's breakout board for electret microphone will works too: http://www.sparkfun.com/products/9964
(with some limits, from 3 options listed above only number 2 would be avaiable.)
Here how to create DC offset with just couple resistors + cap. Circuit requires line level of the input signal (~1 V). You can use headphones output.
Link to download sketch: Music_color
*Please, be advised, code written for AtMega328p and should be corrected to work with other microprocessors.
Sine Tables for someone who 'd like to experiment, but don't know how to create them: Sine_Tables
* More on how define higher frequency range/ sampling rate you can get from other my blog: http://oscilloscopeexpress.blogspot.com/
Thats it for now, will come back to answer your questions if you have any.