comparison Allan.h @ 136:7b9cf3d4346e

Code cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 22 Jan 2014 12:29:58 +0100
parents 77539f2597b1
children 792ac7151f0f
comparison
equal deleted inserted replaced
135:77539f2597b1 136:7b9cf3d4346e
1 #include "YLCStuff.h" 1 #ifndef __FXANALISE_ALLAN_H__
2 #define __FXANALISE_ALLAN_H__
2 3
3 #define ALLAN_MAXPOINTSNUMBER 13 // can compute Allan dev for tau from 1s to 2^13 s =8192 s ~ 2h15' < 10000 s 4 /**
4 5 * The Allan deviation is computed at 2^(N tau0) seconds integration times
5 6 * with N ranging from 0 to ALLAN_NUM_DATAPOINTS - 1. Setting this parameter
6 // Allan_Data : the data of crypto class Allan 7 * to 14 allows to compute the allan deviation up to 2^13 = 8192 seconds. */
8 #define ALLAN_NUM_DATAPOINTS 14
7 9
8 typedef struct { 10 typedef struct {
9 PanelHandle AllanPanel ; // le handle sur le graphe 11 int AllanPanel; /* display panel handle */
10 double AllanVar[ALLAN_MAXPOINTSNUMBER] ; // the values of variances for each tau = 2^n.tau_0 (with n from 0 to ALLAN_MAXPOINTSNUMBER) 12 double X[ALLAN_NUM_DATAPOINTS];
11 double FirstMean[ALLAN_MAXPOINTSNUMBER] ; // the means of the first block of 2^n data for which averaging was completed 13 double AllanVar[ALLAN_NUM_DATAPOINTS]; /* Allan variance computed at tau = 2^(N tau0) */
12 double LastMean[ALLAN_MAXPOINTSNUMBER] ; // the means of the last block of 2^n data for which averaging was completed 14 double FirstMean[ALLAN_NUM_DATAPOINTS]; /* mean of the first block of 2^N data for which averaging was completed */
13 int BlocksNumber[ALLAN_MAXPOINTSNUMBER] ; // the number of blocks of 2^n data (averaged) used for computing AVAR(2^ntau) 15 double LastMean[ALLAN_NUM_DATAPOINTS]; /* mean of the last block of 2^N data for which averaging was completed */
14 double CurrentAverage[ALLAN_MAXPOINTSNUMBER] ; // the sum of the last p data points retrieved (with p<2^2n). used for averaging as soon as p=2^n 16 int BlocksNumber[ALLAN_NUM_DATAPOINTS]; /* number of 2^N data points blocks used for computing AVAR(2^(N tau0)) */
15 int NbCurrentAverage[ALLAN_MAXPOINTSNUMBER] ; // number of data point being summed in CurrentAverage (from 0 up to 2^n) 17 double CurrentAverage[ALLAN_NUM_DATAPOINTS]; /* sum of the last P data points retrieved. P < 2^N */
16 double Drift, Mean ; // the drift rate of the data (in Hz/s), and the mean value (in Hz) : only usefull for dedrifting... 18 int NbCurrentAverage[ALLAN_NUM_DATAPOINTS]; /* number of data point being summed in CurrentAverage */
19 double Drift; /* frequency drift rate [Hz/s] */
20 double Mean; /* mean frequency [Hz] */
17 double normalization; 21 double normalization;
18 int autoscale; 22 int autoscale;
19 int active; 23 int active; /* active */
20 int parent; 24 int parent; /* panel containig the activation control */
21 int control; 25 int control; /* activation control handle */
22 } Allan_Data ; 26 } Allan_Data;
23 27
28 void Allan_InitPanel(Allan_Data *data, const char * title, double Normalizer, int parent, int control);
29 void Allan_ClosePanel(Allan_Data *data);
30 void Allan_AddFrequency(Allan_Data * data, double Freq);
24 31
25 // The functions of crypto class Allan 32 #endif
26
27 void Allan_InitPanel(Allan_Data * Instance, const char * title, double Normalizer, int parent, int control) ;
28 void Allan_ClosePanel(Allan_Data * Instance) ;
29 void Allan_AddFrequency(Allan_Data * Instance, double Freq) ;
30