pymodalib.algorithms.coherence module¶
Wavelet phase coherence.
-
tlphcoh
(wt1: numpy.ndarray, wt2: numpy.ndarray, freq: numpy.ndarray, fs: float, wsize: int = 10) → numpy.ndarray¶ Time-localized phase coherence.
Parameters: - wt1 (ndarray) – [2D array, complex] Wavelet transform of the first signal.
- wt2 (ndarray) – [2D array, complex] Wavelet transform of the second signal. Must be the same shape as wt1.
- freq (ndarray) – [1D array] Frequencies at which the wavelet transforms wt1 and wt2 were calculated.
- fs (float) – Sampling frequency of the signals.
- wsize (int, optional) – (Default value = 10) The window size.
Returns: tpc – [2D array] The time-localized wavelet phase coherence.
Return type: ndarray
-
wphcoh
(wt1: numpy.ndarray, wt2: numpy.ndarray) → Tuple[numpy.ndarray, numpy.ndarray]¶ Time-averaged wavelet phase coherence.
Parameters: - wt1 (ndarray) – [2D array, complex] Wavelet transform of the first signal.
- wt2 (ndarray) – [2D array, complex] Wavelet transform of the second signal.
Returns: - phcoh (ndarray) – [1D array] Wavelet phase coherence.
- phdiff (ndarray) – [1D array] Wavelet phase difference.