collapse

Author Topic: General Sound Direction Detection using Arduino?  (Read 7821 times)

Protowrxs

  • Member
  • *
  • Posts: 146
    • The Protowrxs World
General Sound Direction Detection using Arduino?
« on: October 29, 2015, 08:40:39 PM »
Anyone have any examples / success in directional location sound source?

I'm talking REALLY basic here, just point a servo (Robot head of course) towards the loudest sound.

I'm guessing there would need to be some filtering to avoid head bounce but if it were incremental adjustments based on timed samples it seems it would work.

I've done that with sonar before like below but never tried pure audio.

Suggestions? Samples? Write my code?

Sonar Examples. I was just using the distance differences here, seems similar to analog read differences for audio?

2D Tracking by Sonar

3D Tracking by Sonar
The past is done, the future is not here, live today...
My Bots: http://www.Protowrxs.com/robotics

cevinius

  • Member
  • *
  • Posts: 127
    • www.cevinius.com
Re: General Sound Direction Detection using Arduino?
« Reply #1 on: October 29, 2015, 08:57:23 PM »
Those tracking examples are great!!!! Can't wait to see the audio tracking one! :D

Tor

  • Member
  • *
  • T
  • Posts: 21
Re: General Sound Direction Detection using Arduino?
« Reply #2 on: October 29, 2015, 10:25:12 PM »
I have never tried anything like this, but it's a very interesting problem. It's genuinely different from sonar tracking (which you know of course, I'm just thinking aloud here) because you don't have an explicit idea about what the time differences are as you're  not the one making the sound(s). 

Some years ago I read an article in Scientific American about how owls use hearing to pinpoint a mouse from a distance.  It turns out that scientists have figured out just about everything about how owls do this, including what the brain does and where.

The head (an it's the same for humans) is an important part of the equation, it provides not only distance between the ears but also this slightly round object which sound must pass around to reach the ear on the other side. The ears of owls are actually positioned slightly asymmetrically on its head to give an additional element to the equation the processor (the brain) has to compute.

In popular literature and myths owls are always thought to be wise birds. But owls are actually pretty dumb as birds go. According to that Scientific American article they have lots of brain power, it's just that nearly all of it goes to process sound.. there's very little left for general intelligence.

So it may be that the processing part of audio location is a bit demanding.. of course it should be much simpler (one could hope) to just be able to detect the general direction as opposed to pinpoint exactly where something is.

With two ears there's always some ambiguity about where the sound comes from. From above, or from below? The shape of the ears probably helps detecting the difference. From behind you or from in front? Can be more difficult, but turning the head a bit can help. And owls have that asymmetric ear positioning as well. Imagine four ears, 90 degrees apart around a spherical head - if each of them is unidirectional it can still be difficult to figure out the direction. Time difference helps, but can be (and is, for humans) more difficult the lower the frequency - there's probably some phase processing going on there which explains the difficulty for low frequency sounds.  Then imagine that the four ears are positioned not exactly 90 degrees apart. An asymmetry would help detect the difference. Moving the head a little bit also helps. So, asymmetry, movement, ear shape, time delay, phase comparison, sound modified as sounds pass around it to the other ear.. lots of factors there.

I saw a device the Germans used during WW2, left behind after the war, which was designed to help an operator detect the direction of low-frequency sound sources, ships and artillery for example. It looked like two old-fashioned hearing aids, those trumpet-shaped metal thingies. But they were extended to be more than two meters apart. The operator could then listen through these and (with some mechanical assist) turn the setup this way and that, and figure out the sound's direction.
« Last Edit: October 30, 2015, 01:49:02 AM by Tor »

erco

  • Member
  • *
  • e
  • Posts: 205
Re: General Sound Direction Detection using Arduino?
« Reply #3 on: October 30, 2015, 12:25:56 AM »
Neat demo on that ultrasonic tracking, Protowrxs. I've done some similar tracking experiments with ultrasonic and laser. Can't help on audio though. I've heard it described though, two sensitive microphones a distance apart and a fast processor to look for phase differences. Well beyond my favorite little Picaxe's capabilities. :)

Here's one of my trackers:



mogul

  • Hot glue gunslinger
  • Member
  • *
  • Posts: 151
  • This is a good day!
Re: General Sound Direction Detection using Arduino?
« Reply #4 on: October 30, 2015, 02:24:35 AM »

erco

  • Member
  • *
  • e
  • Posts: 205
Re: General Sound Direction Detection using Arduino?
« Reply #5 on: October 30, 2015, 04:30:56 AM »
If you had 3 microphones VERY far apart and a fast polling routine, you might track handclaps using simple sonar location techniques pioneered  back in the World Wars! https://en.wikipedia.org/wiki/Sound_ranging

AndyGadget

  • Member
  • *
  • Posts: 34
Re: General Sound Direction Detection using Arduino?
« Reply #6 on: October 30, 2015, 05:46:28 AM »
Not as accurate as the phase detection method, but how about an angled pair of the Adafruit electret microphones, with a simple leaky peak hold circuit (schottky diode in series, resistor and capacitor to ground). You could then do a much slower ADC read of the signal level and the sound source would be central when the levels matched. Picaxe could merrily handle that too.
(Those mics are MUCH cheaper from China.)
« Last Edit: October 30, 2015, 06:06:30 AM by AndyGadget »
Necessity is the mother of many strange bastards.

craighissett

  • Member
  • ****
  • c
  • Posts: 164
Re: General Sound Direction Detection using Arduino?
« Reply #7 on: October 30, 2015, 06:05:37 AM »
Check out what chickenparmi did with the PopPet advance kit; he uses some small boards for detecting sound.
You could use 2/3 of them and cycle between them to find the strongest sound source etc.

AndyGadget

  • Member
  • *
  • Posts: 34
Re: General Sound Direction Detection using Arduino?
« Reply #8 on: October 30, 2015, 06:56:51 AM »
Proto, there's only one thing for it, you need to build one of these :

Necessity is the mother of many strange bastards.

Ralph

  • Member
  • *
  • Posts: 36
Re: General Sound Direction Detection using Arduino?
« Reply #9 on: October 30, 2015, 02:37:48 PM »
This won't exactly answer the original request, but I did want to provide a link to an excellent write-up on directional sound (http://sbolt.home.xs4all.nl/e-spider_sound.html) from one of my all time favorite robot pages – Steven Bolt's Pitronics (http://sbolt.home.xs4all.nl/e-index.html).

In Bolt's Spider robot concept, multiple bots are able to locate one another using chirps at a specific frequency.  A Spider has two “ears.”  Distance to another Spider is calculated by timing how long it takes the other Spider to reply to a chirp.  More on point, the direction to the other Spider is calculated using the delay between when the reply chirp hits the individual ears.

The basic approach here is very similar in concept to the ubiquitous ultrasonic rangers (SRF05 etc.).  The circuit monitors for a frequency in a narrow window of time in order to mark the start of the tone and then stops listening.  Limiting the function to a specific frequency makes it easier to ignore background noises.  Limiting the function to a tight window in time reduces the possibility of echoes tripping up your calculations.

A nice feature of this particular project is the masterful use of bubblegum parts.  A lot of the heavy lifting here is done with electret mics, piezo transducers and bipolar transistors.  You could build a set of ears for a few bucks worth of eBay parts.

It's worth noting that this is classic BEAM era stuff with the original plans dating back almost 20 years.   It's a nice tribute to the author that the project remains a great source of relevant and potentially helpful information – especially for those seeking inspiration for accessible homebrew approaches for hobby bots.

Smashley

  • Member
  • *
  • Posts: 68
Re: General Sound Direction Detection using Arduino?
« Reply #10 on: October 30, 2015, 05:46:09 PM »
My thinking would be to rig up a directional/shotgun mic (even a regular mic inside a tube where the other end is open might work to collect sound only from a given direction), and mount that on a tilt-pan device. Then it's not dissimilar to a ping sensor, only instead of calculating distance, take analog reads and compare, highest = loudest? I may be oversimplifying. Granted this would only be useful for 'hunting' out a sound that is somewhat constant or repeating. Not ideal for picking the direction of a brief sound, so it really depends on the application. I've never tried this myself.

 

* Search


* Recent Topics

The unnamed (yet) quatruped spider project by tinhead
[July 01, 2020, 04:22:11 PM]


"1984 Nixie Time" by 1 what
[May 08, 2020, 01:04:18 AM]


2D Side Scroller Cyberpunk themed by Killer Angel
[February 06, 2020, 06:39:40 AM]


A new wing design for model aircraft / drones by OddBot
[February 06, 2020, 04:42:06 AM]


SDR (Software Defined Radio) by Gareth
[February 02, 2020, 06:15:42 AM]


Circuit Math by ZeroMax
[January 31, 2020, 01:50:18 PM]


NanOMeter by Protowrxs
[January 01, 2020, 12:59:44 PM]


Investigating the VL53L0X Laser Rangefinder by erco
[December 30, 2019, 10:45:44 PM]


PS4 Single Handed Controller Deployed (part 7 of 7) by Gareth
[December 30, 2019, 09:52:29 AM]


"D" -Pad Workio just like Magic (Will Merlin stay or Go) (part 6 of 7) by Gareth
[December 30, 2019, 09:51:27 AM]


PS4 Joystick Digitals 4,5,6,7,10 - Analog's Lx,Ly,Rx,Ry Workio (part 5 of 7) by Gareth
[December 30, 2019, 09:50:37 AM]


Menu Workio ! (part 4 of 7) by Gareth
[December 30, 2019, 09:49:49 AM]


L1 trigger design Workio (Hori controller) (part 3 of 7) by Gareth
[December 30, 2019, 09:48:50 AM]


Hori aka PS4 Joystick Mappings (part 2 of 7) by Gareth
[December 30, 2019, 09:47:17 AM]


PS4 Single Left-Handed Controller (part 1 of 7) by Gareth
[December 30, 2019, 09:44:58 AM]

* Recent Posts

Re: The unnamed (yet) quatruped spider project by tinhead
[July 01, 2020, 04:22:11 PM]


Re: The unnamed (yet) quatruped spider project by jinx
[July 01, 2020, 04:06:19 PM]


Re: "1984 Nixie Time" by 1 what
[May 08, 2020, 01:04:18 AM]


Re: "1984 Nixie Time" by tomasp
[April 13, 2020, 06:03:28 PM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[February 06, 2020, 06:39:40 AM]


A new wing design for model aircraft / drones by OddBot
[February 06, 2020, 04:42:06 AM]


Re: "1984 Nixie Time" by Gareth
[February 02, 2020, 06:23:01 AM]


Re: SDR (Software Defined Radio) by Gareth
[February 02, 2020, 06:15:42 AM]


Re: SDR (Software Defined Radio) by ZeroMax
[January 31, 2020, 01:54:21 PM]


Re: "1984 Nixie Time" by ZeroMax
[January 31, 2020, 01:52:29 PM]


Circuit Math by ZeroMax
[January 31, 2020, 01:50:18 PM]


Re: 2D Side Scroller Cyberpunk themed by ZeroMax
[January 31, 2020, 01:45:33 PM]


NanOMeter by Protowrxs
[January 01, 2020, 12:59:44 PM]


Re: Investigating the VL53L0X Laser Rangefinder by erco
[December 30, 2019, 10:45:44 PM]


PS4 Single Handed Controller Deployed (part 7 of 7) by Gareth
[December 30, 2019, 09:52:29 AM]