Specific Audio Filtering - AVS Forum
Forum Jump: 
 
Thread Tools
Old 05-13-2013, 01:44 AM - Thread Starter
Newbie
 
Yolco's Avatar
 
Join Date: May 2013
Posts: 3
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
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.
Yolco is offline  
Sponsored Links
Advertisement
 
Old 05-13-2013, 06:20 AM
AVS Addicted Member
 
arnyk's Avatar
 
Join Date: Oct 2002
Location: Grosse Pointe Woods, MI
Posts: 14,387
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
Quoted: 763 Post(s)
Liked: 1179
Quote:
Originally Posted by Yolco View Post

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?

.

The Arduino appears to be a DSP on a board with basic support circuitry. In order to exploit it, it appears that you need to be familiar with basic electronics, signals and systems analysis, DSP capabilities and programming.

If you understand basic electronics and signals and systems analysis then terms like FFT would not be a mystery to you.

http://wiki.openmusiclabs.com/wiki/ArduinoFFT



If you have less familiarity with these topics you have a big learning curve ahead of you. If you are already expert in these areas then all you have to learn is the Arduino itself.
arnyk is offline  
Old 05-13-2013, 04:41 PM
AVS Special Member
 
A9X-308's Avatar
 
Join Date: Mar 2008
Location: Australia; now run by adults.
Posts: 5,468
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 182 Post(s)
Liked: 116
^^ It's an embedded micro controller not particularly suited to DSP work, though it could be made to do it, albeit slowly.

Yolco: A Raspberry Pi might be a better solution as it runs Linux natively, is a lot faster and I'm sure there are a lot more libraries and or support for DSP.

I use a number of networked Mega2560 in my home and am just starting to play with the R Pi as a GUI interface.
A9X-308 is offline  
Old 05-14-2013, 01:47 AM - Thread Starter
Newbie
 
Yolco's Avatar
 
Join Date: May 2013
Posts: 3
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Hi,

thanks everyone!

@arnyk: I have some knowledge about DSP, also I have tried FFT library for arduino, now my doubt is how can I read, save and compare the sound measured with a 'pre-defined' one?

@A9X-308: 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.

Regards.
Yolco is offline  
Old 05-14-2013, 06:51 AM
AVS Addicted Member
 
arnyk's Avatar
 
Join Date: Oct 2002
Location: Grosse Pointe Woods, MI
Posts: 14,387
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
Quoted: 763 Post(s)
Liked: 1179
Quote:
Originally Posted by Yolco View Post

Hi,

thanks everyone!

@arnyk: I have some knowledge about DSP, also I have tried FFT library for arduino, now my doubt is how can I read, save and compare the sound measured with a 'pre-defined' one?

@A9X-308: 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.

If you wish to create a signal that focuses on a certain instrument, bandpass filtering can work. If there are multiple instruments with fundamentals and the first 2-3 harmonics in the same range, then separating them will be very difficult.
arnyk is offline  
Old 05-14-2013, 07:18 AM
AVS Special Member
 
DonH50's Avatar
 
Join Date: Feb 2010
Location: Monument CO
Posts: 6,370
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 268 Post(s)
Liked: 302
I recently saw a demo in a college engineering lab doing essentially this, using National Instruments SW. It was for an Engineer's Day event and was something the freshmen could do.

I agree with Arny that if you don't understand FFTs and basic filtering you have some research to do. Just sampling and generating FFTs (Fast Fourier Transforms) will provide the spectral content of the signals, then you can process the FFT data to look at specific frequency bands. An FFT allows you to move from time-domain samples to frequency-domain analysis.

IME/IMO sound discrimination usually requires a combination of time- and frequency-domain processing.

"After silence, that which best expresses the inexpressible, is music" - Aldous Huxley
DonH50 is offline  
Old 05-14-2013, 07:32 PM
AVS Special Member
 
Roger Dressler's Avatar
 
Join Date: Jul 2000
Location: Oregon
Posts: 8,993
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
Quoted: 847 Post(s)
Liked: 366
It would help to know what you want to happen once the comparison has been made.

1) Illuminate an indicator
2) Extract the audio of interest
3) other

Deadwood Atmos theater
AV7702 Atmos 7.4.4, SSP-800 PLIIx 7.4
Aerial Acoustics 7B/CC3B fronts, B&W CWM8180 surrounds, Tannoy Di6 DC heights, Hsu ULS-15 subs
Roger Dressler is offline  
Old 06-11-2013, 02:14 AM - Thread Starter
Newbie
 
Yolco's Avatar
 
Join Date: May 2013
Posts: 3
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Hi,

thanks all!!

I'm going to try for better explanation of my task.

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 know I have to implement it on code, and although I know how to do it, it's being hard to me doing it.

Regards.
Yolco is offline  
Old 06-11-2013, 08:30 AM
AVS Special Member
 
DonH50's Avatar
 
Join Date: Feb 2010
Location: Monument CO
Posts: 6,370
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 268 Post(s)
Liked: 302
Most systems that I have seen (very few) or read about use proprietary algorithms and capture several training records to provide some measure of both confidence and rejection criteria. This sounds like a fairly hard project. Deciding on a valid response when the subject may vary the password from day to day or when under stress, and a bad response when someone tries to trick the system, may be challenging. But, voiceprints are not something I really know anything about.

Most C cookbooks as well as texts like Oppenheim et. al. have descriptions and algorithms with code/pseudocode to implement FFTs. For that matter, most signal processing chips have it built-in as a function call, either in the HW or the compiler.

"After silence, that which best expresses the inexpressible, is music" - Aldous Huxley
DonH50 is offline  
 
Thread Tools


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off