Making an audio spectrum analyzer with a microcontroller

While [Vinod] says he’s not an expert in this sort of thing, we really like his audio spectrum analyzer build from a simple microcontroller and LCD display.

It is a well-studied fact that every audio waveform – a recording of your voice, for instance – is just the sum of many, many sine waves. These sine waves can be plucked out using Fourier analysis, using a Discrete Fourier transform. This is the principle that spectrum analyzers operate under; [Vinod] wrote a bit of code using DFT to take apart audio captured from a microphone and output their frequency on an LCD display.

To output the spectrum on his LCD, [Vinod] stacked horizontal bars up into 8 custom characters in his display. Like [Vinod]‘s previous audio on an ATMega32 experiment, an LM324 amplifier is connected to the ATMega through an analog pin. [Vinod] has a very clever build on his hands with his spectrum analyzer, and a great answer to the perennial ‘how do I build a guitar tuner’ questions we’re constantly asked.

After the break, you can see [Vinod]‘s spectrum analyzer in action. Be forewarned; you may want to turn down the volume.

Comments

  1. C. Holmberg says:

    Ah, reading the linked page *first* pays dividends! I was going to ask why Vinod didn’t use the more efficient FFT, instead of the DFT. But, he has already stated his rationale!

  2. Michael says:

    You could multiply the data with a Hamming window to reduce the spectrum spreading of a single tone.

  3. Abhi says:

    AT’mega’ , isn’t that the powerful one ? Do we need a ‘mega’ controller for running simple DFT at 16 MHz. I think (can’t surely say that), a cheaper one would have been better. (Its been loooooooong I am out of touch with MCUs, so pardon me if I am making a mistake)

    • deathventure says:

      ATmega’s are the cheap ones. Atmel’s range is pretty wide, from small low IO ATtiny’s to the newer hi IO 16 bit ATXmega series. ATmega’s are the standard 8-bit line. It would be a good idea just to browse their site to see what they got, as well as Microchips to see what new PIC lines they have.

  4. Very cool! I worked with a colleague a couple years ago on a similar project which identified materials by tapping on them with a solenoid and running the audio through FFT. We used an 8051.

  5. rue_mohr says:

    sweeet, someone did the work for me! gonna build it!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,871 other followers