SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By thankyou
#168441
I want to create a sound detector that detects when sound comes from a place a few inches from it. I've seen some Arduino hobby projects that accomplish sound localization through volume differences of microphones, but I don't know how well this method works. It seems like a sound could come from somewhere else and it could have the same volume difference, I'm not sure...I'm thinking of the method of using the phase difference output from microphones. I've found Phase Comparator chips online...do you think a phase comparator could be used for this application? :mrgreen:
By fll-freak
#168447
What type of sound are your trying to localize? If it a sharp sound like a gun shot or a rumble like an electric motor or something else? How far apart are the microphones? Do they have good response at the frequency you are listening to?

I had an experience with a project at work where we found localization of sharp sounds to be nearly impossible. We were using difference in time of arrival. Echos and the like played havoc with the system.
Not sure how well phase would work, but the source signal would have to be a good tone for this to work well I think. If the sound had noise in it, the phase difference would be all over the place.
By Mee_n_Mac
#168466
thankyou wrote:I want to create a sound detector that detects when sound comes from a place a few inches from it. ...do you think a phase comparator could be used for this application? :mrgreen:
The details matter and I'm not sure how far away you'll have to be before the off-axis phase response of the 2 mics becomes a non-concern. But it can certainly work over some range of distances and off-axis angles. I'd look at a Teensy to do the FFTs.

Instead of making an acoustic interferometer, you could also process the 2 mics as a 1D amplitude based monopulse. Either would be a fun project.

http://en.wikipedia.org/wiki/Amplitude- ... _monopulse
http://en.wikipedia.org/wiki/Phase-comparison_monopulse
By thankyou
#168467
Thanks for the responses, I'll have to look into this stuff. I want to detect when an alarm clock goes off, so the detector would be positioned next to it and I wouldn't want any other sound to be detected.
By Mee_n_Mac
#168485
thankyou wrote:I want to detect when an alarm clock goes off, so the detector would be positioned next to it and I wouldn't want any other sound to be detected.
To me that sounds (pun intended) like a problem with a different solution. A single mike and a method (or 3) to characterize the desired sound would be what I'd look into. Imagine you want to detect if the baby was crying. Rather than detect if some sound is coming from the direction of the baby; instead detect the sounds amplitude vs time, the tonal content vs time, etc. Compare any sound to see if it matches that of a baby crying. That, combined with the general directivity of a mic, should work. Especially given an alarm is highly repeatable and consistent.
By thankyou
#168489
Mee_n_Mac, the problem is that I would want it to work on anyone's alarm, so I wouldn't know what sound to expect. I suppose it could sample the sound characteristics of someone's alarm, but some people have radio alarms so the sound would be different every day...
By stevech
#168490
I'd use a good mic, digitize it into large memory space (more than an Arduino has, so maybe a teensy 3.1), FFT/DCT, form a signature. Then decide how to match future recordings to the signature (trained) with the desired false positive/negative.

Conceptually easy. Aren't they all!
By thankyou
#168494
I guess most people's alarms have the same sound every day, so I'll try to use an Arduino Due that is based on the 32-bit ARM core microcontroller to sample the sound and recognize it again. I have no idea where to start, where is the tutorial? :D