Skip to main content

Allan variance tools

Project description

PyPI Downloads

Allan Variance Tools

import avar

or for specific functions (like variance)

from avar import variance

Array of Windows

avar.windows(K, min_size=1, density=64)

This will create an array M of integer window sizes. The averaging period tau would equal M*T, where T is the sampling period. The min_size sets the minimum window size. The density is the target number of window sizes in the array per decade. Obviously, in the first decade it is not possible to have more than 9 window sizes: 1 through 9.

Signal Allan Variance

avar.variance(y, M)

To get the actual Allan variance of a signal y, use this function. You must supply the array of window sizes M for which to calculate the Allan variance values. This function can take for y either a one-dimensional array or a two-dimensional array in which each row will be treated as a data set.

Ideal Allan Variance

avar.ideal(tau, p)

The ideal function will calculate the ideal Allan variances over an array of averaging periods tau. For any noise components you wish not to be included, set their corresponding variances to zero.

This function make use of the params class. Objects of this type store the five basic component noise variances (quantization, white, flicker, walk, and ramp), vc, any first-order, Gauss-Markov (FOGM) noise variances, vfogm, and the corresponding FOGM time constants, tfogm. The p parameter is one such object. You can define it as shown in the following example:

p = avar.params(
        vc=np.array([0.5, 1.0, 0, 0.5, 0.1]) * 1e-9,
        vfogm=[1e-8, 1e-7],
        tfogm=[0.1, 1.0])

The ideal function will return the total Allan variance curve, va, as well as a matrix, vac, whose rows represent the component Allan variances over tau.

Fitting to Signal Allan Variance

avar.fit(tau, va, mask=None, fogms=0, tol=0.007, vtol=0.0)

Given the Allan variance curve of some signal, va, at various averaging periods tau, you can get the best fit using the five basic component noises and fogms number of first-order, Gauss-Markov (FOGM) noises. By default, this function will automatically attempt to determine if certain component noises are even at play based on the tolerance value tol. However, you can directly control which component noises you wish to include or exclude with the mask array. For each element of mask that is False the corresponding component noise will be excluded. This function will iterate through the various permutations of component noises, starting with 0 FOGMs. If a fit satisfies the specified tol tolerance, the search will end. Otherwise, the best fit will be used. The vtol parameter is the minimum allowed variance for any fitted component noise variance.

The return values are the fitted Allan variance curve, vf, and a params object, p (see the section on Ideal Allan Variance), containing the variances of the basic component noise variances (quantization, white, flicker, walk, and ramp), vc, any first-order, Gauss-Markov (FOGM) noise variances, vfogm, and the corresponding FOGM time constants, tfogm.

Noise Generation

avar.noise(K, T, p)

Generate a noise signal of length K, sampling period T, and parameters p. Parameter p is a params object (see the section on Ideal Allan Variance).

This function returns the noise signal y.

For flicker (bias-instability) noise, multiple, balanced FOGMs are used.

Installation

For instructions on using pip, visit https://pip.pypa.io/en/stable/getting-started/.

To install from pypi.org,

pip install avar

Or, from the directory of the cloned repo, run

pip install .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avar-0.1.6.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

avar-0.1.6-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file avar-0.1.6.tar.gz.

File metadata

  • Download URL: avar-0.1.6.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for avar-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8b868680ba884565cdc51ac8f62118981ebd700829f86780cff9c6f00246dd56
MD5 a1672836c49b133a5ff98955c0358a55
BLAKE2b-256 45e5b6a8b8fceb847e39a7c4553569bf9f6d25a542bd60a48ab699a03979d076

See more details on using hashes here.

File details

Details for the file avar-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: avar-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for avar-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 20af4fa9e76b04b801475c3ff83df3a498e96b0d24ef6ea2f10cd540d5cfc33b
MD5 79051a057ddc9db259bf1c03b6517f73
BLAKE2b-256 1f156b02f4d55a1e57e8cdf1b934f7bf43a603d1e6a758050ddd1b67ad6dab45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page