pyroomacoustics.sync module

pyroomacoustics.sync.correlate(x1, x2, interp=1, phat=False)

Compute the cross-correlation between x1 and x2

Parameters:
  • x1 (array_like) – The data arrays

  • x2 (array_like) – The data arrays

  • interp (int, optional) – The interpolation factor for the output array, default 1.

  • phat (bool, optional) – Apply the PHAT weighting (default False)

Return type:

The cross-correlation between the two arrays

pyroomacoustics.sync.delay_estimation(x1, x2, L)

Estimate the delay between x1 and x2. L is the block length used for phat

pyroomacoustics.sync.tdoa(signal, reference, interp=1, phat=False, fs=1, t_max=None)

Estimates the shift of array signal with respect to reference using generalized cross-correlation

Parameters:
  • signal (array_like) – The array whose tdoa is measured

  • reference (array_like) – The reference array

  • interp (int, optional) – The interpolation factor for the output array, default 1.

  • phat (bool, optional) – Apply the PHAT weighting (default False)

  • fs (int or float, optional) – The sampling frequency of the input arrays, default=1

Return type:

The estimated delay between the two arrays

pyroomacoustics.sync.time_align(ref, deg, L=4096)

return a copy of deg time-aligned and of same-length as ref. L is the block length used for correlations.