Fourier Transforms - Followup Question

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
crafty184
 
Posts: 21
Joined: Tue Oct 08, 2013 12:14 pm

Fourier Transforms - Followup Question

Post by crafty184 »

Any chance you could get Tony Dicola to look at this question?

My students and I have built successfully your Teensy/FFT tutorial on Adafruit (https://learn.adafruit.com/fft-fun-with ... ransforms/).

Here's my question.

We want to use the tone detector theory to detect gunshots. We analyzed a sample from a Glock 19 and looked at the spectrogram (using Audacity), and plugged in some values to the tone detector and it doesn't work. Do you think this is a tenable idea? Your code is straightforward and we have adjusted the sample rate to 128 and inputted known good hz numbers (drawn from the Audacity spectrogram), but to no avail.

Just wondered if you might kindly add your thoughts to this discussion. Thanks!

Chris

User avatar
paulstoffregen
 
Posts: 444
Joined: Sun Oct 11, 2009 11:23 am

Re: Fourier Transforms - Followup Question

Post by paulstoffregen »

Whether or not FFT is a good approach for recognizing might be debatable. I can't really comment on that.

But I can point you to a newer, much more capable FFT example. Since Tony wrote that tutorial, an advanced audio library has been developed. It comes with the Teensyduino installer, so if you added the libraries during install, you already have it. The FFT example should be in your menu, under File > Examples > Audio > Analysis > FFT. The example can also be seen here:

https://github.com/PaulStoffregen/Audio ... FT/FFT.ino

If you're using Arduino 1.6.0 or 1.6.1, make sure you have Teensy selected in Tools > Boards. The menus in the newer version of Arduino update depending on which board is selected.

This example is written to use the high quality audio board. Using this board and a Teensy 3.1 would be the easiest path of least resistance.

https://www.adafruit.com/products/1780

It's possible to adapt to use the on-chip ADC. You'd need to replace AudioInputI2S with AudioInputAnalog. Detailed documentation is here:

http://www.pjrc.com/teensy/gui/?info=AudioInputAnalog

Again, I want to mention this message is only about getting data streaming from an analog signal to a FFT object that gives you much better performance. Ultimately, you'll get the FFT analysis, but it's up to you to figure out what to actually do with the data.

If you do get it to work, I hope you'll post a followup (though I know students rarely do, but maybe you will?) It might help others trying to use FFT to recognize sounds.

User avatar
crafty184
 
Posts: 21
Joined: Tue Oct 08, 2013 12:14 pm

Re: Fourier Transforms - Followup Question

Post by crafty184 »

Thanks kindly for the direction, here.

I will explore this, and appreciate the guidance towards a more advanced audio library.

I will gladly post a followup (I'm the teacher, working with my students) based on our progress.

With appreciation,

Chris

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”