In today’s edition of “Engineering Roundtable,” SparkFun Engineer Chris Taylor guides you through the use of a microcontroller to perform audio spectrum analysis. He explains the basics of working with the audio spectrum, and ultimately links up his project with a propane torch. Why? Well…why not? Check it out:

Feel free to leave any comments or questions in the comments section below and we’ll do our best to answer them! Thanks for watching and we’ll see you again soon with another edition of “Engineering Roundtable!”

Comments
12 comments

Excellent video, Chris! You mentioned that when gathering data for an FFT that you want to gather as much data as possible. When doing audio recording, we always use the rule of thumb that your sample rate needs to be at least twice that of the highest frequency you wish to reproduce. Depending on how the hardware/software controls sample rate, but if it’s 16MHz, you might be wasting a bunch of cycles. To analyze up to 20KHz, you would only need to sample at 40KHz…I think…

As a practical matter, if you are interested in accurately sampling audio from a few Hz up to 20 kHz, you have to sample at a rate higher than twice the highest frequency you desire to sample. Why? The anti-aliasing filter that precedes the A/D converter will have a transition band between its pass band and its stop band which will allow some, but not all of the signal to pass. If you design the filter so the stop band is at 20 kHz, no aliasing will occur, but the audio in the upper part of the audio spectrum will be in the transition band and be inaccurately sampled. If you design the filter with its pass band ending at 20 kHz, any noise in the transition band will be aliased if you sample at 40 kHz. This is why CDs audio is sampled at 44.1 kHz. When designing the antialiasing filter, any signal with a frequency greater than ½ the sample frequency must be reduced to less than ½ the LSB value of the A/D converter to avoid aliasing.

For digitally detecting a single tone, the use of the Goertzel algorithm is far more efficient than a FFT. For example, this algorithm is often used to detect DTMF tones on general purpose processors. While there are only eight tones that make all the DTMF digits, to avoid speech being detected most implementations look for the second harmonic of each tone as well and only show a valid digit when proper fundamental tones are present in the absence of their second harmonics. (Speech is rich in harmonic energy, while valid DTMF digits are not.)

The forge torch disclaimer reminded me of a certain scene from The Incredibles. You know the one where the little old lady is “not” being told, in great detail, how to navigate the complex bureaucracy of the insurance agency a former superhero currently works at. ;)

I’m actually not sure about the brand of solenoid. I walked into Grainger and had the guys there spec it out for me. It was only $70, but it had compression threads as opposed to the pipe threading I needed for the pipe, so finding adapters was a real headache. The Asco valve you used might be the best bet, because everything I’ve found online that is spec’d for flammable gas at that kind of pressure is comparable in price.

This reminds me of a project I did many years ago with Discolitez (remember Winamp?). I had a three headed torch responding to bass, mids, and highs. The who thing made my wife nervous and it got shelved before I built a 32 head unit. I ran at tank pressure for 12-15 foot(4-5 meter) flames. Not that anybody should try this!
I still have a board in the basement with 32 light sockets filled with 40 watt bulbs attached. This video has me thinking I should port this over to a microcontroller.

SparkFun is an online retail store that sells the bits and pieces to
make your electronics projects possible. Whether it's a robot that can
cook your breakfast or a GPS cat tracking device, our products and
resources are designed to make the world of electronics more accessible.

In addition to products, SparkFun also offers
classes and online tutorials to help educate
individuals in the wonderful world of embedded electronics.