From 56974dc3b086a6237af18bb5741d8d4558677bcd Mon Sep 17 00:00:00 2001 From: M Hoegner Date: Thu, 2 Sep 2021 16:12:33 +0200 Subject: [PATCH 1/2] make adev, oadev work for complex data --- allantools/allantools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allantools/allantools.py b/allantools/allantools.py index 3c90478..02ddf2e 100644 --- a/allantools/allantools.py +++ b/allantools/allantools.py @@ -373,7 +373,7 @@ def calc_adev_phase(phase, rate, mj, stride): n = 1 v_arr = d2[:n] - 2 * d1[:n] + d0[:n] - s = np.sum(v_arr * v_arr) + s = np.sum(abs(v_arr)**2) dev = np.sqrt(s / (2.0*n)) / mj*rate deverr = dev / np.sqrt(n) From 5048a8be24c4e091962f969013b1d43cc4127049 Mon Sep 17 00:00:00 2001 From: M Hoegner Date: Fri, 3 Sep 2021 10:38:53 +0200 Subject: [PATCH 2/2] make adev, oadev work for complex data --- allantools/allantools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/allantools/allantools.py b/allantools/allantools.py index 3c90478..0ece0db 100644 --- a/allantools/allantools.py +++ b/allantools/allantools.py @@ -373,7 +373,8 @@ def calc_adev_phase(phase, rate, mj, stride): n = 1 v_arr = d2[:n] - 2 * d1[:n] + d0[:n] - s = np.sum(v_arr * v_arr) + s = np.sum(v_arr*v_arr) if np.isrealobj(v_arr) else \ + np.sum(v_arr.real**2 + v_arr.imag**2) dev = np.sqrt(s / (2.0*n)) / mj*rate deverr = dev / np.sqrt(n)