Spiking wavelets in JAX
Project description
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 using uv: uv sync
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},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swavelet-0.1.0.tar.gz.
File metadata
- Download URL: swavelet-0.1.0.tar.gz
- Upload date:
- Size: 247.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00b34e9c98c67d398edd1e171112fa52cfd2587128f6d71a0e13a2fca360904d
|
|
| MD5 |
4591e67933dd283b4cd88a341df1be0a
|
|
| BLAKE2b-256 |
5677d7f0c62884523b81fd37b69f5cfbfee7c253541d59d05f1d64e1cb807e68
|
Provenance
The following attestation bundles were made for swavelet-0.1.0.tar.gz:
Publisher:
publish.yml on Jegp/swavelet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swavelet-0.1.0.tar.gz -
Subject digest:
00b34e9c98c67d398edd1e171112fa52cfd2587128f6d71a0e13a2fca360904d - Sigstore transparency entry: 1506073925
- Sigstore integration time:
-
Permalink:
Jegp/swavelet@2ea05e52cb0b6df7a5373d26ef939be38b4e30d6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jegp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ea05e52cb0b6df7a5373d26ef939be38b4e30d6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file swavelet-0.1.0-py3-none-any.whl.
File metadata
- Download URL: swavelet-0.1.0-py3-none-any.whl
- Upload date:
- Size: 43.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed1397bce1f0c8d858ec3583c508bfaad4f388d51f99d1b6732b071fcdb81fdf
|
|
| MD5 |
718b60b4dab91c888ee4d48f9f4bf827
|
|
| BLAKE2b-256 |
ee9e51675988e2a17ad3521002421b4b7c269eacca27f4e52dcb807c9fb0e3ef
|
Provenance
The following attestation bundles were made for swavelet-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Jegp/swavelet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swavelet-0.1.0-py3-none-any.whl -
Subject digest:
ed1397bce1f0c8d858ec3583c508bfaad4f388d51f99d1b6732b071fcdb81fdf - Sigstore transparency entry: 1506074005
- Sigstore integration time:
-
Permalink:
Jegp/swavelet@2ea05e52cb0b6df7a5373d26ef939be38b4e30d6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jegp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ea05e52cb0b6df7a5373d26ef939be38b4e30d6 -
Trigger Event:
release
-
Statement type: