View License

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

» Watch video

Highlights from

4.7 | 9 ratings Rate this file 92 Downloads (last 30 days) File Size: 8.66 KB File ID: #13246 Version: 1.11
image thumbnail



M. A. Hopcroft (view profile)


04 Dec 2006 (Updated )

Calculates standard Allan Deviation (ADEV) of a time domain signal.

| Watch this File

File Information

allan.m calculates the standard Allan deviation (ADEV) of a time domain signal. It is designed for stability analysis of frequency data, although the analysis can be applied to other types of data. Fractional frequency or phase data sets with sample rate or time stamp information are handled.
Note: for overlapping and modified Allan deviation analysis, please see the files allan_modified.m (ID: #26637) and allan_overlap.m (ID: #26441).


This file inspired Allan V1.71 and Modified Allan(Data,Rate,Tau,Varargin).

MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements Installation of dsplot.m (File Exchange ID #15850) is recommended but not required.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
13 Jan 2017 tim .

tim . (view profile)


I encountered an issue while using your very helpful script. I provided a list of TAU-values, that are all divisible by my DATA.rate. However not all of the values were plotted so I investigated and found out that the "m" vector did not look like I expected it to (I had several values that were integer values but looked like this: "6.000" instead of "6", ...). The fix was changing line 300.

m = data.rate.*tau;

m = floor(data.rate.*tau);

I did not notice any side effects.

16 Dec 2015 Sean

Sean (view profile)

05 Feb 2015 Wolfgang Wallner

I get the same error as Simon, when I use allan and only provide the fields 'phase' and 'rate' and set 'verbose' to 1.

I think the usage of data.time in line 220 should be guarded with an isfield(data, 'time').

Commenting out line 220 fixes the error for me, but I did not study the script well enough to know if this creates side effects.

03 Dec 2014 Simon

Simon (view profile)

Dear Hopcroft, i get an error when using DATA.phase together with DATA.rate (put to 1). Maybe something to do with the latest update (18 Mar 2014 v2.24 fix bug related to phase data and timestamps)? Have no old version to compare with.

Index of element to remove
exceeds matrix dimensions.

Error in ==> allan at 220
data.time(1)=[]; % make time
stamps correspond to freq data

Comment only
24 Nov 2014 MIN ZHOU

Hi,it is a convenient program to calculate the ADEV. However, the error bars seem incorrect. The error is not simply +/- 1-sigma estimation, as I know. I am not sure. Thank you!

27 Sep 2013 M. A. Hopcroft

M. A. Hopcroft (view profile)

@Mauricio: yes, you are correct. The values returned by the function are ADEV values and you can square them to get AVAR values.

Comment only
26 Sep 2013 Mauricio

using this file produces ADEV plot, now
if I try to find the Angle Random Walk (ARW) which is found from AVAR plot at tau=1, would I just have to square the ADEV value at tau=1, or not?

09 May 2013 Joe Wiegand

09 May 2013 Joe Wiegand

For some reason I can't seem to determine the value for values of Tau less than 500. Any help would be greatly appreciated.

Comment only
16 Jan 2013 M. A. Hopcroft

M. A. Hopcroft (view profile)

I'll have a look at it if you send me an email with some more details.

Comment only
16 Jan 2013 Anca Nestor

The latest version available for download fails to plot the Allan Deviation. The error message indicates that the input to the semilogx function (tau or sm) is unknown. How can I correct this?

Comment only
10 Mar 2012 Brandon Bourn

Excellent program, works wonderfully, very useful!

07 Feb 2012 Aaron

Aaron (view profile)

Very handy tool, easy to use.
Thanks alot for your help!

06 Aug 2011 M. A. Hopcroft

M. A. Hopcroft (view profile)

type "help allan" to see the help file. email me directly if you are still having trouble.

Comment only
06 Aug 2011 bing yi siah

can i ask how to input a series of data (100 samples data) into the code ?.. thx !!!

Comment only
31 May 2008 Bruno Sanguinetti

Very handy tool, easy to use.

16 May 2007

v1.5: added errors bars, MAD calculation for outlier detection. misc bug fixes (see comments)

11 Feb 2009 1.1

added loglog plot option. Included test data in .mat file.

19 Jan 2010 1.2

v1.8: Vectorized code for significant performance enhancement.

21 Jan 2010 1.3

v1.82: performance enhancement; code/comments cleanup

09 Feb 2010 1.4

handles phase data; error checking; asst. bugfixes

10 Feb 2010 1.5

Description typo fix

04 Apr 2010 1.6

minor bugfixes, data consistency checking updated

18 Oct 2010 1.7

v2.14: updates to plotting, default values

21 Oct 2010 1.8

v2.16 fixed some issues related to plotting

23 Oct 2010 1.9

v2.20 consistent behaviour for all allan_x.m functions.

03 Nov 2010 1.10

v2.22 improve tau handling; plotting bugfix

18 Mar 2014 1.11

v2.24 fix bug related to phase data and timestamps

Contact us