File Exchange

image thumbnail

allan v1.71

version 1.3 (5.79 KB) by

Calculates Allan deviation of a time domain signal.



View License

There is a newer version that calculates normal, overlapping, modified and times Allan deviations in one function:

allan.m calculates the Allan deviation of a time domain signal. It is intended for stability analysis of frequency data. Data sets with rate or time stamp information are handled.
Enhanced performance for rate in comparison to allan.m v1.61 (by M.A. Hopcroft, file ID 13246) by preallocating memory space. No changes for time stamp.
For long time series, the enhancement gets more significant.

Motivation: Calculate Allan variance for long time series with high sample rates.
Sample data available at

Comments by John D'Errico (Oct 14, 2008) are incorporated.

Comments and Ratings (3)

This short script is very useful for analyzing noise like vibrations, long time drifts etc. It is easy to use and is relatively fast.

Danny Rogers

Does this calculate the overlapping ADEV? It looks like it doesn't - perhaps modifying it to calculate overlapping ADEV - the standard ADEV is considered about 20 yrs out of date.... just a thought.

John D'Errico

Pretty good help. Complete. References. Descriptions of the arguments. A complete revision history. Lots of meaningful internal comments.

A few points that the author should consider repairing:

Swap the first two lines of the help. The lookfor utility uses the very FIRST line of the help. But as it is in this code, lookfor will fail to find anything of value.

% Compute the Allan deviation for a set of time-domain frequency data

Swap those two lines, and lookfor will be properly enabled. As well, if you use help on a directory name that contains this file, then it too uses the H1 line.

I'd also recommend that the author should use mlint. Mlint found multiple lines where variables are created yet never used in the code. Also, variables are dynamically grown with no use of preallocation. Also, there is no need for a return statement at the end of a function.

One problem that seemed more serious. I tested the author's example, but it fails with a semilogy error.

??? Error using ==> semilogx
Vectors must be the same lengths.

Error in ==> allan at 359

I'm hoping the author will fix the bug and swap the first two comment lines to repair the H1 line, so I'll hold off on any numerical rating until he does at least these things.



There is a newer version that calculates normal, overlapping, modified and times Allan deviations:

MATLAB Release
MATLAB 7.6 (R2008a)

Inspired by: allan

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today