PySCSA — Semi-Classical Signal Analysis
A Python library for signal and image processing based on the Semi-Classical Signal Analysis (SCSA) framework.
How It Works
SCSA treats a signal $y(x) \geq 0$ as the potential of a Schrödinger operator $\mathcal{H}_h = -h^2 d^2/dx^2 - y(x)$. Its negative eigenvalues ${-\kappa_n^2}$ and $L^2$-normalized eigenfunctions ${\psi_n}$ encode the signal's structure, and the signal is reconstructed as:
$$y_h(x) = 4h \sum_{n=1}^{N_h} \kappa_n, \psi_n^2(x)$$
The atoms $\phi_n = 4h,\psi_n^2$ are non-negative, spatially localized, and signal-adaptive — their shape is determined by $y$ itself with no fixed dictionary. The parameter $h$ controls resolution: smaller $h$ yields more atoms and finer detail; larger $h$ retains only dominant structures and suppresses noise.
C-SCSA automates the selection of $h$ by minimizing a data-driven cost balancing reconstruction fidelity against the geometric curvature of $y_h$ — a proxy for noise energy (Li & Laleg-Kirati, IET Signal Processing 2021). No knowledge of peak locations or noise level is required.
For the full mathematical treatment see the documentation and references below.
Installation
pip install pyscsa
For development:
git clone https://github.com/boost-inria/pyscsa.git
cd pyscsa
pip install -e .
Quick Start
1D Signal Denoising
from pyscsa import SCSA1D
import numpy as np
x = np.linspace(-10, 10, 500)
signal = -2 / np.cosh(x)**2
noisy = signal + 0.1 * np.random.randn(len(signal))
scsa = SCSA1D(gmma=0.5)
result = scsa.filter_with_c_scsa(noisy)
print(f"Optimal h : {result.optimal_h:.4f}")
print(f"PSNR : {result.metrics['psnr']:.2f} dB")
2D Image Denoising
from pyscsa import SCSA2D
import numpy as np
image = np.random.rand(128, 128)
noisy = image + 0.05 * np.random.randn(*image.shape)
scsa = SCSA2D(gmma=2.0)
denoised = scsa.denoise(noisy, method='windowed', window_size=8, h=5.0)
Features
- 1D & 2D processing — reconstruction and denoising via spectral decomposition of a Schrödinger-type operator
- C-SCSA — automatic bandwidth parameter selection via curvature penalty, no peak localization required
- Windowed mode — memory-efficient processing of large images
- Performance metrics — MSE, RMSE, PSNR, SNR out of the box
- Visualization — built-in plotting utilities via
SCSAVisualizer
API Reference
| Class | Description |
|---|---|
SCSA1D |
1D signal reconstruction and denoising |
SCSA2D |
2D image reconstruction (full and windowed) |
SCSAVisualizer |
Plotting and diagnostic tools |
Full documentation: pyscsa.readthedocs.io
Testing
pytest tests/ -v
pytest tests/ --cov=pyscsa --cov-report=html # with coverage
Citation
@software{pyscsa,
title = {PySCSA: Python Semi-Classical Signal Analysis Library},
author = {A. Guir, I.J.S. Filho, J.M. Vargas and T.M. Laleg},
year = {2025},
url = {https://github.com/boost-inria/pyscsa}
}
@article{li2021cscsa,
title = {Signal denoising based on the Schrödinger operator's eigenspectrum and a curvature constraint},
author = {Li, P. and Laleg-Kirati, T.M.},
journal = {IET Signal Processing},
volume = {15},
pages = {195--206},
year = {2021},
doi = {10.1049/sil2.12023}
}
@misc{lalegkirati2010scsa,
title = {Semi-classical signal analysis},
author = {Laleg-Kirati Taous-Meriem, Crépeau Emmanuelle and Sorine Michel},
year = {2010},
eprint = {1007.0938},
archivePrefix = {arXiv},
primaryClass = {math-ph}
}
License
Inria License — see LICENSE for details.
Metadata
Release files for pyscsa 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyscsa-1.1.1.tar.gz | 1.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyscsa-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / pyscsa-1.1.1.tar.gz
| Download URL | pyscsa-1.1.1.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00886a67fb4d442c4d736a4f34c208afaae66d8d375742f5326f8a8a4b0f024e
|
|
BLAKE2b-256 checksum How to use checksums |
a0b454ca7871a9222cee468f2dcf741770b36bba3df5a689847a9c3fb2661af2
|
| 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 4, 2026.
Transparency logRelease files / pyscsa-1.1.1-py3-none-any.whl
| Download URL | pyscsa-1.1.1-py3-none-any.whl |
|---|---|
| Size | 55.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06d5091e4d68a1f2bb9dc1d4c9de04f5b9589459d8c92dddeb92157e0feb9bdf
|
|
BLAKE2b-256 checksum How to use checksums |
e263d61a3d6df231a699148fb20598b1f6c5d3b1b2cc9d5eeeda4c73a62178a8
|
| 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 4, 2026.
Transparency log