Skip to content

PySDKit 0.4.54

Choose a tag to compare

@wwhenxuan wwhenxuan released this 21 Aug 12:14
· 28 commits to main since this release

Highlights

This release adds a time–frequency analysis path and a fault-detection utility:

  • Synchrosqueezing Transform (SST) (Daubechies, Lu & Wu, 2011; multivariate companion of Ahrabian, Looney, Stanković & Mandic, Signal Processing 2015). SST reassigns each CWT coefficient from its scale to the instantaneous frequency estimated from the phase, so AM–FM oscillations collapse onto thin ridges. Unlike classical reassignment it is approximately invertible: summing coefficients in a frequency band recovers that oscillation — an EMD-like reconstruction with a wavelet theory behind it. One class also covers joint multivariate TFR, multivariate denoising (IEEE TSP 2015) and selective SST (IEEE SPL 2015).
  • Fast Kurtogram (Antoni, MSSP 2007). Spectral kurtosis of a band-pass envelope is most sensitive to transients in a specific ((f_c, \Delta f)) dyad. Exhaustive STFT scanning is (O(N^2)); Antoni’s 1/2-binary + 1/3-ternary analytic FIR tree samples that plane in (O(N \log N)). The MATLAB driver always plots and blocks on input(); the Python port is non-interactive.

Also on PyPI as 0.4.54: pip install -U PySDKit.

What's new

  • SST (pysdkit._tfa.sst)
    • transform — univariate linear SST, or the joint multivariate TFR
    • fit_transform / __call__ — invert SST over adaptive bandwidth tiles; last IMF is the residual. Univariate (K, T), multivariate (K, T, C)
    • denoise — multivariate SST thresholding (TSP 2015)
    • selective_transform — reassign only signal-like CWT coefficients (SPL 2015)
    • CWT: bump (default) or Morlet; n_voices matches MATLAB nv (default 32)
    • Unit tests: pysdkit/tests/test_sst.py
  • Fast Kurtogram (pysdkit.utils._kurtogram)
    • fast_kurtogram(x, nlevel, fs) returns (Kwav, info) with Kmax, level, fc, bw
    • find_wav_kurt extracts the complex envelope at a kurtogram dyad (no prompts)
    • prewhiten_ar — optional AR inverse-filter whitening used in the MATLAB demo
    • Pack Kurtogram V4 x.mat peak sits in the theoretical band [0.15, 0.19] (nlevel=7, Fs=1)
    • Unit tests: pysdkit/tests/test_kurtogram.py
    • Example notebook: examples/utils/fast_kurtogram.ipynb
  • Packaged demo data (pysdkit.data)
    • load_sst_float() — bivariate float-drift record (2, 1116) from Ahrabian et al.
    • load_sst_doppler() — bivariate Doppler-radar record (2, 2127)
    • load_fast_kurtogram_x() — Antoni demo with hidden repetitive transients (Fs = 1)
  • README
    • Target table row for SST with paper, source, and notebook links
  • Misc
    • Example data-generator notebook moved under examples/utils/

Quick start

from pysdkit import SST
from pysdkit.data import load_sst_float, load_fast_kurtogram_x
from pysdkit.utils import fast_kurtogram, find_wav_kurt

# SST: univariate (T,) or multivariate (C, T) -> IMFs
float_sig = load_sst_float()["signal"]          # (2, 1116)
imfs = SST(wavelet="bump")(float_sig)           # (K, 1116, 2)

# Fast kurtogram: map + peak band, then optional envelope
demo = load_fast_kurtogram_x()
Kwav, info = fast_kurtogram(demo["signal"], nlevel=7, fs=1.0)
env = find_wav_kurt(info["x"], info["level"], info["fc"] / info["fs"], fs=1.0)

Notes

  • Public imports: from pysdkit import SST, sst and from pysdkit.utils import fast_kurtogram.
  • SST is TFA / reassignment, not sifting. fit_transform still follows the usual fit_transform / __call__ IMF layout (last row / slice is the residual).
  • Fast kurtogram is a utility, not a decomposer: it locates the most impulsive band; filtering is an explicit second call to find_wav_kurt.
  • nlevel must satisfy nlevel <= log2(N) - 7 (same guard as MATLAB).

Install

pip install -U PySDKit

Full Changelog: 0.4.53...0.4.54