One of the purpose ofÂ TweetyBotÂ is to be able to know where sounds come from. This isn’t actually required to teach birds to sing correctly, but it’s so fun. And ultimately, the robot would be able to localize which birds is responding and turn its “head” to it…

Anyway. Here’s the problem:Â having two microphones, how do we know where the sound comes from ? What’s the angle ?

The problem looks like following: if we’re able to know the delay that occurs when the sound wave hits mic A and mic B, then we should be able to know the distance (speed of sound being constant), which directly depends on the angle/direction of the sound. Measuring this delay is actually feasible, so that’s the good news.

Considering borderline cases, we have:

If sound is localized exactly between the mics, distance is null (no delay)

This smells sinus or cosinus… After a few hours (days ?) reminding me maths and geometry when I was a little child, here’s a figure summarizing the problem, with the solution.

Note: I’ve submitted the problem toÂ Master Fenyo. As usual, he said:

“- You’re dumb… There are multiple solutions to your problem since there’s one equation and two unknown variables.

- Ah…

- Yes. Considering your problem in a euclidian space, you can see vectors blabla, blabla…

- Ah… But…

- No, it won’t work !

- But look at this figure.

- OK. This is only valid if you consider you have flat/plane sound wave

- Ah…

- This is only valid if the distance between your microphones is greater than…

- OK. Anyway, whatever the distance will be, I assume I can use any sound waves form I want to get my result the way I want…

This being said, he’s right and results will only be an approximation…

## No comments

Comments feed for this article

Trackback link: http://sirloon.net/localizing-sound-in-space-part-1-theory/trackback