Nov 3, 2010

I am wondering whether it is possible to detect voice direction in android or not? For example on nexus one using the actual mic and the noise cancellation mic or using any other method?

You'd need at least 3 mics to determine location on a single sound event, that's why they call it triangulation. If you're trying to determine just direction from a particular point then you could do it with 2 mics, but you'd never be able to determine the difference between sounds originating 180 degrees apart (you could figure out it was either 90 degrees from the direction you're facing or 270 degrees).

So, besides those limitations there's further limitations when trying to use the mics on a cell phone, even if it had three. The biggest is that the closer the mics are from each other, the lower the resolution is. Without doing the math, I'd guess that between the three mics being so close together and the sampling rate being what it is on the DACs in a phone you'd never be able to calculate any time differences between the mics to help you determine location. I could be wrong, but even if I am I don't think you could determine location with any sort of usable accuracy.
What about software that would three android devices in general proximity to each other to be able to do this. One of the phones would be the 'server' (or possibly an unrelated computer could be the 'server') and all three would feed audio data with the phones timestamp to the server. The problem gets to whether or not the microphones and timestamp are good enough?
I'm not sure you're grasping just how precise these time measurements and locations need to be for an accurate picture.

Sound travels at about 1100 feet per second. Even if the microphones are 100 feet apart (the more precisely you know this distance the more precise your measurements will be) the maximum measured delay between two microphones will be a hair under 1 tenth of a second. If the distance between each microphone is off, your answer will be off. If the time stamp variation between the two phones (ie, if an event were to occur equidistant from both mics how far off +/- their timestamps would be) is even 1/10 of a second any solution is invalidated.

Some cities have deployed shots fired systems in questionable neighborhoods (and the DoD has a system for snipers as well), but they rely on precisely measured microphone distances, highly specialized hardware and software, and very definitive audio events (very loud, quick shots) to determine the location of shots fired, and even these systems aren't that good at it.