Go Down

Topic: Audio Filtering (Read 888 times) previous topic - next topic

Yolco

Hi,

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?

Regards.

Grumpy_Mike

Quote
Is there another solution for this app?

You mean one that will actually work?

The FFT is your best bet there's a libary that implements it for you.
However it is not as simple as that as many sounds will give similar spectrums and it is almost impossible to tell them appart.
One approach is to have a template, that is a set of readings for each sound and to compair your unknown sound to the template. However this approach also gives false positave and negitave responces.

Magician

There is a project based on fft and cross-correlation for voice recognition, may be any sound up to 2 kHz bandwidth : http://coolarduino.wordpress.com/2012/10/18/speech-voice-recognition-remix/

DVDdoug

Quote
•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'm not sure I understand... If you have a truck and a trumpet at the same time, and you want to filter-out the truck, that's virtually impossible.*   Except, you can filter-out low frequencies such as "rumble" from the truck.

If the sounds are not occuring at the same time, you have a better chance of automatically separating them.    But of course, not all trucks generate the same frequencies at the same volume, and a trumpet can play many different notes and can be played/recorded at various volumes.  There is no simple "fingerprint" for either of these sound-sources.




* "You can't un-fry and egg, you can't un-bake a cake, and you can't un-mix a recording."

If you could do that, there would be no need for multitrack recording...  You could record the whole band with one microphone at once, un-mix, edit, and then re-mix.    That technology does not exist.

Yolco

First of all, thanks everyone!


  • Grumpy_Mike: I could compare with a template, but for example, I don't know if it will work when volume doesn't be the same.

  • Magician: I need to go up to 22 KHz, I'm going to take a look to your link. It could be helpful for me.

  • DVDdoug: My idea is compare one sound a time, and in one specific case. So if it is a truck, it will be a specific truck in one determined moment. If it is a trumpet, it will be the same trumpet playing the same music notes.



I had thought about make a first reading amplitude attempt (in dB) for three different frequencies, then save them, and after that listen sound compare with them for detect if is positive/false detection.

Regards.

Grumpy_Mike

Quote
Grumpy_Mike: I could compare with a template, but for example, I don't know if it will work when volume doesn't be the same.

That is the point with cross-corrilation it dosn't have to be the same.
You will not get the same sequence of samples with two sampling of the same recording of a sound because the sound and sampling time are not synchronised.

DVDdoug

Quote
So if it is a truck, it will be a specific truck in one determined moment. If it is a trumpet, it will be the same trumpet playing the same music notes.

I had thought about make a first reading amplitude attempt (in dB) for three different frequencies, then save them, and after that listen sound compare with them for detect if is positive/false detection.
That might work.  You'll have to experiment, and I'm not sure if 3 frequencies is enough.   You'll also have to allow a range/window of dB levels in each frequency-band, because it's never going to be exactly the same twice. 

You might want to take an average of the 3 (or more) frequency bands to calibrate the overall level before analyzing the frequency content.


CrossRoads

Get a muti-band graphic equalizer (like 10 bands), as would be used on a stereo, and try just listening to the different bands.  That's the kind of thing you are trying to duplicate.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Yolco

Thanks all!  :)

Now I'm going to try it.
Although I have some knowledge about DST this is going to be hard for me. I have to understand fine how to store the right values after doing FFT, and then how to compare it with the new samples (programming issue).

Regards.

Go Up