Filtering Specific Audio

This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.

I have some doubts about how to implement a solution for the app that I explain below:

  • I want to filter specific audio sounds (truck, trumpet...) with an arduino and a microphone (amplifier + microphone).
  • The main idea is taking samples for a short time (a few seconds), analyze the sound in frequency, and know if it is from an audio source or another.
  • I have characterized my target sounds in three frequencial components (Hz), with their amplitude (dB). And I only want to compare the sound measured with these components but I can't split them from audio samples I have taken.

I read about doing it with 'ffft' library, but for the moment I don't know how to implement it. Could someone tell me how to do it?

Is there another solution for this app?

Arduino won't do, you need some hefty CPU.
Then you want to continuously FFT the signal (realtime), match it to the patterns stored (with frequency offsets and level matched), compare the normalized FFTs of microphone sound versus stored "samples" (at least one sample per sound you'd like to recognize), decide which of which matches best at which severity...

Same thing goes with picture recognition as well as some old studies on voice recognition...
These subjects are well-known and the methods are documented - learn DSP, FFT, and follow to the image/voice recognition techniques.
Depends on the language you use - it's either fast writing and slow code or slooooow writing and code which speed will quite depend on your coding skills :)

Doing a FFT with tiny window size, on lowish sample rate will help to speed things up...
Could be fitted to almost any okayish CPU.

I'd go for android OS (if portable is must) - the hardware is already there, with a nice screen and fast CPU.
Cute lookink.
depends, would you be able to leverage the GPU for FFT? the BB black also has 512mb DDR3 and 2gb of onboard eMMC. got one on the way for glorified MCU and Xbee wifi/network receiver for a small network of 6 balanced amps and 3 stereo balanced ESS dacs.

I wont use it for much processing, the crossover and convolution will still be done on my i5 mac mini and the result bounced over the network and output by USB. thats the plan anyway, I may not send the signal via it at all, just use it for housekeeping, power switching/sequencing.

thanks everyone!

There's FFT library for arduino.
My doubt is how can I read, save and compare the sound measured with a 'pre-defined' one.

I know there are several best options for doing this task, but I want to try doing it with Arduino. I'm not looking for doing a perfect system, only one which allow me to compare sounds and give a positive detection if sound is similar.

I know there are a lot of parameters to take in mind, but for this application I want to abstract the most I can from them.

Hi Yolco,
I would suggest (assuming you already have one ) a PC or MAC .
This will give you ample processing power and provides the audio I/O, at no extra cost.
Add a free C/C++ complier and you are ready to go.
Use this for proof of concept and then spend money on dedicated hardware if you choose to move forward.
Hi all,

thanks again for your answers.

I know it's a hard task, and more if we are talking about doing with an 8bit MCU, but this is my task and I have to do it.

I want to be available of taking samples for a while (1 second or less), do the FFT of these samples, and compare them with a pattern previouslyu stored in memory (EEPROM or FLASH). If a true check is given back, I have to switch on a led. It's a way of doing a sound security system (password).

I've been reading more about DSP and FFT, but it is still hard doing it.

cut sample frequequency as much as possible - musical instrument fundamentals are <3 kHz, voice band codecs work at 8 kHz sample rate - 4 kHz Nyquist

8 bits is tight for audio dynamic range - telephone grade codecs have built in compresion curves to fit even their restricted signal into 8 bits - maybe use a AGC amp up front?

what is the background signal - what are you descriminating from makes a difference too
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.