I propose you to use 2 microphones instead of one. The idea is to acquire the signal at 2 different locations, at the same time (compared to the signal period), and multiply them to extract the wave length.
You will acquire 1 signal per location. The second signal will be delayed of a certain amout of time. We call it delta \$\delta\$. Let's say at microphone number 1, we have a pure sine wave \$mic1(t) = \sin(\omega t + \phi)\$
and at microphone number 2 we have \$mic2(t) = \sin(\omega t + \phi - \delta)\$
Delta only depends on the wavelength because we fixed the distance between the 2 microphones. So, if we get delta, we'll get the velocity.
See for example, if the distance 2 microphones are equal to exactly half a wave length, then you would have such signals:
Note: I consider that the amplitude is the same between the 2 microphones.
Now, consider using this formula
\$\sin(a)\sin(b) = 1/2(\cos(a-b) - \cos(a+b))\$
- Do this multiplication on the firmware
\$ mic1(t)*mic2(t) = 1/2(\cos(\delta) - \cos(2(\omega t + \phi) - \delta)) \$
By low-pass filtering (or averaging) \$mic1(t)*mic2(t)\$ you would get only the constant part, which is
Then, compute delta
\$\delta = \arccos(2*low-pass(mic1(t)*mic2(t)))\$
Finally, convert to the radian to meters
\$\lambda = \delta / 2\pi * d\$
See this picture, where I take a delta of 1 rad, and a butterworth 2nd order low-pass filter.
- They must be set as to be in line with the sound source
- The distance d between them must be measured precisely, it will be your reference in the space domain.
- The distance d between them must be less than 1/2 wavelength. FYI, for a 1kHz signal it would be ~17cm max
- Connect the microphone's output to analog inputs on the arduino's board.
- If you could afford it, add a band-pass filter between the microphones and the arduinos. The cut-off frequency is around the source wave frequency.
- Use the AnalogRead() function of the Arduino for mic1 and next instruction call the one for mic2. Because reading takes 100 usec, it is important to take it into account, and use a frequency that is slow enough (like 100 Hz) to minimize the impact of this latency.