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 = \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
GNU Affero General Public License v3.0 (AGPL-3.0-only) — see LICENSE for details.
Metadata
Release files for pyscsa 1.1.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 | Provenance | Actions |
|---|---|---|---|---|
| pyscsa-1.1.2.tar.gz | 1.2 MB | With provenance | Details for pyscsa-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyscsa-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for pyscsa-1.1.2-py3-none-any.whl |
Total release size: 1.2 MB
Release files / pyscsa-1.1.2.tar.gz
| Download URL | pyscsa-1.1.2.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
336e7bff7097e1ea3156b975fc08e60f3f6acc085ddead397d5556725e72e88d
|
|
BLAKE2b-256 checksum How to use checksums |
6aac387cd1906b70cf2b587be8b561ca337a174d6cf12f80d5b10d034757ad3a
|
| 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 15, 2026.
Transparency logRelease files / pyscsa-1.1.2-py3-none-any.whl
| Download URL | pyscsa-1.1.2-py3-none-any.whl |
|---|---|
| Size | 55.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2f1b022f89d0b24c822000243ad156643f7c912f2a386a10d2148d8859e54bf
|
|
BLAKE2b-256 checksum How to use checksums |
41d017723c7edf335502727f82c578514502ee9c91842745fb2ad661500ce009
|
| 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 15, 2026.
Transparency logSecurity for pyscsa 1.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pyscsa-1.1.2.tar.gz
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 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.