Skip to main content

Warning

This package is no longer maintained. Compatibility with recent versions of Python, NumPy or SciPy cannot be guaranteed.

pyplnoise

Python power law noise generates arbitrarily long streams of power law noise using NumPy and SciPy.

The noise is generated with shaping filters and the methodology closely follows Stephane Plaszczynski, Fluct. Noise Lett. 7: R–R13, 2007. You can also find the article on arXiv:astro-ph/0510081.

pyplnoise consists of a single module providing classes implementing the following noise sources:

  • general 1/fα power law noise with upper and lower frequency limits (class AlphaNoise),
  • a fast red (Brownian) noise generator with a lower frequency limit (class RedNoise),
  • a convenience alias for pink noise (aka 1/f noise; class PinkNoise),
  • and of course white noise (class WhiteNoise).

Quick example

The interface is very simple: just instantiate one of the above classes and run get_sample() to retrieve a single sample or get_series(npts) to retrieve an array of npts samples. Detailed interface documentation is available in the code.

import pyplnoise
import numpy as np

fs = 10. # sampling frequency in Hz

# instantiate a noise source with lower frequency limit 1e-3 Hz,
# upper frequency limit 5 Hz and 1/f^1.5 power spectrum
noisegen = pyplnoise.AlphaNoise(fs, 1e-3, fs/2., alpha=1.5, seed=42)

one_sample = noisegen.get_sample()
many_samples = noisegen.get_series(100000)

Detailed examples

Jupyter notebooks are provided in the /examples directory:

  1. Overview of the noise sources and their properties
  2. Application example: modeling the random signal errors of a gyroscope (Allan variance of synthetic noise)

Installation

Dependencies

  • NumPy ≥ 1.17 (see NEP 19)
  • SciPy ≥ 1.3

Installing from PyPI

pip install pyplnoise

Installing directly from GitHub

Download the release tarball and run

python setup.py install

Because everything is contained in the module pyplnoise, you can alternatively just copy the module and the LICENSE file into your project.

You may find pyplnoise useful, if...

  • ...you're looking to generate 1/fα noise with very long correlation times (frequencies ≪ 10-7 Hz); particularly if your machine has limited memory resources.
  • ...you like to superimpose many colored noise sources, possibly sampled at different frequencies and possessing different bandwidths.

You may not find pyplnoise useful, if...

Metadata

Release files for pyplnoise 1.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 pyplnoise 1.4
File Size Uploaded
pyplnoise-1.4.tar.gz 751.0 kB Details

Built distribution (wheel)

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

Total release size: 757.5 kB

Release files / pyplnoise-1.4.tar.gz

Download URL pyplnoise-1.4.tar.gz
Size 751.0 kB
Tags Source
SHA-256 checksum
How to use checksums
eeaad5f44b8d80e329ec8531dad348e0d66c74fb1653bffd65cf065c0908e9f0
BLAKE2b-256 checksum
How to use checksums
d1dbb01af04ce8ffdf9f32c3f0875e61c1189d4442f364d20465a782bea58bc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / pyplnoise-1.4-py3-none-any.whl

Download URL pyplnoise-1.4-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9ee2f1b529be4acfcfc7c3dd808fa9d848c7a28984ee8526502944788a53817
BLAKE2b-256 checksum
How to use checksums
93c90eefa8a79653518a439070ace9ac850556316519969575dd5f036e5c03f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.4 This release

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