view Allan.h @ 149:39bff2e412d8

Update expression to compute Sr absolute frequency
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Thu, 30 Jan 2014 18:44:07 +0100
parents 792ac7151f0f
children
line wrap: on
line source

#ifndef __FXANALISE_ALLAN_H__
#define __FXANALISE_ALLAN_H__

/**
 * 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 {
	int AllanPanel;									/* display panel handle */
	double X[ALLAN_NUM_DATAPOINTS];
	double AllanVar[ALLAN_NUM_DATAPOINTS];			/* Allan variance computed at tau = 2^(N tau0) */
	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;										/* active */
	int parent;										/* panel containig the activation control */
	int control;									/* activation control handle */
} Allan_Data;

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);

#endif