From 76682e8cb56b59325818dff1dde8468ba8642c3d Mon Sep 17 00:00:00 2001 From: bma Date: Wed, 28 Nov 2018 09:33:36 +0100 Subject: [PATCH] allanplot_cov: add detrend options --- allanplot_cov.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/allanplot_cov.m b/allanplot_cov.m index acccdec..5879740 100755 --- a/allanplot_cov.m +++ b/allanplot_cov.m @@ -3,9 +3,12 @@ filename = argv(){1}; col1 = eval(argv(){2}); col2 = eval(argv(){3}); -mult1 = eval(argv(){4}); -mult2 = eval(argv(){5}); -arg_save = eval(argv(){6}); +fs = eval(argv(){4}); +mult1 = eval(argv(){5}); +mult2 = eval(argv(){6}); +driftRem1 = eval(argv(){7}); +driftRem2 = eval(argv(){8}); +arg_save = eval(argv(){9}); if length(col1) == length(mult1) figure @@ -17,15 +20,15 @@ if length(col1) == length(mult1) data.freq2 = load(filename)(:,col2(i)).*mult2(i); data.freq = data.freq(1:min(length(data.freq), length(data.freq2))); data.freq2 = data.freq2(1:min(length(data.freq), length(data.freq2))); - if eval(argv(){end-1}) == 1 + if driftRem1 == 1 printf('\ndata1 drift removed\n\n') data.freq = detrend(data.freq); end - if eval(argv(){end}) == 1 + if driftRem2 == 1 printf('\ndata2 drift removed\n\n') data.freq2 = detrend(data.freq2); end - data.rate = 1; + data.rate = fs(i); [ad, S, err, tau] = allan_cov(data, horzcat(reshape([1:0.1:9]'.*10.^[0:round(log10(length(data.freq)))-1],1,[]), 10^(round(log10(length(data.freq)))-1))./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); loglogerr(tau, ad, err, strcat(cc(mod(i, length(cc))), '-s')) leg{i} = strcat(filename, ' cov col', num2str(col1(i)), ' col', num2str(col2(i))); -- 2.16.4