Audio spectrum analyser driven by Atmega AVR seems to be a one of the favourite topics. Pong board gives us a nice display with 12 column ten LEDs each. This makes this display a perfect one for a spectrum analyser. I will not elaborate here any mathematics part of a spectrum analysis. What you need is a discrete Fourier transformation (DFT) or better to say a respective fast algorithm so called FFT. Luckily FFT (its fixed point version) was implemented for Atmega AVR by ChaN in 2005. See for details http://elm-chan.org/works/akilcd/report_e.html. I reused his code and by adding some neccessary lines I made out of the Pong board an audio spectrum analyser.
The audio signal is connected to the Right Potentiometer via 100µF capacitor. A really bad solution
The results are not bad – see two examples.
Remark: in the second video I used some commercial music. It has been flatten by my monitor speakers and microphone from digi cam but we know youtube . I hope they will not remove this clip or get rid of the soundtrack.
I’m quite satisfy with so simple implementation and a pretty good result. I would add here kind of op-amp as a input filter. Max239 from ChaN’s projekt seems to be a good idea. From the application point of view I would look closer to the size of the buffer used for data samples. A decrease to 32 and getting 16 results fits much better to our small display. And more display effects would make this more interesting.
The sounds at the begining part is not the best, I will make the video once again if someone will ask for
http://www.youtube.com/watch?v=-YsMRiT4e94
http://www.youtube.com/watch?v=Dwob_27O8SM
Here another video, from local host (commercial audio and youtube policy make me crazy)
By the way:
In the first video I used two free programs from http://www.marchandelec.com: very simple function generator and third octave real time spectrum analyser. It is a pity there is nothing similar under linux. The only one I found it was python based tone.py: http://aa6e.net/software/tone/index.html. It does not work for me in my new Pulse Audio environment (padsp does not solve anything). Another peace of software, a command line tonegenerator: http://www.lns.com/papers/tonegen/ works fine with padsp.
Any your feedback regarding Pong Audio Spectrum Analyser or a function generator under linux is highly appreciated.
Download AVR 4 Studio / WinAVR files from here
