From 50a9b705d5ad8982b738b973dc6a1a5f4b76f9d2 Mon Sep 17 00:00:00 2001 From: bma Date: Wed, 8 Nov 2017 08:27:50 +0100 Subject: [PATCH] add abs() --- allan_cov.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allan_cov.m b/allan_cov.m index 7162d9a..25790a1 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)*(sum(fd.*fd2))); + sm(k)=sqrt(0.5/(M-1)*(abs(sum(fd.*fd2)))); % estimate error bars sme(k)=sm(k)/sqrt(M+1); -- 2.16.4