view Allan.h @ 268:ec4462c7f8b7

Extensive cleanup of beatnote specific variables Reorganize the beatnote specific variables in arrays indexed by the beatnote enum constants LO, HG, SR. Also reorganize DDS frequency related variables in arrays indexed by the DDS channel number.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Thu, 09 Jul 2015 23:11:00 +0200
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