This is a simple command-line utilty for analyzing the frequency stability of clocks in terms of their Allan deviation and related statistics.
All of these commands take time error data as input, one item per line:
Command | Description |
---|---|
tau-sigma adev |
Allan deviation (overlapped estimator) |
tau-sigma mdev |
Modified Allan deviation |
tau-sigma tdev |
Time deviation |
tau-sigma hdev |
Hadamard deviation (overlapped estimator) |
tau-sigma totdev |
Total deviation |
tau-sigma theo1 |
Theo1 deviation |
tau-sigma theobr |
TheoBR deviation (bias-reduced Theo1) |
tau-sigma theoh |
TheoH deviation (Allan at low taus, TheoBR at high taus) |
Output is CSV with "tau" and "sigma" column headers.
I have not yet found good example data sets for the following two statistics, so they are supported experimentally:
Command | Description |
---|---|
tau-sigma theobr |
TheoBR deviation (bias-reduced Theo1) |
tau-sigma theoh |
TheoH deviation (Allan at low taus, TheoBR at high taus) |
This isn't meant to be a full-powered charting tool, but it's useful to be able to generate quick-and-dirty plots.
The tau-sigma chart
command generate a line chart from time series
data. This is meant for plotting time or frequency error series.
The tau-sigma loglog
commands generates a tau/sigma log-log chart
from the output of the stability statistic subcommands. The data is
plotted with square decades to help judge the slopes of the curve.
The tau-sigma noise
command generates random spectral noises and
mixes thereof.
The tau-sigma convert
command converts between phase/frequency data
series and units.
These examples are scripted in scripts/examples.sh
.
Noise Type | Time errors | Frequency errors | ADEV |
---|---|---|---|
White phase modulation | |||
Flicker phase modulation | |||
White frequency modulation | |||
Flicker frequency modulation | |||
Random walk frequency modulation |
The rotation of our planet is not stable. We can illustrate by
applying tau-sigma
to data from the
International Earth Rotation Service:
This example is scripted in scripts/iers.sh
. More
about the data in example-data/README.md
.
I wrote this utilty to help my efforts to understand the performance
of historical precision timepieces. Here's a fine example: the
1779/80 Greenwich trial of
John Arnold's pocket chronometer #36,
one of the very earliest successful precision watches. Read more in
example-data/README.md
.
(The discontinuity evident around 3.4e1 on the x axis is the switch point of the TheoH hybrid statistic, which is ADEV at short averaging intervals and TheoBR at longer ones.)
Daily Rates | Time error |
---|---|
This tool has so far been written primarily with simplicity and correctness in mind, not performance. The code for the statistical functions sticks very closely to the mathematical formulas in the reference materials.
I do not warranty that the results of this program are always correct. Nevertheless, I have taken care to test that the results at least look sensible. The following properties are tested:
- The results of most of the frequency stability functions are compared against the ones published by Riley and Howe (2008) for two public data sets. See:
- The Theo1 statistic is tested against an example in Appendix A of Howe (2006). See:
- There's also tests that check that the slopes of the statistics are more or less what they should be on various noise types. See:
Not all statistics are subjected to all the tests just yet. In particular, I don't have example data sets of the TheoBR or TheoH statistics to compare against. (These are derived from the Allan and Theo1 deviations, which I do test.)
This is a pure Haskell program built with the Stack tool, so you need to install that to compile the program.
Once you've done that the installation follows standard Stack procedure:
- Clone this Git repo.
- Change into the base directory and run
stack install
.
This will install the tau-sigma
commandline program to the location
where the Stack tool puts executable programs (default ~/.local/bin/
in Unix and OS X systems).
- Error bars!
- Triple check the flicker noise generation code.
- Smart scaling of log/log chart axes. We need same-sized decades in both axes.
- Generate charts in other formats than SVG.
- Frequency spectra
- Other stability statistics
- Howe, D.A. 2000. "The Total Deviation Approach to Long-Term Characterization of Frequency Stability." IEEE Transactions on Ultrasonics, Ferroelectrics and Frequency Control, Vol. 47, No. 5 (Sep. 2000).
- Howe, D.A. 2006. "TheoH: a hybrid, high-confidence statistic that improves on the Allan deviation." Metrologia 43 (2006) S322-331.
- Riley, William and David A. Howe. 2008. Handbook of Frequency Stability Analysis. National Institute of Standards and Technology Special Publication 1065, July 2008. Boulder, Colorado: National Institute of Standards and Technology.
- Tange, O. 2011. "GNU Parallel - The Command-Line Power Tool." ;login: The USENIX Maganize, vol. 36, No.1 (Feb. 2011), pp. 42-47.
- Taylor, Jennifer A. and David A. Howe. 2010. "Fast TheoBR: A Method for Long Data Set Stability Analysys.*" IEEE Transactions on Ultrasonics, Ferroelectrics and Frequency Control, Vol. 57, No. 9 (Sep. 2010).