Veils
Veils is a Rust implementation of the one-dimensional, real-valued subset of
scipy.signal.ShortTimeFFT.
Its coefficients and reconstruction are tested directly against SciPy 1.18.1.
Supported Compatibility
- Real
f64signals and windows onesided,twosided,centered, and magnitude-scaledonesided2XFFTs- Configurable hop size, sampling frequency, FFT length, dual window, phase shift, STFT slice range, and reconstruction range
- Zero padding at signal boundaries
- Frequency-by-time STFT output and canonical dual-window reconstruction
Veils does not currently implement multidimensional axes, complex-valued
signals/windows, SciPy's detrending API, non-zero padding modes, or a general
magnitude/PSD scaling API. onesided2X corresponds to magnitude scaling when
the supplied window has already been magnitude-scaled.
Usage
use StandaloneSTFT;
let window: =
.map
.collect;
let signal: =
.map
.collect;
let mut stft = new?;
let coefficients = stft.stft?;
let reconstructed = stft.istft?;
# Ok::
Development
The Python compatibility environment is pinned in requirements.txt. Run the
direct SciPy comparison in Docker with:
Rust checks are available through:
Upstream Provenance
The implementation is adapted from the algorithms in SciPy's
scipy/signal/_short_time_fft.py. Compatibility is currently verified against
the SciPy v1.18.1 release. SciPy is distributed under the BSD 3-Clause
license included in LICENSE-SCIPY; Veils' original code is distributed under
the MIT license included in LICENSE.