File Exchange

image thumbnail


version 1.0 (16.7 MB) by Eric Ogier
Allan variance calculation GUI


Updated 07 Aug 2016

View License

AVAR is a graphical user interface dedicated to the calculation of Allan variance.
AVAR is able to calculate the following standard deviations :
- Allan deviation (ADEV, with or without overlapping)
- Modified deviation (MDEV)
- Time deviation (TDEV)
The application includes an internal script interpreter allowing simple dynamic operations and can be used as a standalone executable.
Video demonstration:

User manual:

The same functionalities are reused in "AVAR (core)" object (without GUI), enable at the following link:

Comments and Ratings (15)

great job!

Eric Ogier


Indeed, several menus should appear in the main windows when you execute "AVAR.m" script.
As you said, it is possible that the problem is caused by the fact you use an older version of MATLAB.

Normally, the menus are created in "AVAR_OpeningFcn" function, when the execution reaches the following lines:

function AVAR_OpeningFcn(hObject, eventdata, handles, varargin) %#ok<INUSL>

set(gca,'xlim',[0 1]);


% Menu "Menu"
Menu = uimenu(hObject,'Label','Menu');
(the interface was created in a *.fig file but the menus are created programmatically)

I assume one of the intructions I used is now deprecated in R2013 version or the arguments required by this function are no more the same.
In this case, you should see an error message in commands window (I have no other version of MATLAB to test).
The other problem you met is possibly due to the fact this same function fails and doesn't update the structure named "handles", whose fields are used later.

Waiting for a better solution, maybe you can try to use the version without GUI:
There should be less problems of compliance with this one.

Dear Eric,
Thanks for this work.
- However, so far I have problems using it (my MATLAB expertise being far below yours):
When I launch AVAR (what should call AVAR_GUI), I do not get all menus etc that is visible within your Help.pptx.
When I put in your example.mat file, there appears an error box telling me about "Cell contents reference from a non-cell array object" - what does not tell me anything ;-)

Do you think there might be incompatibility issues since I am using Matlab R2013a (and not R2014...)?


Eric Ogier

Hello Arijit,

The main file of the application is "AVAR.m", dedicated to the generation of the interface and including all the fonctionnalities relative to Allan variance calculation.
The GUI is created programmatically, without using FIG files, as you can do with the GUI editor of MATLAB (named "GUIDE").
The data you want to consider in Allan variance calculation must be previously saved as an MAT-file (see "save" instruction). Then you can select the resulting MAT-file through the file selector of the GUI.

For a first use, you can ignore the file titled "AVAR_GUI.m" whose goal is only to fill the GUI through a script. This functionnality is useful in the case you want to automatize the filling of the GUI, for example if you want to treat a lot of MAT-files without having to select each of them. The script titled "AVAR_script.m" in "SCR" folder is an example of how to set the GUI through a script.

Maybe I didn't understand very well your question and if you wanted to use the application as an executable. You can compile it, keeping the same functionnnalities, using the instruction named "mcc" (for example "mcc -e AVAR.m", option "-e" to hide DOS window). Make sure you have the licence for the compilation toolbox.
In the compiled version, you can call the functionnalities given by "AVAR_GUI.m" through "Menu"/"Script interface".

I hope it will help

Hi Eric,
I am not very familiar with MatLab. How do I run the GUI executable file? Please advise.


Eric Ogier

Thanks Nanock,

To take into account your data, you can save the successive angular velocities or the cumulated angles of your gyrometer as a single vector (row or column, it doesn't matter) in a MAT-file.
When you will select this file through "Source" panel, we will see the name of your vector in "Signal" panel (your can choose the good one among all the data of the file).
For gyrometer period, you can define your own time step by editing the box and the units list of the panel titles "Sampling period".
It should work well like that. I hope so.


Hi Eric,
Thank you very much for the file and it is wonderful...
I have a gyro and I want to calculate its performance with your file. What kind of input data your file needs? I mean shall I perform a 2D file, one for time and other for values?

Eric Ogier


Thank you. It depends on your application.
If you want to analyse the stability of an oscillator, you can indeed consider its phase, typically in radian.

In my case, the GUI was dedicated to the measure of the stability of a gyrometer (the gyrometer was measuring a constant angular velocity, Earth rotation rate).
So the input consisted of the successive angular velocities samples, in radian per second.

I could have considered the cumulated angle (the integral), in radian. In that case, the template would have been the one obtained by shifting the slopes of the original one (the derivation/integration of a signal induces a bias of +/- 1/2 on its Allan variance slopes).

Eric Ogier


The sampling period does not affect the appearance of the variance except the factor of the abscissa axes (so the slopes of the template).
If you refer to the fact the curve does not change if you change the value of the sampling period, it is normal.
I cannot permit to change the period after the calculation, for the case the user choose "User defined vector" option.
Indeed, in that case, the calculus shall be performed another time because the successive integration times shall be rounded to the closest values defined by user.
The case of the unit is different because it has no consequence in terms of calculation. It is a graphical information only.
So, just be sure the period you defined is the good one or redo the calculation if you have to change it.


Hi Eric,

I am using the AVAR with great pleasure.
I am however wondering, why when i change the Sampling Period from 1 to eg 0.01, my Allan Deviation graph does not change. I'd think the shape remains the same, however the axis should change ?



Very nicely done! To be clear, the input data file contains phase values in radians?


Amr Younis

many thanks indeed for the prompt and generous answer

Eric Ogier

The loading of data through MAT-files allows the use of a compiled version of the application.
This way to proceed avoids the problems encountered with huge data, which can cause RAM overloading.
Indeed the executable version seems more stable with long vectors (e.g. several days records @1Hz).
The use of MAT-files makes also AVAR compliant with "BIN2MAT" application (both as executables), which avoid the necessity of a MATLAB licence.

The calculation of overlapping Allan variance is possible selecting "Overlapping" checkbox in "Mode" section.
Then the integration times can be defined as a number of regularly spaced times or directly as a vector (respectively through options "Number of samples" or "User defined vector").

The Hadamard variance is not implemented yet... Maybe one day.

Amr Younis

great tool.
* why do i need to import data through a mat file?
* can you add overlapping allan & hadamand?

* can you extend the too to be a complete stability analysis tool?




Adding of a link to user manual.

Correction of a mistake in help file.

Adding of the link to "AVAR (core)" object:

Adding of a video demonstration link.

Adding of a new picture.

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor