pyroomacoustics.experimental.localization module

We have a number of points of know locations and have the TDOA measurements from an unknown location to the known point. We perform an EDM line search to find the unknown offset to turn TDOA to TOA.

Parameters
  • R (ndarray) – An ndarray of 3xN where each column is the location of a point

  • tdoa (ndarray) – A length N vector containing the tdoa measurements from uknown location to known ones

  • bounds (ndarray) – Bounds for the line search

  • step (float) – Step size for the line search

pyroomacoustics.experimental.localization.tdoa(x1, x2, interp=1, fs=1, phat=True)

This function computes the time difference of arrival (TDOA) of the signal at the two microphones. This in turns is used to infer the direction of arrival (DOA) of the signal.

Specifically if s(k) is the signal at the reference microphone and s_2(k) at the second microphone, then for signal arriving with DOA theta we have

s_2(k) = s(k - tau)

with

tau = fs*d*sin(theta)/c

where d is the distance between the two microphones and c the speed of sound.

We recover tau using the Generalized Cross Correlation - Phase Transform (GCC-PHAT) method. The reference is

Knapp, C., & Carter, G. C. (1976). The generalized correlation method for estimation of time delay.

Parameters
  • x1 (nd-array) – The signal of the reference microphone

  • x2 (nd-array) – The signal of the second microphone

  • interp (int, optional (default 1)) – The interpolation value for the cross-correlation, it can improve the time resolution (and hence DOA resolution)

  • fs (int, optional (default 44100 Hz)) – The sampling frequency of the input signal

Returns

  • theta (float) – the angle of arrival (in radian (I think))

  • pwr (float) – the magnitude of the maximum cross correlation coefficient

  • delay (float) – the delay between the two microphones (in seconds)

pyroomacoustics.experimental.localization.tdoa_loc(R, tdoa, c, x0=None)

TDOA based localization

Parameters
  • R (ndarray) – A 3xN array of 3D points

  • tdoa (ndarray) – A length N array of tdoa

  • c (float) – The speed of sound

  • Reference

  • ---------

  • Li (Steven) –

  • localization (TDOA) –