Sound localization using two mics, Arduino Uno on MATLAB I have been trying to achieve this for a long time using the ITD method and have gone through various articles on the net.
I want to know if its possible to actually achieve sound localization using an Arduino Uno and two MEMS mics with a high gain (https://www.sparkfun.com/products/9868).
I have been trying this on MATLAB using the a=arduino() command and readVoltage command but the main issue I face is that for a particular sound (clapping for instance) the time difference between the two mics is not always the same which results in different direction predictions.
We managed to increase the low resolution of the Arduino by removing unnecessary operations. Now we are able to get an array of size 750 for 10 secs giving a resolution of 0.01 secs. I am not sure if that is enough.
I basically have 3 arrays, one storing the sampling times, and the other two storing the amplitudes of the two analog inputs at that particular time in the first array.
Now I look for a peak in one and then the corresponding near peak in the second one and then compute the time difference. After this I can compute the angle using the speed of sound and the distance between the mics.
Please let me know how I can make this work or where I am going wrong.
Let's assume a microphone distance of 0.5m (which may be just small enough for you). Sound travels with about 300m/s in normal conditions. Let's also say, that you want at least a precision in the angle measurement of 15°.

As stated in the project Mikael linked, it is important that the distance to the sound source is big enough (so that the waves can be seen as planar). Then you have the following situation:


We are interested in the difference in distance, that the waves have to travel to the two microphones. It can be calculated by delta s = d * sin(alpha). With 15° we get delta s = 0.13m. The time difference is calculated by delta t = delta s/v, where v is the speed of sound. We get delta t = 0.43ms which equates to 2.32kHz sampling frequency. Since we use two microphones that must be sampled sequentially, the sampling frequency must be doubled. In the end we have a sampling frequency of 4.64kHz. So your sampling time of 0.01s wouldn't be enough for that.

The largest time difference in this setup (with the sound source in line with the microphones) would be 1.6ms, so your sampling time would be too big even for this.

Regarding the transmission with a baudrate of say 115200 baud this shouldn't be a problem.

But the actual speed of your setup highly depends on your code, which you haven't shown. Maybe this forum post can help you going further.