From e5aeec49133ba19a381291ad6dcad1164d621c61 Mon Sep 17 00:00:00 2001 From: bma Date: Wed, 4 Apr 2018 16:19:44 +0200 Subject: [PATCH] use real part --- allan_cov.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allan_cov.m b/allan_cov.m index f35537b..75da6ef 100644 --- a/allan_cov.m +++ b/allan_cov.m @@ -328,7 +328,7 @@ if isfield(data,'rate') && data.rate > 0 % if data rate was given fd2=diff(fa2); % calculate two-sample variance for this tau M=length(fa); - sm(k)=sqrt(0.5/(M-1)*(real(sum(fd.*fd2)))); + sm(k)=sqrt(0.5/(M-1)*abs(real(sum(fd.*fd2)))); % estimate error bars sme(k)=sm(k)/sqrt(M+1); -- 2.16.4