PySDKit: signal decomposition in Python

Published in February 26, 2025

A Python library for signal decomposition algorithms 🥳 logo

Github Page | Installation | Example Script | Acknowledgements

Installation 🚀

You can install PySDKit through pip:

pip install pysdkit

We only used NumPy, Scipy and matplotlib when developing the project.

Example Script ✨

This project integrates simple signal processing methods, signal decomposition and visualization, and builds a general interface similar to Scikit-learn. It is mainly divided into three steps:

  1. Import the signal decomposition method;
  2. Create an instance for signal decomposition;
  3. Use the fit_transform method to implement signal decomposition;
  4. Visualize and analyze the original signal and the intrinsic mode functions IMFs obtained by decomposition.
from pysdkit import EMD
from pysdkit.data import test_emd
from pysdkit.plot import plot_IMFs

t, signal = test_emd()

# create an instance for signal decomposition
emd = EMD()
# implement signal decomposition
IMFs = emd.fit_transform(signal, max_imfs=2)
plot_IMFs(signal, IMFs)

example

The EMD in the above example is the most classic empirical mode decomposition algorithm in signal decomposition. For more complex signals, you can try other algorithms such as variational mode decomposition (VMD).

import numpy as np
from pysdkit import VMD

# load new signal
signal = np.load("./example/example.npy")

# use variational mode decomposition
vmd = VMD(alpha=500, K=3, tau=0.0, tol=1e-9)
IMFs = vmd.fit_transform(signal=signal)
print(IMFs.shape)

vmd.plot_IMFs(save_figure=True)

vmd_example

Better observe the characteristics of the decomposed intrinsic mode function in the frequency domain.

from pysdkit.plot import plot_IMFs_amplitude_spectra

# frequency domain visualization
plot_IMFs_amplitude_spectra(IMFs, smooth="exp")   # use exp smooth

frequency_example

Acknowledgements 🎖️

We would like to thank the researchers in signal processing for providing us with valuable algorithms and promoting the continuous progress in this field. However, since the main programming language used in signal processing is Matlab, and Python is the main battlefield of machine learning and deep learning, the usage of signal decomposition in machine learning and deep learning is far less extensive than wavelet transformation. In order to further promote the organic combination of signal decomposition and machine learning, we developed PySDKit. We would like to express our gratitude to PyEMD, Sktime, Scikit-learn, Scikit-Image, statsmodels, vmdpy, MEMD-Python-, ewtpy, EWT-Python, PyLMD, pywt, SP_Liband dsatools.

Recommended citation: Wenxuan Wang. (2025). "PySDKit: signal decomposition in Python" Github.
Download Paper | Download Slides