Blame view

sim_fft-adev/adev_tf.m 1.69 KB
0cbce28ef   bmarechal   sim_fft-adev: add...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  clc
  close all
  clear all
  
  %%
  
  N = 1e5;
  G = tf(1, [1e3,1]);
  
  %%
  
  data_white.rate = 1;
  data_white.freq = noise(N, 1, 'white');
  [ad_white, S, err_white, tau] = allan(data_white, 2.^[0:20], 'white noise',0);
  
  data_white_f.rate = 1;
  data_white_f.freq = lsim(G, data_white.freq, 1:length(data_white.freq));
  [ad_white_f, S, err_white_f, tau] = allan(data_white_f, 2.^[0:20], 'white noise filtered',0);
  
  %%
  
  data_pink.rate = 1;
  data_pink.freq = noise(N, 1, 'pink');
  [ad_pink, S, err_pink, tau] = allan(data_pink, 2.^[0:20], 'pink noise',0);
  
  data_pink_f.rate = 1;
  data_pink_f.freq = lsim(G, data_pink.freq, 1:length(data_pink.freq));
  [ad_pink_f, S, err_pink_f, tau] = allan(data_pink_f, 2.^[0:20], 'pink noise filtered',0);
  
  %%
  
  data_brown.rate = 1;
  data_brown.freq = noise(N, 1, 'brown');
  [ad_brown, S, err_brown, tau] = allan(data_brown, 2.^[0:20], 'brown noise',0);
  
  data_brown_f.rate = 1;
  data_brown_f.freq = lsim(G, data_brown.freq, 1:length(data_brown.freq));
  [ad_brown_f, S, err_brown_f, tau] = allan(data_brown_f, 2.^[0:20], 'brown noise filtered',0);
  
  %%
  
  data_red.rate = 1;
  data_red.freq = noise(N, 1, 'red');
  [ad_red, S, err_red, tau] = allan(data_red, 2.^[0:20], 'red noise',0);
  
  data_red_f.rate = 1;
  data_red_f.freq = lsim(G, data_red.freq, 1:length(data_red.freq));
  [ad_red_f, S, err_red_f, tau] = allan(data_red_f, 2.^[0:20], 'red noise filtered',0);
  
  %%
  
  figure
  hold on
  loglogerr(tau, ad_white, err_white, 'b')
  loglogerr(tau, ad_white_f, err_white_f, 'r')
  loglogerr(tau, ad_pink, err_pink, 'b-o')
  loglogerr(tau, ad_pink_f, err_pink_f, 'r-o')
  loglogerr(tau, ad_brown, err_brown, 'b-d')
  loglogerr(tau, ad_brown_f, err_brown_f, 'r-d')
  loglogerr(tau, ad_red, err_red, 'b-*')
  loglogerr(tau, ad_red_f, err_red_f, 'r-*')
  grid on