I'm about to build a coffee table which has a RGB LED matrix build in it just like in this video. https://www.youtube.com/watch?v=4NJDgvV8RZw

I want the matrix to display an audio spectrum that should be calculated in real time from a variable audio source over a 3,5mm audio plug. ( e.g. smartphone, PC, mp3 player )

It sould also just display random and/or programmed visuals patterns. ( not related to the audio input )

So i thought using an AVR microcontroller as the main unit of this project.

The mcu will be programmed once, and does not have to communicate with other devices.

Buttens will be used to switch between modes and/or annimations.

So the basic idea is there, but there are a few things that I'm not shure about:

  1. Should I build a bandpass filter board to get the spectrum data and process it from there on with the mcu or go for the FFT- ( complete-software- ) solution ? Which one is faster / more effective ? Does the speed difference matter in this kind of project ? ( Yes I know there are a couple of questions with the same topic, and I've read a few of theml, but I think the answers wheren't specific enougth for me )

  2. How do I choose the amount of bands for my spectrum analyzer ( collumns of the matrix ) ? Does it matters how many bands I choose ( since I want to design the RGB LED matrix driver board and the table with its dimensions based on my selection ) ?

Thanks for your help and please exscuse my bad english.

  • 1
    \$\begingroup\$ Would an MSGEQ7 be useful? \$\endgroup\$ Commented Dec 22, 2014 at 13:05
  • \$\begingroup\$ I also came across with that IC, but since I an planning a resolution of >20 bands, I don't know if I can combine a couple of the MSGEQ7 ( which has 7 bands ) to achive that ? \$\endgroup\$
    – Ace
    Commented Dec 22, 2014 at 13:11
  • \$\begingroup\$ Thats why I was thinking of using opamps to build myself the amount of bandpass filters that I need. But because that would be a huge board, I am concidering using the FFT solution. \$\endgroup\$
    – Ace
    Commented Dec 22, 2014 at 13:12
  • \$\begingroup\$ You can take the seven band data and interpolate up by averaging between two given bands to get the 20 bands of output \$\endgroup\$
    – Passerby
    Commented Dec 22, 2014 at 15:50
  • \$\begingroup\$ Yes interpolating was the first think that came into my mind, but I think this method would be way to "dirty". \$\endgroup\$
    – Ace
    Commented Dec 22, 2014 at 16:18

1 Answer 1


Personally I would go (and have in the the past gone) the FFT route. However I wouldn't use an 8-bit AVR, I'd use something somewhat faster.

My personal weapon of choice is the PIC32, which has more than enough power to do a good job of the FFT, but there are other good choices besides that - such as one of Atmel's 32-bit ARM chips (SAM3X for instance, like in the Arduino Due), or many of the other ARM chips that there are out there.

The trick with FFT is you need a good fast sample rate and enough memory to store a complex sample buffer. Say you want 1024 samples (which would give you 512 FFT buckets to play with), at 16 bits per sample, plus 16 extra bits for the complex FFT component, you're talking a minimum of 4KB of RAM just for the sample storage. Also, if you want it to be smooth then you want to be using DMA to read the samples in to one buffer while running FFT on another buffer, so a ping-pong double-buffer would increase that to 8KB.

With FFT you get half the number of buckets, or frequency ranges, as you have samples. The frequency range is also half the sample rate. So if you have 1024 samples recorded at 48KHz, that gives you a frequency range of 0-24KHz, with (24000/512=) 46.875Hz per bucket.

Reducing to 128 samples would give you 64 buckets, each at 375Hz per bucket.

  • \$\begingroup\$ Well first, I want to stick with the Atmel mcus, since I am used to it. And if I need a powerful mcu to do the FFT magic AND also need to store other visual patterns in it, woudn't that be way to "overpowered" ? I mean, I want this project to be as efficient as possible. ( In therms of energy and building costs ). So woudn't it be cheaper to buy a couple of resistors, opamps and caps ( for the spectrum analyzer part only of course ) instead of buying a powerful mcu ? An d do you mean "bands" with "buckets" ? \$\endgroup\$
    – Ace
    Commented Dec 22, 2014 at 13:50
  • \$\begingroup\$ Frequency bands is the concept, but buckets is the name given to them. Because you pour all the data from that range of frequencies into the one bucket. And while a more powerful MCU will use more juice than a low-powered MCU, I can't see it using anywhere near as much as a low-powered MCU plus a bunch of op-amps etc. I mean, the top-end PIC32MX running flat out at 80MHz uses around 85mA. \$\endgroup\$
    – Majenko
    Commented Dec 22, 2014 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.