LED AudioSpectrumAnalyzer Using Arduino+MAX7221

Hi,

Im thinking of using arduino and 4xMAX7221 to make LED Audio Spectrum Analyzer that is controlled from computer when you're listening music from it, and the hardware doesn't need to be independent from the computer. The problem is that i don't know how to extract the audio signal from the sound card on the PC. Generally i need code to extract specific frequencies (something like the spectrum analyzer embedded in winamp with the difference that i need to be external).
To be clear on what I'm talking about here's a videos of such hardware:

The audio signal from the PC can be "extracted" through the headphone plug and then use different electronic filters (I guess you need one low pass, several band pass and a high pass filters) to separate the frequencies, then use a vu-meter for each frequency range. The vu-meter can be implemented using LM339N comparator chips or use specialized audio vu-meter chips. I haven't built one, but this is how I would start if I need to do it one day. This is a 100% analog solution without Arduino used. The MAX7221 is to drive a 7-segment LED display, so I am not sure if you can use it to show a vu-meter effect.

Hi,

The MAX7221 is to drive a 7-segment LED display, so I am not sure if you can use it to show a vu-meter effect.

You can drive up 64 leds individually from one MAX7221 (and daisy-chain them, 512 Leds should not be a problem).
But digital input-data must obviously be available!

I didn't really understand if you want to do the audio-processing with some external hardware or in software on the computer?

Eberhard

Hi,

The MAX7221 is to drive a 7-segment LED display, so I am not sure if you can use it to show a vu-meter effect.

You can drive up 64 leds individually from one MAX7221 (and daisy-chain them, 512 Leds should not be a problem).
But digital input-data must obviously be available!

I didn't really understand if you want to do the audio-processing with some external hardware or in software on the computer?

Eberhard

I know that you can drive a 8x8 led matrix from max7221 and i was thinking to connect four MAX7221 ic's to get 16x16 led matrix and that is 256 leds controlled individually. and the audio-processing will be in software on the computer, if i can do that somehow.

Hi,

The MAX7221 is to drive a 7-segment LED display, so I am not sure if you can use it to show a vu-meter effect.

You can drive up 64 leds individually from one MAX7221 (and daisy-chain them, 512 Leds should not be a problem).
But digital input-data must obviously be available!

I didn't really understand if you want to do the audio-processing with some external hardware or in software on the computer?

Eberhard

I know that you can drive a 8x8 led matrix from max7221 and i was thinking to connect four MAX7221 ic's to get 16x16 led matrix and that is 256 leds controlled individually. and the audio-processing will be in software on the computer, if i can do that somehow.

Audacity http://www.audacity.de/ has an option for analyzing the Frequency-spectrum of an audio-file, maybe you can get some ideas looking at their code?
Eberhard

On the physical side of things, try plugging into the headphone/line-out. If that's occupied, many motherboards have an on-board header for audio - you can pull it from there as well (if you're installing something in a case that would actually be cleaner).

Where driving the spectrum analyzer is concerned, what you want is a Fast Fourier Transform (FFT). More info here:

The little Atmel we use will actually do a decent FFT, and if you Google you can find example code + libraries for this. What you'll do is use the FFT to separate the signal into frequency bins, then use the magnitudes of those bins as inputs into your LED driver code.

Here is a Japanese guy who has done exactly this - but he's outputting to a display rather than LEDs:
http://elm-chan.org/works/rsm/report_e.html

Take a look at his code though. He claims to be running his FFT + display code at 60Hz which is plenty fast for a spectrum analyzer.