DIY Sound Localization Sensor

sound_localization_sensor

Sound localization is very popular in law enforcement circles due to its accuracy and ability to quickly separate gunshots from other similar noises. These systems don’t come cheap, and after trying to build one himself, [Fileark] knows why.

He thought it would be neat to build a sound localization sensor based on how the human ear determines a sound’s source. Once he got started however, he realized just how hard it was to do localization just right.

He used an LM324N op-amp as a volume comparator, which he says works decently enough though he figures there are ICs out there that can do a better job. [Fileark] reports that the sound detector works well when the source is within about a foot of the sensors, but performance deteriorates at greater distances. He may consider using an ARM Cortex-M3 as his sound processor if he builds a second version, since the Arudino he used just doesn’t have enough power to sample and run calculations within the 10-50 microsecond window he requires.

Keep reading to see a video of his sound localization sensor in action.

[youtube=http://www.youtube.com/watch?v=yHyuzKRZFUY&w=470]

32 thoughts on “DIY Sound Localization Sensor

  1. “He may consider using an ARM Cortex-M3 as his sound processor if he builds a second version, since the Arudino he used just doesn’t have enough power to sample and run calculations within the 10-50 microsecond window he requires.”

    Why not a PC? Lots of processing power there and odds are he has one.

  2. Those cheap fet mics have a fairly consistent omni response, that would seem reasonable if you’re trying to mimic the human localization scheme, but how about using tight hypercardioid dynamics that have a response peak in the part of the spectrum that you want to localize, and then measure the phase relationship to determine your direction? Sure it’d be expensive-but think of the bragging rights! lol

  3. @lwatcdr, I agree that prototyping sound localization should probably be done on a PC first before moving to a microcontroller.

    @fm, Wow, thanks for the Kinect tip, it looks like Microsoft included the microphones to eventually possibly use for sound localization but have not realy implemented it yet. I am looking and can’t find any hackers that have done it yet either. I always wanted an Xbox…

  4. I wonder if one could duplicate the human outer ear well enough, this could be done with just 2 microphones? Maybe duplicating the ears of another of Earth’s creatures would better easier? I wonder if time difference of arrival techniques are easily achievable at audio? Probably not not as easy it is are RF. An entertaining application would be a robotic head at the side of the roadway, that would focus on vehicles as they approach, following them as they pass by.

  5. I think HaD has put an arduino in my brain. I can’t tell you how often I have started some new project or gotten some new wierd hardware, and then suddenly a few days later, HaD has a story on it.

    Example: Last week, a friend gave me a tranz380 credit card terminal to play with, and then *poof* a story about hacking a tranz330.

    And just today I was reverse engineering a phase detector circuit at work to troubleshoot it and started realizing that I could use it to build a sound locater. Drew some schematics on a napkin and everything. I come home (my work thinks HaD is about hacking and banned it. :( )and get on here, and *poof* there is a story about a sound localizer.

    Very odd…

  6. @D_ on one hand, audio should be easier than RF, because the speed of sound through air is shorter. Using just peaks, like a gunshot, and ignoring echos, you need about a foot of separation and the ability to measure under 1ms difference.

    The problem with determining direction by phase is that A above middle C has a wave length of about 1.2 feet, so depending on how close or far apart your two sensors are you could get some bad data. And, since the peak of the phase moves at the same speed as above, with just 1 foot separating the mics, you will need a fast response time.

    If you treat the Arduino like just another AVR proto-board, and program low level, the interrupts might be fast enough to trigger under 100us. The Arduino language wrapper, though, will be too slow I think.

  7. The sound pickup device needs to remain stationary. Eliminate the center pickup. Four microphones, one on each corner, are needed for surround sensing. Place the microphones in PVC tubing for greater directionality. Add some foam to reduce wind noise.

    Much of your problem is from overwhelming the sensor with noise from the servo. You might want to consider increasing the gain on the preamp just a tad. What good is it if you need to scream into it’s ears as if at a loud concert. Heh? What’d you say?! Can’t hear you over the music.

    Implement a sample/hold circuit by adding another op-amp to the circuit between the preamp and uP. This will solve the 10-50uS timing issue by latching the analog signal until the uP has time to service it.

  8. Have you listened through head phones to what your mics hear?
    I wonder if the servo makes too much common noise.

    If the two mic signals are summed then used as cancellation feedback into each channel, perhaps that would help.
    Then when the sound is equal on both mics, there is no signal so the unit need not move.-?
    Perhaps high-pass filtering, as high freq is more directional as one decision input.
    Then low pass as the other decision input.
    Phase and echo may be misleading as data depending on the rule set.
    It’s strange how we can also tell above left/right or below left/right as I listen to snoring to my lower-right.
    Perhaps in-phase delay could be used for triangulation as the delay is the vector in the hypotenuse of a triangle???(+ve) is left, (-ve) is right?
    For those who know FFT (not me), would that help here??

  9. I’m not sure that comparisons with gunshot locaters are helpful.

    Vehicle mounted ones appear to use at least 5 microphones, and they’re dealing with distinctive sounds, so are presumably optimized for this purpose. On top of this, I’ll bet they throw some hefty processing power at the problem, justified given these things are about saving lives.

    Interesting project though – I suspect Hackius is right about using a DSP, particularly if the end product needs to be reasonably small.

  10. I once built a sound localization program in C# – it actually worked pretty well. All you need is 2 (decent) microphones, cross-correlate the two signals and then make a few simple calculations.

  11. Ive fooled around with sound triangulation (via timing) before with a Maple (cortex m3) board. The build was an X,Y tap sensitive wall. Turns out, with a fast enough proc, the timing resolution was easy. What was hard, was tuning the amplifier on the piezo sensors so that they would spike from a tap (potentially far away), but not from random talking and movement in the room.

    Seemed like an easy problem, but really took me a long time to get right!

  12. I see lots of people making audio spectrum anaylzers out of all sorts of microcontrollers/LCD display combinations.
    Nice ones too!!
    Can’t be that hard to learn…

    I would like to learn to program FFT for monkeying with audio signals.
    Online suggestions???

  13. hi all,
    m doing a project on design and development of 3D audio in which i should be able to localize (finding location of sound source ) sound using headphones.i need this project in detail.its code,implementation of code on hrdware,hrdware/pc etc
    any help in this will be highly appreciated
    thanks

  14. hi buddies….
    it serves many purposes….ths can be used in collision avoidance in aircrafts (localizing th warning tone)etc…but my scope is crude as i have to make a GUI in which i should take a tone and give sme phase shift to localize the tone…m thinking of using visual studio wth XNA games studio to produce th 2D or 3D effect……..kindly suggest a suitable software wth xamples,code etc to produce the effects….

  15. I’ve gotten good results by taking a stereo harness and hooking up two mics (one mic reversed from the other) with small caps across the mic leads. I record a sound and move around while recording then when I play it back I can “hear” the movement.

    Its interesting to play a single tone over computer speakers then slowly move around between the two speakers you can “hear” where the nodes are as the sound gets stronger at a node, then fades.

  16. i could see this being used in wartime applications.. say, soldiers carry a portable tripod with something like this attached to the top.

    it would be used in defensive applications.. posted in a visible spot to soldiers and, if ambushed. set down.

    soldiers would have to train to be silent to allow it to detect where shots are coming from..

    i would invest in research for this ha..

  17. could see this being used in wartime applications.. say, soldiers carry a portable tripod with something like this attached to the top.
    it would be used in defensive applications.. posted in a visible spot to soldiers and, if ambushed. set down.
    soldiers would have to train to be silent to allow it to detect where shots are coming from..
    i would invest in research for this ha..

    THIS HAS ALREADY BEEN DONE AND IS ALREADY IN USE…. HOWEVER IT WOULD STILL BE NICE TO GET A DIRECTIONAL FIX ON A RANGE OF SOUND FREQUENCIES AND OR SPECIFIC FREQUENCIES

Leave a Reply to lwatcdrCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.