allan_deviation
Overlapping Allan deviation of a rate (frequency) or phase time series at logarithmically spaced averaging times: white-noise, bias-instability, random-walk and drift regions from a non-negative power-law fit, the random-walk coefficient, the minimum and its averaging time, the log-log slope; curve as csv. Takes measured samples or synthesises a seeded series.
- Field
- Measurement and data
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.2 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001linear rate drift y = a t (a = 0.004 /s, tau0 = 0.5 s): ADEV = a tau / sqrt 2 exactly (IEEE Std 952 ramp term), R = a, slope +1; closed form, rel 1e-9passed
adev_at_query0.0282843 ± 2.8e-110.0282843lockedunder 0.01 % of the tolerance usedadev_tau00.00141421 ± 1.4e-120.00141421lockedunder 0.01 % of the tolerance useddrift_rate0.004 ± 4e-120.004lockedunder 0.01 % of the tolerance usedloglog_slope1 ± 1e-091lockedunder 0.01 % of the tolerance usedr0002constant signal 3.25: every Allan deviation is 0 by definition (differences of equal averages); exactpassed
adev_tau00 ± 1e-150lockedunder 0.01 % of the tolerance usedadev_max0 ± 1e-150lockedunder 0.01 % of the tolerance usedminimum_location= flat_zeroflat_zerolockedexact matchr0003alternating +1,-1 (20 samples, tau0 = 1 s), by hand from the definition: m-averages are +-1/m (odd m) or 0 (even m), so ADEV(m tau0) = sqrt2/m for odd m, 0 for even m; ADEV(1 s) = sqrt 2, ADEV(3 s) = sqrt2/3, ADEV(2 s) = 0; exact, rel 1e-9passed
adev_tau01.41421 ± 1.4e-091.41421lockedunder 0.01 % of the tolerance usedadev_at_query0.471405 ± 4.7e-100.471405lockedunder 0.01 % of the tolerance usedadev_min0 ± 1e-150lockedunder 0.01 % of the tolerance usedtau_at_min_s2 ± 1e-122lockedunder 0.01 % of the tolerance usedr0004phase input x = t^2/2 (rate y = t, a = 1 /s), 11 samples: second difference of x is a tau^2, so ADEV = tau / sqrt 2 exactly; ADEV(1 s) = 0.7071068, ADEV(4 s) = 2.8284271, R = 1; closed form, rel 1e-9passed
adev_tau00.707107 ± 7.1e-100.707107lockedunder 0.01 % of the tolerance usedadev_at_query2.82843 ± 2.8e-092.82843lockedunder 0.01 % of the tolerance useddrift_rate1 ± 1e-091lockedunder 0.01 % of the tolerance usedr0005white rate noise s = 2, 1e5 samples, seed 7: AVAR = s^2 tau0/tau, so ADEV(tau0) = s = 2, slope -1/2, N = s sqrt(tau0) = 2; statistical: rel 1.5 % on ADEV(tau0) is ~5 sigma of its 0.32 % sampling error, slope +-0.03 and N 2 % cover the fit's pooled sampling errorpassed
adev_tau02 ± 0.031.99723locked9.2 % of the tolerance usedloglog_slope-0.5 ± 0.03-0.500532locked1.8 % of the tolerance usedwhite_noise_coefficient2 ± 0.041.99613locked9.7 % of the tolerance usedr0006rate random walk, step sd q = 0.01 per sample, 1e5 samples, seed 11: exact discrete AVAR = q^2 (2m^2+1)/(6m) (worked from the definition), so ADEV(1 s) = q/sqrt2 = 0.00707107, ADEV(10 s) = q sqrt(201/60) = 0.0183030, K = q/sqrt(tau0) = 0.01; statistical: 1.5 % / 3 % are ~5 sigma of the 0.22 % / 0.7 % sampling errors, K 5 % because the fit pools long-tau points with errors of several %passed
adev_tau00.00707107 ± 0.000110.00706147locked9 % of the tolerance usedadev_at_query0.018303 ± 0.000550.0183102locked1.3 % of the tolerance usedrandom_walk_coefficient0.01 ± 0.00050.00998714locked2.6 % of the tolerance used
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
kind | frequency | frequency: the samples are a rate (gyro deg/s, fractional frequency, sensor reading); phase: the samples are its time integral (time error, angle), in unit times seconds. | |
values | [] | Equally spaced samples, oldest first. Leave empty and set synth_n to synthesise a series instead. | |
sample_interval_s | s | 1.0 | Time between samples (tau0). |
unit | 1 | Unit of the rate samples (deg/s, Hz, 1 for fractional frequency). Every deviation is reported in it. | |
points_per_decade | 1 | 10 | Averaging times per decade (logarithmic spacing, whole multiples of tau0). |
max_tau_fraction | 1 | 0.2 | Longest averaging time as a share of the record (0.5 is the estimator's limit; past 0.2 the points are very uncertain). |
tau_query_s | s | Optional: one averaging time to read the deviation at (snapped to a whole number of samples). | |
synth_n | 1 | 0 | Number of synthetic rate samples (0: use values). |
synth_white_sd | 1.0 | Synthetic: standard deviation of the white noise per sample. | |
synth_walk_step_sd | 0.0 | Synthetic: standard deviation of each random-walk step (one step per sample). | |
synth_drift_per_sample | 0.0 | Synthetic: linear drift of the rate, per sample. | |
synth_offset | 0.0 | Synthetic: constant offset (does not change the deviation). | |
seed | 1 | 1 | Synthetic: generator seed (xoshiro256**); the same seed gives the same series. |
Readings
| Name | Unit | Meaning |
|---|---|---|
source | values or synthetic | |
kind | ||
unit | the unit every deviation is in | |
sample_count | 1 | |
record_length_s | s | |
tau_count | 1 | |
tau_min_s | s | |
tau_max_s | s | |
adev_tau0 | Allan deviation at one sample interval | |
adev_min | smallest Allan deviation on the curve | |
tau_at_min_s | s | |
adev_min_rel_error | 1 | 1-sigma relative sampling error of adev_min |
adev_max | ||
adev_at_query | ||
query_tau_s | s | |
minimum_location | interior, shortest_tau, longest_tau, single_tau or flat_zero | |
minimum_resolved | an interior minimum with a fall before and a rise after it beyond 2 sigma | |
loglog_slope | 1 | weighted slope of log ADEV against log tau over the whole curve |
white_noise_coefficient | No unit the kernel can check (unit s^0.5 is not a whole power). N (angle/velocity random walk), unit s^0.5; reported as the white term's ADEV at tau = 1 s | |
bias_instability | B, the flicker floor is 0.664 B | |
random_walk_coefficient | No unit the kernel can check (unit s^-0.5 is not a whole power). K (rate random walk), unit s^-0.5; reported as its number in the unit of the samples | |
drift_rate | No unit declared (unit/s cannot be formed from a free-text unit). R (rate ramp), unit/s; reported as its number in the unit of the samples | |
regions | per noise term: slope, whether it dominates anywhere, coefficient (true dimension in coefficient_unit), the averaging times where it dominates | |
curve | ||
warnings |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.