Scale covariant and spiking wavelets
Wavelets that are guaranteed to be scale covariant, implemented as standard transforms and with spiking neurons.
Why
Standard wavelets are excellent at robust signal processing but work offline: they need the full signal. Real-time streams (audio, biosignals, sensors) need causal wavelets, and signals at unpredictable rates benefit from scale covariance: the response transforms predictably under time rescaling.
swavelet contains time-causal wavelets that can be used directly as neuromorphic signal encoders, deployable directly to neuromorphic hardware via NIR, both as spiking and non-spiking variants.
The spiking variants double as event-driven ADCs, encoding continuous inputs straight into sparse spike trains, skipping the uniform sampler entirely.
Usage
Install via uv: uv add swavelet or via pip: pip install swavelet
Encoding and decoding (non-spiking)
import jax.numpy as jnp
from swavelet import DoT
dt = 1e-3 # Simulation time delta
t = jnp.arange(0, 1.0, dt) # Duration: 1 second
signal = jnp.sin(2 * jnp.pi * t) # A simple sinusoidal
w = DoT(n_channels=4, dt=dt, mu_max=0.05) # 4-channel wavelet
coeffs = w(w.params, signal) # analysis: (n_channels, T)
recon = w.reconstruct(w.params, coeffs) # synthesis: back to signal
Encoding and decoding (spiking)
The same shape works for every wavelet — call returns coefficients, reconstruct inverts them. Spiking variants substitute spike trains for coefficients:
from swavelet import SpikingDoT
w = SpikingDoT(n_channels=4, dt=dt, mu_max=0.05)
spikes = w(w.params, signal) # (2 * n_channels, T)
# Use the spikes in your ML pipeline or reconstruct:
recon = w.reconstruct(w.params, spikes)
Export to NIR
import nir
from swavelet import SpikingDoE
w = SpikingDoE(n_channels=4, dt=dt, mu_max=0.05)
nir_graph = w.to_nir()
nir.write("spiking_doe.nir", nir_graph)
The graph is a single chain: a fanout Affine broadcasts the scalar input across the K smoothing channels, the multi-channel LI bank produces L_1..L_K, the connectivity Affine wires each bandpass row with ±1 weights between adjacent scales (and the lowpass row taps L_K directly), and a multi-channel LIF emits the spike output. Diagram via NirViz:
Wavelet implementations (spiking and non-spiking)
- DoG: Difference of Gaussian
- DoT: Difference of time-causal limit kernel
- DoE: Difference of truncated exponential (DoT with cascade depth=1)
| Wavelet | Causal | Recovery | NIR | Use case |
|---|---|---|---|---|
| DoG | ✗ | Perfect | ✗ | Offline, symmetric scale-space |
| DoT | ✓ | Perfect | ✓ | Streaming, full causal scale-space |
| DoE | ✓ | Perfect | ✓ | Streaming, cheapest (cascade depth 1) |
| Spiking DoG | ✗ | Quantized | ✗ | Offline neuromorphic encoding |
| Spiking DoT | ✓ | Quantized + delayed | ✓ | SNN streaming, biologically plausible |
| Spiking DoE | ✓ | Quantized + delayed | ✓ | Lightest SNN variant for streaming |
Acknowledgements
Please cite our paper:
@inproceedings{pedersen2026scalecovariant,
title = {Scale-{{Covariant Spiking Wavelets}}},
booktitle = {2026 {{IEEE International Conference}} on {{Acoustics}}, {{Speech}} and {{Signal Processing}} ({{ICASSP}})},
author = {Pedersen, Jens Egholm and Lindeberg, Tony and Gerstoft, Peter},
year = 2026,
month = may,
pages = {20347--20351},
issn = {2379-190X},
doi = {10.1109/ICASSP55912.2026.11463688},
urldate = {2026-05-10},
}
Metadata
Release files for swavelet 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swavelet-0.2.tar.gz | 269.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swavelet-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 314.2 kB
Release files / swavelet-0.2.tar.gz
| Download URL | swavelet-0.2.tar.gz |
|---|---|
| Size | 269.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2f3cc2ada0a38852d2d7bda4845502f7aaaff5b8e0f201d074c447da615578c
|
|
BLAKE2b-256 checksum How to use checksums |
a6540c5bb24086d60cda492badf55ea35f379ffc84d65e7c03c35cb8d9a58696
|
| 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 Sep 8, 2026.
Transparency logRelease files / swavelet-0.2-py3-none-any.whl
| Download URL | swavelet-0.2-py3-none-any.whl |
|---|---|
| Size | 45.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a73d577906c4b656f0e8523a4d1787f1a906d496689dbec8e1903d8d3cd25768
|
|
BLAKE2b-256 checksum How to use checksums |
383a2f5048deb618a9b07b29ae67d437799e80ef2ebf0cc614534e6dba28c03c
|
| 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 Sep 8, 2026.
Transparency log