Blame view

allanplot.m 878 Bytes
b197c3fdf   bmarechal   first commit
1
2
3
4
5
  #!/usr/bin/octave-cli --persist
  
  filename = argv(){1};
  col = eval(argv(){2});
  mult = eval(argv(){3});
2f13b7356   bmarechal   add multiple colu...
6
7
8
9
10
11
12
  if length(col) == length(mult)
      figure
      hold all
      grid on
      cc = 'bkcgmry';
      for i = [1:length(col)]
          data.freq = load(filename)(:,col(i)).*mult(i);
3124193a3   bmarechal   allanplot.m: add ...
13
14
15
16
17
18
          if eval(argv(){4})(i) == 1
              printf(strcat(filename, ' col', num2str(col(i)), ' drift removed
  
  '))
              data.freq = detrend(data.freq);
          end
2f13b7356   bmarechal   add multiple colu...
19
20
          data.rate = 1;
          [ad, S, err, tau] = allan(data, 2.^[0:nextpow2(length(data.freq))-3]./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0);
6ce4bbcc4   bmarechal   allanplot.m: auto...
21
          loglogerr(tau, ad, err, strcat(cc(mod(i, length(cc))), '-s'))
2f13b7356   bmarechal   add multiple colu...
22
          leg{i} = strcat(filename, ' col', num2str(col(i)));
6ce4bbcc4   bmarechal   allanplot.m: auto...
23
          axis(10.^ceil(log10([tau(1), tau(end)])))
2f13b7356   bmarechal   add multiple colu...
24
25
26
27
28
          hold on
      end
      legend(leg)
      input("Press to continue...");
  end
b197c3fdf   bmarechal   first commit
29
  exit