From b3162327e625bcd801f868cde7f7734d7c8edf63 Mon Sep 17 00:00:00 2001 From: Patryk Mikulski Date: Fri, 19 Apr 2024 10:55:43 +0200 Subject: [PATCH] fix: swapped axes of time series and phase array --- pyPTE/core/pyPTE.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyPTE/core/pyPTE.py b/pyPTE/core/pyPTE.py index f7b0bbd..fe6a7a5 100644 --- a/pyPTE/core/pyPTE.py +++ b/pyPTE/core/pyPTE.py @@ -45,7 +45,7 @@ def get_phase(time_series: npt.ArrayLike) -> npt.NDArray: m x n ndarray : m: number of channels, n: number of samples """ - complex_series = hilbert(time_series, axis=0) + complex_series = hilbert(time_series, axis=1) phase = np.angle(complex_series) return phase @@ -88,7 +88,7 @@ def get_binsize(phase: npt.NDArray, c: float = 3.49) -> float: """ m, n = phase.shape - binsize = c * np.mean(np.std(phase, axis=0, ddof=1)) * n ** (-1.0 / 3) + binsize = c * np.mean(np.std(phase, axis=1, ddof=1)) * n ** (-1.0 / 3) return binsize