Author Topic: Allan deviation algorithm  (Read 1227 times)

0 Members and 1 Guest are viewing this topic.

Online RandallMcReeTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: us
Allan deviation algorithm
« on: February 28, 2024, 10:45:59 pm »

I'm interested in programming a Teensy4.1 to output the Allan deviation of the voltage that is being monitored.

Is it feasible?

If so, does anyone have code for it?

Thanks,
Randall
 

Offline Kosmic

  • Super Contributor
  • ***
  • Posts: 2544
  • Country: ca
Re: Allan deviation algorithm
« Reply #1 on: February 28, 2024, 11:13:13 pm »

I'm interested in programming a Teensy4.1 to output the Allan deviation of the voltage that is being monitored.

Is it feasible?

If so, does anyone have code for it?

Thanks,
Randall

I usually search in github to get some ideas.

Exemple: https://github.com/topics/allan-variance

This one look easily portable to a Teensy https://github.com/SMAC-Group/avar

Edit: Ha just noticed they don't use STL libraries. You might want to chose another one.
« Last Edit: February 28, 2024, 11:36:59 pm by Kosmic »
 

Offline jfet

  • Contributor
  • Posts: 13
  • Country: um
Re: Allan deviation algorithm
« Reply #2 on: February 29, 2024, 01:20:56 am »
The math is well documented at NIST time and frequency section.  Bill Wrilley wrote a book , its on his web site http://www.stable32.com/ that documents time measurements.  That is were Allan deviation came from David Allan at NIST.  http://www.allanstime.com/
« Last Edit: February 29, 2024, 01:27:45 am by jfet »
 

Offline Kosmic

  • Super Contributor
  • ***
  • Posts: 2544
  • Country: ca
Re: Allan deviation algorithm
« Reply #3 on: February 29, 2024, 01:54:51 am »
The original article from Mr Allan

Allan, David W. 1966. “Statistics of Atomic Frequency Standards.” Proceedings of the IEEE 54 (2): 221–30. https://tf.nist.gov/general/pdf/7.pdf
« Last Edit: February 29, 2024, 02:33:30 am by Kosmic »
 
The following users thanked this post: MegaVolt

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1302
Re: Allan deviation algorithm
« Reply #4 on: March 01, 2024, 04:51:53 am »
I think Tom Van Bak did a version of the code as well.  I have the code, can't remember if I converted it to Visual Basic or did that app in C.  Ping me if you get stuck.
 

Online edpalmer42

  • Super Contributor
  • ***
  • Posts: 2283
  • Country: ca
Re: Allan deviation algorithm
« Reply #5 on: March 01, 2024, 07:11:15 am »
Note that Dr. Allan's work has been updated a few times.

So now, there's:
1.  Allan Deviation - which almost no one uses anymore.
2.  Overlapping Allan - very common.  This is now considered the 'standard' version.
3.  Modified Allan and its overlapping version.
4.  Total Allan and its overlapping version.  This is my favorite because it gives you a longer graph than any of the other versions for a given dataset.

There are others beyond that such as Hadamard and Theo 1.

Each version tends to inflict a heavier computational load than the ones earlier in the list.

A few programs that use Allan Deviation and some of its offshoots are Timelab, Stable32, Plotter, and Alavar.  Timelab is updated regularly, Stable32 and Plotter are not.  I'm not sure what the status of Alavar is.

Ed
« Last Edit: March 01, 2024, 07:18:21 am by edpalmer42 »
 
The following users thanked this post: ManateeMafia, Mickle T., RoGeorge, MegaVolt, Kosmic, miro123

Offline miro123

  • Regular Contributor
  • *
  • Posts: 210
  • Country: nl
Re: Allan deviation algorithm
« Reply #6 on: March 02, 2024, 06:09:42 pm »
There many way to do it on Teensy 4.1
 1. C / C++ code
 2. micropython and import allantools.
More documentation including the python implementation on link below. I gues that python implemrntation is just a python writer on C++ library. It is low footprint and fast
https://allantools.readthedocs.io/en/latest/functions.html
 
The following users thanked this post: MegaVolt


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf