Sound source localization with Matlab

Viewed 231

I have three recordings of a signal taken with an array of three hydrophones (one sound source). I would like to estimate the source localization using the time of arrival differences for the three recordings. In Matlab, I started the following, by estimating the time of arrival differences with the GCC-PHAT algorithm (Generalized cross-correlation):

[sig1, fs] = audioread('signal1.wav'); 
sig2 = audioread('signal2.wav');
sig3 = audioread('signal3.wav');
refsig = sig1;
[tau_est, R, lags] = gccphat([sig2,sig3],refsig, fs); 
disp(tau_est * fs)

It gives me the time of arrival differences of signals 2 and 3 compared to signal 1 (tau). Now I would like to get the direction of arrival estimates (DOAs) and proceed with triangulation to assess source position.

Any help will be greatly appreciated!

1 Answers

Some additional information is needed to convert the time-of-arrival-difference estimates to directions of arrival:

  1. Spatial coordinates of each mic / hydrophone in the array.
  2. Speed of sound. Speed of sound in seawater varies significantly with temperature, salinity, and depth; see this Wikipedia article for an empirical formula.

Once you know this, use equation (1) from https://people.engr.ncsu.edu/kay/msf/sound.htm to estimate the angle of arrival θ for each mic pair:

θ = sin⁻¹(speed_of_sound * time_difference_of_arrival / distance_between_mics)

A limitation is that the angle of arrival estimated from a single mic pair has front-back ambiguity. For instance an angle at θ = 30 degrees would have the same time difference of arrival as θ = 150 degrees. You can think of the sin⁻¹ inverse function as multivalued to represent this ambiguity. Also, keep in mind that the formula derivation assumes plane wave propagation from a source at an infinite distance, and it ignores shadowing and diffraction effects around the mic, so obviously there is some inaccuracy. But it is simple and often works decently well.

From there, you can combine angle estimates from the three mic pairs to triangulate the source position.

Related