Skip to main content

PyPI Downloads

Allan Variance Tools

The avar library provides tools for Allan variance analysis, a statistical method used to quantify the stability of time series data, particularly in the context of noise characterization for signals. The library includes functions to compute Allan variances, generate various types of noise, and interactively fit Allan variance curves. It is built using Python with dependencies on NumPy, Matplotlib, and SciPy.

Window Generation

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

Generates an array of integer averaging window sizes for Allan variance analysis. It creates logarithmically spaced window sizes between min_size and K/2, with approximately density sizes per decade. It ensures unique integer values.

Allan Variance Calculation

va = avar.variance(y, M)

Computes Allan variance for a time series y over specified window sizes M. Supports both 1D arrays (single time series) and 2D arrays (multiple time series). Uses cumulative sums to calculate variance efficiently, handling overlapping windows.

Ideal Allan Variance

va = avar.ideal_variance(tau, ks, T=None)

Calculates theoretical Allan variance curves for various noise types. Supports quantization, white, first-order Gauss-Markov (FOGM), Brownian, and ramp noises. Parameter ks defines noise slopes and variances, and T specifies the sampling period (required for FOGM).

Noise Generation

The library provides functions to generate different types of noise, each with specific statistical properties:

y = avar.noise_quantization(var, T, K)
y = avar.noise_white(var, T, K)
y = avar.noise_fogm(var, tau, T, K, y0=None)
y = avar.noise_brownian(var, T, K)
y = avar.noise_ramp(var, T, K)

Interactive Allan Variance Fitting

avar.fit(
    tau: np.ndarray,
    va: np.ndarray,
    T: float = 1.0,
    ks: tuple | list | None = None,
    ax: axes = None,
    truecolor: str = "tab:blue",
    fitcolor: str = "tab:orange")

Provides an interactive Matplotlib-based interface for fitting Allan variance curves. Displays true Allan variance (va) and fitted curves based on noise components (ks).

Supports interactive manipulation via mouse and keyboard:

  • Left-click and drag: Move noise components.
  • Shift and left-click or middle-click: Pan the view.
  • Scroll: Zoom (faster with shift).
  • Keys 'q', 'w', 'f', 'b', 'r': Add quantization, white, FOGM, Brownian, or ramp noise components.
  • 'Delete', 'backspace', or key 'x': Remove components.
  • Key 'o': Optimize component variances using least-squares fitting.
  • Key 'h': Reset view to the data limits.
  • Key '?': toggle the help menu.

Features log-log scaling, customizable colors, and optimization bounds for fitting. Handles multiple noise types with specific slopes (-2 to +2) and parameters (e.g., time constant for FOGM).

Release files for avar 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avar 1.0.4
File Size Uploaded
avar-1.0.4.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avar 1.0.4
File Interpreter ABI Platform
avar-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / avar-1.0.4.tar.gz

Download URL avar-1.0.4.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ce1a86974eac128eb94074d61c426d196ee4d6518e513b1de7dc4e6862562134
BLAKE2b-256 checksum
How to use checksums
7965d3c54ffcb9660401bdb9a099e55b0ea1a133de2bcedd1ab59e8d11917c1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / avar-1.0.4-py3-none-any.whl

Download URL avar-1.0.4-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb9b5e52c0524eee3abeb84bf8657ac5d126a5b2d45eba166080bef01d4e5d35
BLAKE2b-256 checksum
How to use checksums
988de500484199bca91ca78e3c73ae2a9aa3b07d40fa6f8a923cedd2d5655001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page