1

This may sound a stupid question - but I am working on some simple microphone array beamforming sound source localization stuff. I think I understand how to use beamforming to find the TOA of the sound source between 2 microphones (positioned, say on the x axis), and therefore how to find the angle, phi. If the source is positioned normal to the z axis then this makes theta (the azimuth) equal to pi/2. However how do I find the r coordinate of the source vector? As I understand it , I cant localize the source without this coordinate.

Any help much appreciated, thanks in advance

CN railfan
  • 61
  • 1
  • 7
  • 1
    I don't think you can do it with only 2 mics. You can't (as far as I know) distinguish between sounds coming from "in front" of the array and sounds coming from "behind" it when determining the direction. If that's alright with you, because you know the sound will always be in front of it in your application, you can just add another mic in a line with the first two, and triangulate between the directions found by each pair of adjacent mics. Here's a [quick demo](https://www.desmos.com/calculator/nbkkpaqub5), I hope this makes sense given that you know how to find the direction with 2 mics. – Guest Mar 01 '18 at 20:10
  • @Guest thanks for the attached demo, however I'm not sure how your distances d1 and d2 relate to actual measured distances from 3 mics with a sinusoidal source. The delay (translated to distance) is related to the incident angle phi by d' = d*cos(phi), and is the distance the wave has to travel between arriving at mic1 and arriving at mic2. How does this relate to (dist(S,m1) - dist(S,m2))/dist(m1,m2) ? – CN railfan Mar 05 '18 at 15:06
  • 1
    was using TDOA (see "interaural time difference") in that demo; just pointing out that once you have one angle towards the source, you should be able to find one (or two) more and then triangulate. TDOA may not be as accurate as beamforming for finding an angle, but may make sense for triangulation, where you might want receivers further apart. Or not, I really have no idea ;) – Guest Mar 05 '18 at 15:11
  • @Guest I still don't get where youre coming from with dividing the doa by the distance between the mics. ....Are you trying to project the doa vector onto the mic distance vector?...Sorry if I'm just being stupid though!!... – CN railfan Mar 13 '18 at 11:01
  • @Guest acutally I think I might have worked out a way to do it? A bit different from yours though, see link: https://www.desmos.com/calculator/nbkkpaqub5 – CN railfan Mar 13 '18 at 12:01
  • I think that's the same demo, did you forget to save it? Formula for interaural time difference looks like $t=\frac{d\ \sin\left(a\right)}{c}$, where $t$ is time delta, *$d$ is distance between receivers*, $a$ is the angle you're looking for, and $c$ is speed of sound. The problem with this is spatial resolution is really bad, even at 96k sample rate with receivers a meter apart (in my simulated tests, anyway). Some kind of sub-sample accuracy is needed. I wonder if a hybrid TDOA/beamforming solution is possible. Please repost your demo if you still have it open, I'd like to see it! – Guest Mar 13 '18 at 15:04
  • ...so just to be clear, tdoa divided by distance between mics came from rearranging $t=\frac{d\ \sin\left(a\right)}{c}$ to $\sin\left(a\right)=\frac{ct}{d}$ ... I dropped $c$ because I didn't care about scale in this demo. Since the sine of $a$ is $\frac{t}{d}$ we know that's the X component of a vector towards the source, and the Y component is $\cos\left(\arcsin\left(x\right)\right)$, or $\sqrt{1-x^2}$. If the line the mics are on have a non-zero slope, then you'd need to rotate that vector accordingly. – Guest Mar 13 '18 at 18:09
  • @Guest sorry I didn't realize I had to save it! luckily still had the window open...so here it is: https://www.desmos.com/calculator/edfzdwauow – CN railfan Mar 14 '18 at 08:01
  • @Guest which angle are you talking about here? If you are talking about the angle that the time difference makes with the 1st microphone (at (-1,0)) then the interaural time difference should be $$t = dcos(a)/c$$ – CN railfan Mar 14 '18 at 09:34
  • @Guest also I'm not sure we can even make right angle triangle assumptions here...I've added in something to my demo, where I've shown that the angle b (i.e. the angle between the mic1V vector and the mic2V vector) is nearer 94 degrees than 90, therefore it is not a right triangle and those assumptions don't hold. (found this from non right angle triangle equations: $$B^2 = A^2 + C^2 - 2(AC)cosb$$ rearranging to get: $$b = acos(\frac{A^2 + C^2 - B^2}{2AC})$$ – CN railfan Mar 14 '18 at 10:06
  • @Guest additional edit to my previous comment: to clarify, mic1V = vector from mic1 to the point V mic2V = vector from mic2 to the point V. Also, I meant to say that the angle b, is usually not 90 degrees, and cannot be guaranteed to be 90 degrees. therefore no right angle triangle is formed and so the right angle triangle assumptions do not hold. – CN railfan Mar 14 '18 at 10:18
  • I was looking for the angle from the point halfway between each microphone pair. I need more time to look at your work, starting to almost believe you could do it with 2 mics after all... – Guest Mar 14 '18 at 19:41
  • The problem with that approach is you need to know the actual distance from the source to each mic, when really all you'll know is how long it took to hit the second mic after the first one. Check [this demo](https://www.desmos.com/calculator/7dhpst0jyk), where I have $D=D_0$, you'd need to be able to put something like $D=D_0-\min\left(D_0\right)$ and still have it work. – Guest Mar 15 '18 at 02:04
  • @Guest I have found a paper which you can see at the following link: http://iopscience.iop.org/article/10.1088/0957-0233/19/2/024003/meta They find the angles using non right angle trig and the appropriate equations listed. I changed one of the equations on a whim as it wasn't working, to this: $$x = \frac{l2(l1^2 - d1^2) + l1(l2^2 - d2^2)}{2(d1l2-d2l1)}$$ (Note that I have changed the plus to a minus in the denominator). This now calculates the radial distance x (denoted as "b" in my graph) and from this we can find the angles of arrival. – CN railfan Mar 20 '18 at 14:21
  • @Guest then using my solution I posted a while ago (based upon some ideas from your original demo!) the location of the source can be found using the angles found (above). I have tested this with simulated spherical wave signals in matlab and it works for the most part! demo here: https://www.desmos.com/calculator/eokon7sfmr – CN railfan Mar 20 '18 at 14:22
  • @Guest by the way, thanks for all the help and for bearing with me as my slow brain slogged along! – CN railfan Mar 20 '18 at 14:25
  • That's pretty cool, so you still need three mics but now you can find angles from 3 different points: https://www.desmos.com/calculator/f0fn2ejx49 ... very nice :) – Guest Mar 21 '18 at 05:16

1 Answers1

1

In general, 2 microphones are not enough. In 3 dimensions, you actually need 4 (non co-linear) for the 3 polar coordinates.

There are cases where if you can bring more information to your problem, like knowing the signal of the source and the transmit and receive times of the signal, you can estimate the range for simple known geometries.

A good reference is:

Strang, Gilbert, and Kai Borre. Linear algebra, geodesy, and GPS. Siam, 1997