diff 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
line wrap: on
line diff
--- a/Allan.h	Wed Jan 22 12:29:38 2014 +0100
+++ b/Allan.h	Wed Jan 22 12:29:58 2014 +0100
@@ -1,30 +1,32 @@
-#include "YLCStuff.h"
+#ifndef __FXANALISE_ALLAN_H__
+#define __FXANALISE_ALLAN_H__
 
-#define ALLAN_MAXPOINTSNUMBER 13			// can compute Allan dev for tau from 1s to 2^13 s =8192 s ~ 2h15' < 10000 s
-
-
-// Allan_Data : the data of crypto class Allan
+/**
+ * The Allan deviation is computed at 2^(N tau0) seconds integration times
+ * with N ranging from 0 to ALLAN_NUM_DATAPOINTS - 1.  Setting this parameter
+ * to 14 allows to compute the allan deviation up to 2^13 = 8192 seconds. */
+#define ALLAN_NUM_DATAPOINTS 14
 
 typedef struct {
-	PanelHandle AllanPanel ;					// le handle sur le graphe
-	double AllanVar[ALLAN_MAXPOINTSNUMBER] ;	// the values of variances for each tau = 2^n.tau_0 (with n from 0 to ALLAN_MAXPOINTSNUMBER)
-	double FirstMean[ALLAN_MAXPOINTSNUMBER] ;   // the means of the first block of 2^n data for which averaging was completed
-	double LastMean[ALLAN_MAXPOINTSNUMBER] ;    // the means of the last block of 2^n data for which averaging was completed
-	int BlocksNumber[ALLAN_MAXPOINTSNUMBER] ;	// the number of blocks of 2^n data (averaged) used for computing AVAR(2^ntau)       
-	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
-	int NbCurrentAverage[ALLAN_MAXPOINTSNUMBER] ;	// number of data point being summed in CurrentAverage (from 0 up to 2^n)
-	double Drift, Mean ; // the drift rate of the data (in Hz/s), and the mean value (in Hz) : only usefull for dedrifting...
+	int AllanPanel;									/* display panel handle */
+	double X[ALLAN_NUM_DATAPOINTS];
+	double AllanVar[ALLAN_NUM_DATAPOINTS];			/* Allan variance computed at tau = 2^(N tau0) */
+	double FirstMean[ALLAN_NUM_DATAPOINTS];			/* mean of the first block of 2^N data for which averaging was completed */
+	double LastMean[ALLAN_NUM_DATAPOINTS];			/* mean of the last block of 2^N data for which averaging was completed */
+	int BlocksNumber[ALLAN_NUM_DATAPOINTS];			/* number of 2^N data points blocks used for computing AVAR(2^(N tau0)) */
+	double CurrentAverage[ALLAN_NUM_DATAPOINTS];  	/* sum of the last P data points retrieved. P < 2^N */
+	int NbCurrentAverage[ALLAN_NUM_DATAPOINTS];		/* number of data point being summed in CurrentAverage */
+	double Drift;									/* frequency drift rate [Hz/s] */
+	double Mean;									/* mean frequency [Hz] */
 	double normalization;
 	int autoscale;
-	int active;
-	int parent;
-	int control;
-} Allan_Data ;
-
+	int active;										/* active */
+	int parent;										/* panel containig the activation control */
+	int control;									/* activation control handle */
+} Allan_Data;
 
-// The functions of crypto class Allan
+void Allan_InitPanel(Allan_Data *data, const char * title, double Normalizer, int parent, int control);
+void Allan_ClosePanel(Allan_Data *data);
+void Allan_AddFrequency(Allan_Data * data, double Freq);
 
-void Allan_InitPanel(Allan_Data * Instance, const char * title, double Normalizer, int parent, int control) ;
-void Allan_ClosePanel(Allan_Data * Instance) ;
-void Allan_AddFrequency(Allan_Data * Instance, double Freq) ;
-
+#endif