From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Four Microphone array acoustic Sonar - with demo video

Code and Documents

Attachment

Here is the video

https://www.youtube.com/watch?v=1rIPQMkI0w8

You won't need any special hardware other than a 4 channel ADC. I use the NI 9234 which is a Sigma-Delta ADC from NI. You can use other ones though you may need anti-aliasing filters. Sampling is at 50kHz divided by 4 or 12.5kHz per channel. You can change this too.

The way the mics are arranged is crucial to the working. Co-ordinates are given on the front panel. (

Mic1  (-0.25,-0.25)

Mic 2 (-0.25 0.25)

Mic3 (0.25 0.25)

Mic 0 (0,0)

You can change this too but you may have to change the graphics to match.

The algorithm works by finding the delays between microphones using the generalized cross-correlation method (which uses FFTs and coherence, the Hannan Thomson mehod).

Once you find the time-delays for a source to a pair of mics you can fix the (x,y,z) co-ordinates. The radius control on the front panel is only like a zoom for the graphics and nothing more. a simulation of this method can be found here

https://decibel.ni.com/content/docs/DOC-16771

For theory see

Passive Acoustic Bearing Estimation

Using the Spherical Intersection Method.

(Smith and Abel IEEE Trans ASSP,vol assp-35,

no 12,Dec 1987

Unrar the file, arrange the microphones (see video). You can use a radio for the source.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors