Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyPI conda-forge Python CI Docs License: MIT

convolinear - Fluent Signal Processing for Python

Fluent signal processing for Python, one line at a time.

convolinear pulse compression: the same chirp echo shown at -6 dB SNR, where the sweep is still visible in a spectrogram, and at -20 dB SNR, where it is not; one correlate() call recovers the 1400 ms round-trip delay in both cases

Pulse compression - the core of every radar, sonar and GPS receiver. The same echo is shown at -6 dB and at -20 dB SNR (echo power against noise power). At -20 dB the spectrogram shows nothing at all, and one correlate() call still collapses the echo into a spike at the exact round-trip delay. Reproduce with python examples/hero.py.

convolinear wraps the power of NumPy and SciPy in a fluent, readable API. Common DSP tasks - loading audio, filtering, mixing, and spectral analysis - become short, expressive one-liners instead of 10+ lines of boilerplate.

Extract data from a .wav file, bandpass it, normalise it, take the Fourier transform, and plot it. All in a single line of code:

Signal.from_wav("audio.wav").bandpass(300, 3000).normalize().fft().plot()

convolinear signal processing pipeline result: bandpass filter, normalize, and FFT plot of an audio signal

Installation

Core requirements: Python 3.11+, NumPy >= 1.23.2, SciPy >= 1.9.2

Optional dependencies unlock the following loaders and features:

Extra Packages installed Unlocks
plot matplotlib every .plot() method
audio soundfile Signal.from_audio()
pandas pandas, pyarrow from_csv(), from_parquet(), from_pandas(), to_dataframe()

MATLAB .mat files load through SciPy, already a core dependency - no extra needed.

With pip

convolinear is published on PyPi:

pip install convolinear
pip install "convolinear[plot,audio,pandas]"

With conda

convolinear is published on conda-forge:

conda install -c conda-forge convolinear

conda-forge packages don't support pip-style extras - install the optional dependencies as separate packages instead:

conda install -c conda-forge convolinear matplotlib soundfile pandas pyarrow

With uv

uv add convolinear
uv add "convolinear[plot,audio,pandas]"

Quickstart

Clean up a noisy tone, then find out what is in it:

from convolinear import Signal

tone = Signal.sine(440, duration=1.0, sample_rate=8000)
noise = Signal.noise(duration=1.0, sample_rate=8000, amplitude=0.5, seed=42)

cleaned = (tone + noise).bandpass(300, 600).normalize()

spectrum = cleaned.fft()
print(f"Dominant frequency: {spectrum.peak_frequency:.1f} Hz")   # ~440.0 Hz

for freq, magnitude in spectrum.top_n(3):
    print(f"{freq:7.1f} Hz   magnitude {magnitude:.4f}")

Every transformation returns a new object - the original is never modified, and a Signal's sample array is genuinely read-only - so branching from one source is always safe.

Not just audio

Sample rates are floats, and rates below 1 Hz work exactly like any other. Three years of daily temperatures, one sample per day:

sig = Signal(temps, sample_rate=1 / 86400)
cycle_hz = sig.remove_dc().fft(window="hann").peak_frequency
print(f"Dominant period: {1 / cycle_hz / 86400:.0f} days")   # Dominant period: 365 days

Capabilities

  • Load from anywhere - WAV, FLAC/OGG/MP3 (via soundfile), CSV, Parquet, NumPy, pandas, MATLAB, or generated tones, noise and arbitrary functions. Sample rates are inferred from dated data.
  • Transform - normalize, trim, gain, concat, resample, window, remove DC, reverse, clip, fade.
  • Filter - Butterworth lowpass, highpass, bandpass and bandstop.
  • Analyse - convolution and correlation, time-delay estimation, peak detection.
  • Frequency domain - fft() returns a Spectrum of raw complex coefficients that inverts losslessly; psd() gives a Welch power spectral density; spectrogram() shows how content evolves over time.
  • Plot - one-call matplotlib views of any signal, spectrum, PSD or spectrogram.

Documentation

Runnable scripts live in examples/.

Development

If you want to contribute to this project:

  1. Fork the repository on GitHub.
  2. Set up an editable clone with uv:
git clone https://github.com/yourusername/convolinear
cd convolinear
uv sync
uv run pytest
  1. Make a new branch for your edits.
  2. Make changes.
  3. Run the same checks CI runs:
uv run ruff check .
uv run ruff format --check .
uv run mypy convolinear
uv run pytest
  1. Commit changes to your fork.
  2. Open a Pull Request.

License

This project is licensed under the MIT License.

Copyright © 2026 Sajid Ahmed

Metadata

Release files for convolinear 0.2.1rc1

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

Source distribution (sdist)

Source distribution for convolinear 0.2.1rc1
File Size Uploaded
convolinear-0.2.1rc1.tar.gz 28.3 kB Details

Built distribution (wheel)

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

Total release size: 58.5 kB

Release files / convolinear-0.2.1rc1.tar.gz

Download URL convolinear-0.2.1rc1.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b328c84d7ddd673429cd3a45cd4b31f5f76c11e838539de36c5fc92b3f89a11d
BLAKE2b-256 checksum
How to use checksums
311cb1ed5c82130a15b20265020cd7fb82af7e04b63433a4871b4eefe8a2aeb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / convolinear-0.2.1rc1-py3-none-any.whl

Download URL convolinear-0.2.1rc1-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
822fdab02dd94f0ac49bbb70f6e506a9d7a402d2b9714ae1b4c437485644f3c9
BLAKE2b-256 checksum
How to use checksums
461f2c67227dff44d5282265f7bf095bd143ab069d3684f7fe79ca60131ca956
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.1rc1 This release

2 release files

0.2.0

2 release files

0.1.0

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