# sound source localization - finding source vector

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

• 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, I hope this makes sense given that you know how to find the direction with 2 mics. Mar 1, 2018 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) ? Mar 5, 2018 at 15:06
• 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 ;) Mar 5, 2018 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!!... Mar 13, 2018 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: desmos.com/calculator/nbkkpaqub5 Mar 13, 2018 at 12:01