tdelay_correlation

seas.signalanalysis.tdelay_correlation(vectors: numpy.ndarray, n: int, max_offset: int = 150, return_window: bool = False)Tuple[numpy.ndarray, numpy.ndarray][source]

Calculates correlations of timecourses stored in an array ‘vectors’, of shape (m, t) against the ‘n’th element of the array, or an input vector of size ‘t’. Returns

Parameters
  • vectors – a (m,t) numpy array containing all time series, including the one to compare to.

  • n – The element to compare each other element to.

  • max_offset – The integer maximum time offset to calculate correlation out to.

  • return_window – Whether to return the maximum correlation value in the context of the correlation window.

Returns

the correlation of each vector with vector ‘n’, and time offset. t_delay: The time delay which maximizes the correlation value. corr_window: Returns the maximum correlation at the given time delay for each time series,

all other values are zero. Only returned if return_window is True.

Return type

x_corr