aewallin/allantools

How does this apply to general signals?

Closed this issue · 2 comments

The example from Analog Devices here gives the following value for the deviation with tau = 1 second (after you fix the slight mistakes in their spreadsheet):

0.004 878 48

Following the description here, I implemented my own version. This description is very simple: "the Allan Deviation for tau = 1 second is the standard deviation of the averages of the signal every 1 second" (there are 30 such periods in this dataset). I compute:

0.004 954 74

Which is "close".

If I call (taus, adev, _, ns) = allantools.adev(data, rate_Hz, taus=1) with rate_Hz = 10, I get:

0.031 938 69

Which is "not even close".

This equation from Wikipedia is perplexing me:

image

Your implementaiton of adev seems to be the right side, with x; the spreadsheet uses the version with y_bar, where, according to them, y_bar = mean x for each subperiod of length tau, which is most definitely not algebraically equivalent to what you've implemented. The "verbal" version I implemented is not algebraically equivalent to either.

I understand, as usual, that different people call things by different names (the spreadsheet refers to "variance" when they mean "deviation"), but what gives? What is the general application of this library to a sampled signal?

When ADEV is used for time/frequency data the x-formula and y-formula are equivalent, because fractional frequency y is the time derivative of phase x.

When ADEV is (mis)used for other raw data input like voltage (or like above, acceleration?), you most probably want to treat it like (fractional) frequency data and use the y-formula.
this is done in allantools with the data_type='freq' argument.

The AD-website link talks about 30s averages - allantools does the averaging for you. feed the raw data (e.g. sampled at 10S/s), and if you want ADEV at both tau=1s and tau=30s, with rate=10(Hz), then call with taus=[1,30]

Thanks for the clarification!