PySDKit 0.4.26__tar.gz → 0.4.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pysdkit-0.4.26 → pysdkit-0.4.28}/PKG-INFO +8 -6
- {pysdkit-0.4.26 → pysdkit-0.4.28}/PySDKit.egg-info/PKG-INFO +8 -6
- {pysdkit-0.4.26 → pysdkit-0.4.28}/PySDKit.egg-info/SOURCES.txt +11 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/README.md +7 -5
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pyproject.toml +3 -1
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/__init__.py +17 -1
- pysdkit-0.4.28/pysdkit/_alif/__init__.py +6 -0
- pysdkit-0.4.28/pysdkit/_alif/alif.py +191 -0
- pysdkit-0.4.28/pysdkit/_alif/data/__init__.py +1 -0
- pysdkit-0.4.28/pysdkit/_alif/data/prefixed_double_filter.npy +0 -0
- pysdkit-0.4.28/pysdkit/_alif/iterative_filtering.py +405 -0
- pysdkit-0.4.28/pysdkit/_apmd/__init__.py +7 -0
- pysdkit-0.4.28/pysdkit/_apmd/apmd.py +829 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/__init__.py +2 -0
- pysdkit-0.4.28/pysdkit/_vmd/ovmd.py +244 -0
- pysdkit-0.4.28/pysdkit/tests/test_alif.py +106 -0
- pysdkit-0.4.28/pysdkit/tests/test_apmd.py +124 -0
- pysdkit-0.4.28/pysdkit/tests/test_ovmd.py +100 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/LICENSE +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/PySDKit.egg-info/dependency_links.txt +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/PySDKit.egg-info/requires.txt +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/PySDKit.egg-info/top_level.txt +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/_find_extrema.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/_prepare_points.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/_splines.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/ceemdan.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/eemd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/efd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/emd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/hht/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/hht/frequency.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/hht/hht.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/memd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/remd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd/tvf_emd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd2d/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd2d/bemd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd2d/bmemd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_emd2d/emd2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_esmd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_esmd/esmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_ewt/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_ewt/ewt.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_ewt/ewt2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_faemd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_faemd/extrema.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_faemd/faemd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_faemd/faemd2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_faemd/faemd3d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_faemd/filter.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_fmd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_fmd/fmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_fmd/nfmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_hvd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_hvd/hvd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_ifd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_itd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_itd/itd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_jmd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_jmd/jmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_jmd/mjmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_lmd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_lmd/lmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_lmd/rlmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_osd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_ssa/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_ssa/ssa.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/acmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/avmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/ba_acmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/base.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/mvmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/svmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/vmd_c.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/vmd_f.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd/vme.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd2d/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd2d/cvmd2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vmd2d/vmd2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vncmd/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vncmd/avncmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vncmd/incmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vncmd/mncmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/_vncmd/vncmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_add_noise.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_cube.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_generator.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_image.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_models.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_test_univariate.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/_time_series.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/data/texture.txt +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/entropy/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/entropy/_approxiamte_entropy.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/entropy/_permutation_entropy.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/entropy/_sample_entropy.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/models/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/models/_base.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/models/_kmeans.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/models/_knn.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/models/_pca.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/plot/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/plot/_fourier_spectra.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/plot/_functions.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/plot/_plot_images.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/plot/_plot_imfs.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/plot/_plot_signal.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/data/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/data/test_generator_cube.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/data/test_generator_image.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/data/test_generator_signal.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/data/test_generator_univariate_signal.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/models/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/models/test_knn.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/models/test_pca.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/run_all.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_avncmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_ceemdan.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_emd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_ewt.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_faemd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_faemd2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_faemd3d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_itd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_lmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_moving_decomp.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_rlmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_stl.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_vmd.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tests/test_vmd2d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tsa/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tsa/_dtw.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tsa/_moving_decomp.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tsa/_mstl.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/tsa/_stl.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/__init__.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_cite.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_correlation.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_diagnalization.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_differ.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_fft.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_function.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_hilbert.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_instantaneous.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_kernel_matrix.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_mirror.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_process.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/pysdkit/utils/_smooth1d.py +0 -0
- {pysdkit-0.4.26 → pysdkit-0.4.28}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PySDKit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.28
|
|
4
4
|
Summary: A Python library for signal decomposition algorithms with a unified interface.
|
|
5
5
|
Author: josefinez, Deeksha Manjunath, Yuan Feng, JacktheFowler
|
|
6
6
|
Author-email: Whenxuan Wang <wwhenxuan@gmail.com>, RuiZhe Wang <3133986068@qq.com>, WenTong Zhao <23049200290@stu.xidian.edu.cn>
|
|
@@ -139,7 +139,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
139
139
|
|
|
140
140
|
## Target 🎯 <a id="Target"></a>
|
|
141
141
|
|
|
142
|
-
`PySDKit` is still under development. We are currently working on reproducing the signal decomposition algorithms in the table below, including not only common decomposition algorithms for `univariate signals` such as EMD and
|
|
142
|
+
`PySDKit` is still under development. We are currently working on reproducing the signal decomposition algorithms in the table below, including not only common decomposition algorithms for `univariate signals` such as EMD, VMD, OVMD, AVNCMD, ALIF and APMD, but also decomposition algorithms for `multivariate signals` such as MEMD and MVMD. We will also further reproduce the decomposition algorithms for `two-dimensional images` to make PySDKit not only suitable for signal processing, but also for image analysis and understanding. See [`Mission`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/README.md) for the reasons why we developed PySDKit.
|
|
143
143
|
|
|
144
144
|
| Algorithm | Paper | Code | State |
|
|
145
145
|
|:---------------------------------------------------------------------------------------------------------------------------------------------:| :----------------------------------------------------------: | :----------------------------------------------------------: |:--------:|
|
|
@@ -159,10 +159,11 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
159
159
|
| [`FAEMD3D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_faemd/faemd3d.py) (Three-Dimensional Fast and Adaptive EMD) | [[paper]](https://ieeexplore.ieee.org/document/8447300) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/71270-fast-and-adaptive-multivariate-and-multidimensional-emd) | ✖️ |
|
|
160
160
|
| [`HVD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_hvd/hvd.py) (Hilbert Vibration Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X06001556) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/178804-hilbert-vibration-decomposition?s_tid=FX_rc1_behav) | ✔️ |
|
|
161
161
|
| [`ITD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_itd/itd.py) (Intrinsic Time-Scale Decomposition) | [[paper]](https://royalsocietypublishing.org/doi/10.1098/rspa.2006.1761) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/69380-intrinsic-time-scale-decomposition-itd) | ✔️ |
|
|
162
|
-
|
|
|
162
|
+
| [`ALIF`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_alif/alif.py) (Adaptive Local Iterative Filtering) | [[paper]](https://arxiv.org/abs/1411.6051) | [[code]](https://github.com/Cicone/ALIF) | ✔️ |
|
|
163
|
+
| [`APMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_apmd/apmd.py) (Adaptive Polymorphic Mode Decomposition) | [[paper]](https://doi.org/10.1016/j.dsp.2024.104913) | [[code]](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_apmd/apmd.py) | ✔️ |
|
|
163
164
|
| [`LMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_lmd/lmd.py) (Local Mean Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S1051200418308133?via%3Dihub) | [[code]](https://github.com/shownlin/PyLMD/blob/master/PyLMD/LMD.py) | ✔️ |
|
|
164
165
|
| [`RLMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_lmd/rlmd.py) (Robust Local Mean Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0888327017301619) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/66935-robust-local-mean-decomposition-rlmd) | ✔️ |
|
|
165
|
-
| [`FMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/fmd.py) (Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/108099-feature-mode-decomposition-fmd) |
|
|
166
|
+
| [`FMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/fmd.py) (Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/108099-feature-mode-decomposition-fmd) | ✔️ |
|
|
166
167
|
| [`NFMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/nfmd.py) (Non-stationary Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://github.com/sheadan/NFMD-ExtractionInstantaneous/blob/master/nfmd/NFMD.py) | ✖️ |
|
|
167
168
|
| [`SSA`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_ssa/ssa.py) (Singular Spectral Analysis) | [[paper]](https://orca.cardiff.ac.uk/id/eprint/15208/1/Zhiglavsky_SSA_encyclopedia.pdf) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/58967-singular-spectrum-analysis-beginners-guide) | ✔️ |
|
|
168
169
|
| [`EWT`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_ewt/ewt.py) (Empirical Wavelet Transform) | [[paper]](https://ieeexplore.ieee.org/document/6522142) | [[code]](https://www.mathworks.com/help/wavelet/ug/empirical-wavelet-transform.html) | ✔️ |
|
|
@@ -172,18 +173,19 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
172
173
|
| [`VMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd2d/vmd2d.py) (Two-Dimensional Variational Mode Decomposition) | [[paper]](https://ww3.math.ucla.edu/camreport/cam14-16.pdf) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/45918-two-dimensional-variational-mode-decomposition?s_tid=srchtitle) | ✔️ |
|
|
173
174
|
| [`CVMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd2d/cvmd2d.py) (Two-Dimensional Compact Variational Mode Decomposition) | [[paper]](https://link.springer.com/article/10.1007/s10851-017-0710-z) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/67285-two-dimensional-compact-variational-mode-decomposition-2d-tv-vmd?s_tid=FX_rc2_behav) | ✔️ |
|
|
174
175
|
| [`VME`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/vme.py) (Variational Mode Extraction) | [[paper]](https://ieeexplore.ieee.org/document/7997854) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/76003-variational-mode-extraction-vme-m?s_tid=srchtitle) | ✔️ |
|
|
176
|
+
| [`OVMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ovmd.py) (Orthogonalized Variational Mode Decomposition) | [[paper]](https://doi.org/10.1016/j.sigpro.2025.110251) | [[code]](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ovmd.py) | ✔️ |
|
|
175
177
|
| [`SVMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/svmd.py) (Successive Variational Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168420301535) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/98649-successive-variational-mode-decomposition-svmd-m?s_tid=FX_rc3_behav) | ✖️ |
|
|
176
178
|
| [`VNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/vncmd.py) (Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/7990179) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/64292-variational-nonlinear-chirp-mode-decomposition) | ✔️ |
|
|
177
179
|
| [`INCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/incmd.py) (Iterative Nonlinear Chirp Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X2030403X?via%3Dihub) | [[code]](https://github.com/sheadan/IterativeNCMD) | ✔️ |
|
|
178
180
|
| [`MNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/mncmd.py) (Multivariate Nonlinear Chirp Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0165168420302103) | [[code]]() | ✖️ |
|
|
179
|
-
| [`AVNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/avncmd.py) (Adaptive Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/9746147) | [[code]](https://github.com/HauLiang/AVNCMD) |
|
|
181
|
+
| [`AVNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/avncmd.py) (Adaptive Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/9746147) | [[code]](https://github.com/HauLiang/AVNCMD) | ✔️ |
|
|
180
182
|
| [`ACMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/acmd.py) (Adaptive Chirp Mode Decomposition) | [[paper]]() | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/121373-data-driven-adaptive-chirp-mode-decomposition?s_tid=srchtitle) | ✔️ |
|
|
181
183
|
| [`BA-ACMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ba_acmd.py) (Bandwidth-aware adaptive chirp mode decomposition) | [[paper]](https://journals.sagepub.com/doi/abs/10.1177/14759217231174699) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/132792-bandwidth-aware-adaptive-chirp-mode-decomposition-ba-acmd?s_tid=srchtitle) | ✖️ |
|
|
182
184
|
| [`JMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_jmd/jmd.py) (Jump Plus AM-FM Mode Decomposition) | [[paper]](https://arxiv.org/abs/2407.07800) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/169388-jump-plus-am-fm-mode-decomposition-jmd?s_tid=prof_contriblnk) | ️✔️ |
|
|
183
185
|
| [`MJMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_jmd/mjmd.py) (Multivariate Jump Plus AM-FM Mode Decomposition) | [[paper]](https://arxiv.org/abs/2407.07800) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/169393-multivariate-jump-plus-am-fm-mode-decomposition-mjmd?s_tid=prof_contriblnk) | ✖️ |
|
|
184
186
|
| [`ESMD`]() (Extreme-Point Symmetric Mode Decomposition) | [[paper]](https://arxiv.org/abs/1303.6540) | [[code]](https://github.com/WuShichao/esmd) | ✖️ |
|
|
185
187
|
| [`STNBMD`]() (Short-Time Narrow-Band Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X16002443?via%3Dihub) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/56226-short-time-narrow-band-mode-decomposition-stnbmd-toolbox) | ✖️ |
|
|
186
|
-
|
|
|
188
|
+
| [`STL`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tsa/_stl.py) (Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/stl_decomposition.html) | ✔️ |
|
|
187
189
|
| [`MSTL`]() (Multivariate Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/mstl_decomposition.html) | ✖️ |
|
|
188
190
|
|
|
189
191
|
## Acknowledgements 🎖️ <a id="Acknowledgements"></a>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PySDKit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.28
|
|
4
4
|
Summary: A Python library for signal decomposition algorithms with a unified interface.
|
|
5
5
|
Author: josefinez, Deeksha Manjunath, Yuan Feng, JacktheFowler
|
|
6
6
|
Author-email: Whenxuan Wang <wwhenxuan@gmail.com>, RuiZhe Wang <3133986068@qq.com>, WenTong Zhao <23049200290@stu.xidian.edu.cn>
|
|
@@ -139,7 +139,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
139
139
|
|
|
140
140
|
## Target 🎯 <a id="Target"></a>
|
|
141
141
|
|
|
142
|
-
`PySDKit` is still under development. We are currently working on reproducing the signal decomposition algorithms in the table below, including not only common decomposition algorithms for `univariate signals` such as EMD and
|
|
142
|
+
`PySDKit` is still under development. We are currently working on reproducing the signal decomposition algorithms in the table below, including not only common decomposition algorithms for `univariate signals` such as EMD, VMD, OVMD, AVNCMD, ALIF and APMD, but also decomposition algorithms for `multivariate signals` such as MEMD and MVMD. We will also further reproduce the decomposition algorithms for `two-dimensional images` to make PySDKit not only suitable for signal processing, but also for image analysis and understanding. See [`Mission`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/README.md) for the reasons why we developed PySDKit.
|
|
143
143
|
|
|
144
144
|
| Algorithm | Paper | Code | State |
|
|
145
145
|
|:---------------------------------------------------------------------------------------------------------------------------------------------:| :----------------------------------------------------------: | :----------------------------------------------------------: |:--------:|
|
|
@@ -159,10 +159,11 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
159
159
|
| [`FAEMD3D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_faemd/faemd3d.py) (Three-Dimensional Fast and Adaptive EMD) | [[paper]](https://ieeexplore.ieee.org/document/8447300) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/71270-fast-and-adaptive-multivariate-and-multidimensional-emd) | ✖️ |
|
|
160
160
|
| [`HVD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_hvd/hvd.py) (Hilbert Vibration Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X06001556) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/178804-hilbert-vibration-decomposition?s_tid=FX_rc1_behav) | ✔️ |
|
|
161
161
|
| [`ITD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_itd/itd.py) (Intrinsic Time-Scale Decomposition) | [[paper]](https://royalsocietypublishing.org/doi/10.1098/rspa.2006.1761) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/69380-intrinsic-time-scale-decomposition-itd) | ✔️ |
|
|
162
|
-
|
|
|
162
|
+
| [`ALIF`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_alif/alif.py) (Adaptive Local Iterative Filtering) | [[paper]](https://arxiv.org/abs/1411.6051) | [[code]](https://github.com/Cicone/ALIF) | ✔️ |
|
|
163
|
+
| [`APMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_apmd/apmd.py) (Adaptive Polymorphic Mode Decomposition) | [[paper]](https://doi.org/10.1016/j.dsp.2024.104913) | [[code]](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_apmd/apmd.py) | ✔️ |
|
|
163
164
|
| [`LMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_lmd/lmd.py) (Local Mean Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S1051200418308133?via%3Dihub) | [[code]](https://github.com/shownlin/PyLMD/blob/master/PyLMD/LMD.py) | ✔️ |
|
|
164
165
|
| [`RLMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_lmd/rlmd.py) (Robust Local Mean Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0888327017301619) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/66935-robust-local-mean-decomposition-rlmd) | ✔️ |
|
|
165
|
-
| [`FMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/fmd.py) (Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/108099-feature-mode-decomposition-fmd) |
|
|
166
|
+
| [`FMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/fmd.py) (Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/108099-feature-mode-decomposition-fmd) | ✔️ |
|
|
166
167
|
| [`NFMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/nfmd.py) (Non-stationary Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://github.com/sheadan/NFMD-ExtractionInstantaneous/blob/master/nfmd/NFMD.py) | ✖️ |
|
|
167
168
|
| [`SSA`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_ssa/ssa.py) (Singular Spectral Analysis) | [[paper]](https://orca.cardiff.ac.uk/id/eprint/15208/1/Zhiglavsky_SSA_encyclopedia.pdf) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/58967-singular-spectrum-analysis-beginners-guide) | ✔️ |
|
|
168
169
|
| [`EWT`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_ewt/ewt.py) (Empirical Wavelet Transform) | [[paper]](https://ieeexplore.ieee.org/document/6522142) | [[code]](https://www.mathworks.com/help/wavelet/ug/empirical-wavelet-transform.html) | ✔️ |
|
|
@@ -172,18 +173,19 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
172
173
|
| [`VMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd2d/vmd2d.py) (Two-Dimensional Variational Mode Decomposition) | [[paper]](https://ww3.math.ucla.edu/camreport/cam14-16.pdf) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/45918-two-dimensional-variational-mode-decomposition?s_tid=srchtitle) | ✔️ |
|
|
173
174
|
| [`CVMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd2d/cvmd2d.py) (Two-Dimensional Compact Variational Mode Decomposition) | [[paper]](https://link.springer.com/article/10.1007/s10851-017-0710-z) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/67285-two-dimensional-compact-variational-mode-decomposition-2d-tv-vmd?s_tid=FX_rc2_behav) | ✔️ |
|
|
174
175
|
| [`VME`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/vme.py) (Variational Mode Extraction) | [[paper]](https://ieeexplore.ieee.org/document/7997854) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/76003-variational-mode-extraction-vme-m?s_tid=srchtitle) | ✔️ |
|
|
176
|
+
| [`OVMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ovmd.py) (Orthogonalized Variational Mode Decomposition) | [[paper]](https://doi.org/10.1016/j.sigpro.2025.110251) | [[code]](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ovmd.py) | ✔️ |
|
|
175
177
|
| [`SVMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/svmd.py) (Successive Variational Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168420301535) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/98649-successive-variational-mode-decomposition-svmd-m?s_tid=FX_rc3_behav) | ✖️ |
|
|
176
178
|
| [`VNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/vncmd.py) (Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/7990179) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/64292-variational-nonlinear-chirp-mode-decomposition) | ✔️ |
|
|
177
179
|
| [`INCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/incmd.py) (Iterative Nonlinear Chirp Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X2030403X?via%3Dihub) | [[code]](https://github.com/sheadan/IterativeNCMD) | ✔️ |
|
|
178
180
|
| [`MNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/mncmd.py) (Multivariate Nonlinear Chirp Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0165168420302103) | [[code]]() | ✖️ |
|
|
179
|
-
| [`AVNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/avncmd.py) (Adaptive Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/9746147) | [[code]](https://github.com/HauLiang/AVNCMD) |
|
|
181
|
+
| [`AVNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/avncmd.py) (Adaptive Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/9746147) | [[code]](https://github.com/HauLiang/AVNCMD) | ✔️ |
|
|
180
182
|
| [`ACMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/acmd.py) (Adaptive Chirp Mode Decomposition) | [[paper]]() | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/121373-data-driven-adaptive-chirp-mode-decomposition?s_tid=srchtitle) | ✔️ |
|
|
181
183
|
| [`BA-ACMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ba_acmd.py) (Bandwidth-aware adaptive chirp mode decomposition) | [[paper]](https://journals.sagepub.com/doi/abs/10.1177/14759217231174699) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/132792-bandwidth-aware-adaptive-chirp-mode-decomposition-ba-acmd?s_tid=srchtitle) | ✖️ |
|
|
182
184
|
| [`JMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_jmd/jmd.py) (Jump Plus AM-FM Mode Decomposition) | [[paper]](https://arxiv.org/abs/2407.07800) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/169388-jump-plus-am-fm-mode-decomposition-jmd?s_tid=prof_contriblnk) | ️✔️ |
|
|
183
185
|
| [`MJMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_jmd/mjmd.py) (Multivariate Jump Plus AM-FM Mode Decomposition) | [[paper]](https://arxiv.org/abs/2407.07800) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/169393-multivariate-jump-plus-am-fm-mode-decomposition-mjmd?s_tid=prof_contriblnk) | ✖️ |
|
|
184
186
|
| [`ESMD`]() (Extreme-Point Symmetric Mode Decomposition) | [[paper]](https://arxiv.org/abs/1303.6540) | [[code]](https://github.com/WuShichao/esmd) | ✖️ |
|
|
185
187
|
| [`STNBMD`]() (Short-Time Narrow-Band Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X16002443?via%3Dihub) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/56226-short-time-narrow-band-mode-decomposition-stnbmd-toolbox) | ✖️ |
|
|
186
|
-
|
|
|
188
|
+
| [`STL`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tsa/_stl.py) (Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/stl_decomposition.html) | ✔️ |
|
|
187
189
|
| [`MSTL`]() (Multivariate Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/mstl_decomposition.html) | ✖️ |
|
|
188
190
|
|
|
189
191
|
## Acknowledgements 🎖️ <a id="Acknowledgements"></a>
|
|
@@ -7,6 +7,13 @@ PySDKit.egg-info/dependency_links.txt
|
|
|
7
7
|
PySDKit.egg-info/requires.txt
|
|
8
8
|
PySDKit.egg-info/top_level.txt
|
|
9
9
|
pysdkit/__init__.py
|
|
10
|
+
pysdkit/_alif/__init__.py
|
|
11
|
+
pysdkit/_alif/alif.py
|
|
12
|
+
pysdkit/_alif/iterative_filtering.py
|
|
13
|
+
pysdkit/_alif/data/__init__.py
|
|
14
|
+
pysdkit/_alif/data/prefixed_double_filter.npy
|
|
15
|
+
pysdkit/_apmd/__init__.py
|
|
16
|
+
pysdkit/_apmd/apmd.py
|
|
10
17
|
pysdkit/_emd/__init__.py
|
|
11
18
|
pysdkit/_emd/_find_extrema.py
|
|
12
19
|
pysdkit/_emd/_prepare_points.py
|
|
@@ -59,6 +66,7 @@ pysdkit/_vmd/avmd.py
|
|
|
59
66
|
pysdkit/_vmd/ba_acmd.py
|
|
60
67
|
pysdkit/_vmd/base.py
|
|
61
68
|
pysdkit/_vmd/mvmd.py
|
|
69
|
+
pysdkit/_vmd/ovmd.py
|
|
62
70
|
pysdkit/_vmd/svmd.py
|
|
63
71
|
pysdkit/_vmd/vmd_c.py
|
|
64
72
|
pysdkit/_vmd/vmd_f.py
|
|
@@ -97,6 +105,8 @@ pysdkit/plot/_plot_imfs.py
|
|
|
97
105
|
pysdkit/plot/_plot_signal.py
|
|
98
106
|
pysdkit/tests/__init__.py
|
|
99
107
|
pysdkit/tests/run_all.py
|
|
108
|
+
pysdkit/tests/test_alif.py
|
|
109
|
+
pysdkit/tests/test_apmd.py
|
|
100
110
|
pysdkit/tests/test_avncmd.py
|
|
101
111
|
pysdkit/tests/test_ceemdan.py
|
|
102
112
|
pysdkit/tests/test_emd.py
|
|
@@ -107,6 +117,7 @@ pysdkit/tests/test_faemd3d.py
|
|
|
107
117
|
pysdkit/tests/test_itd.py
|
|
108
118
|
pysdkit/tests/test_lmd.py
|
|
109
119
|
pysdkit/tests/test_moving_decomp.py
|
|
120
|
+
pysdkit/tests/test_ovmd.py
|
|
110
121
|
pysdkit/tests/test_rlmd.py
|
|
111
122
|
pysdkit/tests/test_stl.py
|
|
112
123
|
pysdkit/tests/test_vmd.py
|
|
@@ -85,7 +85,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
85
85
|
|
|
86
86
|
## Target 🎯 <a id="Target"></a>
|
|
87
87
|
|
|
88
|
-
`PySDKit` is still under development. We are currently working on reproducing the signal decomposition algorithms in the table below, including not only common decomposition algorithms for `univariate signals` such as EMD and
|
|
88
|
+
`PySDKit` is still under development. We are currently working on reproducing the signal decomposition algorithms in the table below, including not only common decomposition algorithms for `univariate signals` such as EMD, VMD, OVMD, AVNCMD, ALIF and APMD, but also decomposition algorithms for `multivariate signals` such as MEMD and MVMD. We will also further reproduce the decomposition algorithms for `two-dimensional images` to make PySDKit not only suitable for signal processing, but also for image analysis and understanding. See [`Mission`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/README.md) for the reasons why we developed PySDKit.
|
|
89
89
|
|
|
90
90
|
| Algorithm | Paper | Code | State |
|
|
91
91
|
|:---------------------------------------------------------------------------------------------------------------------------------------------:| :----------------------------------------------------------: | :----------------------------------------------------------: |:--------:|
|
|
@@ -105,10 +105,11 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
105
105
|
| [`FAEMD3D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_faemd/faemd3d.py) (Three-Dimensional Fast and Adaptive EMD) | [[paper]](https://ieeexplore.ieee.org/document/8447300) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/71270-fast-and-adaptive-multivariate-and-multidimensional-emd) | ✖️ |
|
|
106
106
|
| [`HVD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_hvd/hvd.py) (Hilbert Vibration Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X06001556) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/178804-hilbert-vibration-decomposition?s_tid=FX_rc1_behav) | ✔️ |
|
|
107
107
|
| [`ITD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_itd/itd.py) (Intrinsic Time-Scale Decomposition) | [[paper]](https://royalsocietypublishing.org/doi/10.1098/rspa.2006.1761) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/69380-intrinsic-time-scale-decomposition-itd) | ✔️ |
|
|
108
|
-
|
|
|
108
|
+
| [`ALIF`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_alif/alif.py) (Adaptive Local Iterative Filtering) | [[paper]](https://arxiv.org/abs/1411.6051) | [[code]](https://github.com/Cicone/ALIF) | ✔️ |
|
|
109
|
+
| [`APMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_apmd/apmd.py) (Adaptive Polymorphic Mode Decomposition) | [[paper]](https://doi.org/10.1016/j.dsp.2024.104913) | [[code]](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_apmd/apmd.py) | ✔️ |
|
|
109
110
|
| [`LMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_lmd/lmd.py) (Local Mean Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S1051200418308133?via%3Dihub) | [[code]](https://github.com/shownlin/PyLMD/blob/master/PyLMD/LMD.py) | ✔️ |
|
|
110
111
|
| [`RLMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_lmd/rlmd.py) (Robust Local Mean Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0888327017301619) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/66935-robust-local-mean-decomposition-rlmd) | ✔️ |
|
|
111
|
-
| [`FMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/fmd.py) (Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/108099-feature-mode-decomposition-fmd) |
|
|
112
|
+
| [`FMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/fmd.py) (Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/108099-feature-mode-decomposition-fmd) | ✔️ |
|
|
112
113
|
| [`NFMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_fmd/nfmd.py) (Non-stationary Feature Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/9732251) | [[code]](https://github.com/sheadan/NFMD-ExtractionInstantaneous/blob/master/nfmd/NFMD.py) | ✖️ |
|
|
113
114
|
| [`SSA`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_ssa/ssa.py) (Singular Spectral Analysis) | [[paper]](https://orca.cardiff.ac.uk/id/eprint/15208/1/Zhiglavsky_SSA_encyclopedia.pdf) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/58967-singular-spectrum-analysis-beginners-guide) | ✔️ |
|
|
114
115
|
| [`EWT`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_ewt/ewt.py) (Empirical Wavelet Transform) | [[paper]](https://ieeexplore.ieee.org/document/6522142) | [[code]](https://www.mathworks.com/help/wavelet/ug/empirical-wavelet-transform.html) | ✔️ |
|
|
@@ -118,18 +119,19 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
|
|
|
118
119
|
| [`VMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd2d/vmd2d.py) (Two-Dimensional Variational Mode Decomposition) | [[paper]](https://ww3.math.ucla.edu/camreport/cam14-16.pdf) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/45918-two-dimensional-variational-mode-decomposition?s_tid=srchtitle) | ✔️ |
|
|
119
120
|
| [`CVMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd2d/cvmd2d.py) (Two-Dimensional Compact Variational Mode Decomposition) | [[paper]](https://link.springer.com/article/10.1007/s10851-017-0710-z) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/67285-two-dimensional-compact-variational-mode-decomposition-2d-tv-vmd?s_tid=FX_rc2_behav) | ✔️ |
|
|
120
121
|
| [`VME`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/vme.py) (Variational Mode Extraction) | [[paper]](https://ieeexplore.ieee.org/document/7997854) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/76003-variational-mode-extraction-vme-m?s_tid=srchtitle) | ✔️ |
|
|
122
|
+
| [`OVMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ovmd.py) (Orthogonalized Variational Mode Decomposition) | [[paper]](https://doi.org/10.1016/j.sigpro.2025.110251) | [[code]](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ovmd.py) | ✔️ |
|
|
121
123
|
| [`SVMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/svmd.py) (Successive Variational Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168420301535) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/98649-successive-variational-mode-decomposition-svmd-m?s_tid=FX_rc3_behav) | ✖️ |
|
|
122
124
|
| [`VNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/vncmd.py) (Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/7990179) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/64292-variational-nonlinear-chirp-mode-decomposition) | ✔️ |
|
|
123
125
|
| [`INCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/incmd.py) (Iterative Nonlinear Chirp Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X2030403X?via%3Dihub) | [[code]](https://github.com/sheadan/IterativeNCMD) | ✔️ |
|
|
124
126
|
| [`MNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/mncmd.py) (Multivariate Nonlinear Chirp Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0165168420302103) | [[code]]() | ✖️ |
|
|
125
|
-
| [`AVNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/avncmd.py) (Adaptive Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/9746147) | [[code]](https://github.com/HauLiang/AVNCMD) |
|
|
127
|
+
| [`AVNCMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/avncmd.py) (Adaptive Variational Nonlinear Chirp Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/9746147) | [[code]](https://github.com/HauLiang/AVNCMD) | ✔️ |
|
|
126
128
|
| [`ACMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/acmd.py) (Adaptive Chirp Mode Decomposition) | [[paper]]() | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/121373-data-driven-adaptive-chirp-mode-decomposition?s_tid=srchtitle) | ✔️ |
|
|
127
129
|
| [`BA-ACMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vmd/ba_acmd.py) (Bandwidth-aware adaptive chirp mode decomposition) | [[paper]](https://journals.sagepub.com/doi/abs/10.1177/14759217231174699) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/132792-bandwidth-aware-adaptive-chirp-mode-decomposition-ba-acmd?s_tid=srchtitle) | ✖️ |
|
|
128
130
|
| [`JMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_jmd/jmd.py) (Jump Plus AM-FM Mode Decomposition) | [[paper]](https://arxiv.org/abs/2407.07800) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/169388-jump-plus-am-fm-mode-decomposition-jmd?s_tid=prof_contriblnk) | ️✔️ |
|
|
129
131
|
| [`MJMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_jmd/mjmd.py) (Multivariate Jump Plus AM-FM Mode Decomposition) | [[paper]](https://arxiv.org/abs/2407.07800) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/169393-multivariate-jump-plus-am-fm-mode-decomposition-mjmd?s_tid=prof_contriblnk) | ✖️ |
|
|
130
132
|
| [`ESMD`]() (Extreme-Point Symmetric Mode Decomposition) | [[paper]](https://arxiv.org/abs/1303.6540) | [[code]](https://github.com/WuShichao/esmd) | ✖️ |
|
|
131
133
|
| [`STNBMD`]() (Short-Time Narrow-Band Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X16002443?via%3Dihub) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/56226-short-time-narrow-band-mode-decomposition-stnbmd-toolbox) | ✖️ |
|
|
132
|
-
|
|
|
134
|
+
| [`STL`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tsa/_stl.py) (Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/stl_decomposition.html) | ✔️ |
|
|
133
135
|
| [`MSTL`]() (Multivariate Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/mstl_decomposition.html) | ✖️ |
|
|
134
136
|
|
|
135
137
|
## Acknowledgements 🎖️ <a id="Acknowledgements"></a>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
A Python library for signal decomposition algorithms.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
__version__ = "0.4.
|
|
5
|
+
__version__ = "0.4.28"
|
|
6
6
|
|
|
7
7
|
# Empirical Mode Decomposition
|
|
8
8
|
from ._emd import EMD
|
|
@@ -58,6 +58,9 @@ from ._vmd import MVMD
|
|
|
58
58
|
# Variational Mode Extraction, to extract a specific mode from the signal
|
|
59
59
|
from ._vmd import VME
|
|
60
60
|
|
|
61
|
+
# Orthogonalized Variational Mode Decomposition
|
|
62
|
+
from ._vmd import OVMD
|
|
63
|
+
|
|
61
64
|
# Variational Mode Decomposition for 2D Image
|
|
62
65
|
from ._vmd2d import VMD2D
|
|
63
66
|
|
|
@@ -73,6 +76,12 @@ from ._vncmd import INCMD
|
|
|
73
76
|
# Adaptive Variational Nonlinear Chirp Mode Decomposition
|
|
74
77
|
from ._vncmd import AVNCMD
|
|
75
78
|
|
|
79
|
+
# Adaptive Local Iterative Filtering
|
|
80
|
+
from ._alif import ALIF
|
|
81
|
+
|
|
82
|
+
# Adaptive Polymorphic Mode Decomposition
|
|
83
|
+
from ._apmd import APMD
|
|
84
|
+
|
|
76
85
|
# Empirical Wavelet Transform
|
|
77
86
|
from ._ewt import ewt, EWT
|
|
78
87
|
|
|
@@ -132,10 +141,14 @@ Singular Spectral Analysis | SSA
|
|
|
132
141
|
Variational Mode Decomposition | VMD
|
|
133
142
|
Multivariate Variational Mode Decomposition | MVMD
|
|
134
143
|
Variational Mode Extraction | VME
|
|
144
|
+
Orthogonalized Variational Mode Decomposition | OVMD
|
|
135
145
|
Variational Mode Decomposition for 2D Image | VMD2D
|
|
136
146
|
Compact VMD for 2D Image | CVMD2D
|
|
137
147
|
Variational Nonlinear Chirp Mode Decomposition | VNCMD
|
|
138
148
|
Iterative Nonlinear Chirp Mode Decomposition | INCMD
|
|
149
|
+
Adaptive Variational Nonlinear Chirp Mode Dec. | AVNCMD
|
|
150
|
+
Adaptive Local Iterative Filtering | ALIF
|
|
151
|
+
Adaptive Polymorphic Mode Decomposition | APMD
|
|
139
152
|
Empirical Wavelet Transform | EWT
|
|
140
153
|
Jump Plus AM-FM Mode Decomposition | JMD
|
|
141
154
|
Feature Mode Decomposition | FMD
|
|
@@ -167,11 +180,14 @@ __all__ = [
|
|
|
167
180
|
"ACMD",
|
|
168
181
|
"MVMD",
|
|
169
182
|
"VME",
|
|
183
|
+
"OVMD",
|
|
170
184
|
"VMD2D",
|
|
171
185
|
"CVMD2D",
|
|
172
186
|
"VNCMD",
|
|
173
187
|
"INCMD",
|
|
174
188
|
"AVNCMD",
|
|
189
|
+
"ALIF",
|
|
190
|
+
"APMD",
|
|
175
191
|
"ewt",
|
|
176
192
|
"EWT",
|
|
177
193
|
"JMD",
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Adaptive Local Iterative Filtering (ALIF).
|
|
4
|
+
|
|
5
|
+
MATLAB reference: https://github.com/Cicone/ALIF
|
|
6
|
+
Paper: Cicone, A., Liu, J., Zhou, H. Adaptive Local Iterative Filtering for Signal
|
|
7
|
+
Decomposition and Instantaneous Frequency analysis. ACHA, 41(2):384-411, 2016.
|
|
8
|
+
"""
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import time
|
|
12
|
+
from typing import Optional
|
|
13
|
+
|
|
14
|
+
import numpy as np
|
|
15
|
+
from scipy.interpolate import interp1d
|
|
16
|
+
|
|
17
|
+
from pysdkit._alif.iterative_filtering import (
|
|
18
|
+
IterativeFiltering,
|
|
19
|
+
adaptive_average,
|
|
20
|
+
load_prefixed_filter,
|
|
21
|
+
maxmins,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ALIF(object):
|
|
26
|
+
"""
|
|
27
|
+
Adaptive Local Iterative Filtering.
|
|
28
|
+
|
|
29
|
+
Decomposes a (approximately) periodic signal into IMFs plus a trend:
|
|
30
|
+
signal ≈ IMF_1 + ... + IMF_K + trend
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
delta: float = 1e-4,
|
|
36
|
+
ext_points: int = 3,
|
|
37
|
+
max_imfs: int = 100,
|
|
38
|
+
xi: float = 1.6,
|
|
39
|
+
max_inner: int = 500,
|
|
40
|
+
max_time: float = np.inf,
|
|
41
|
+
verbose: int = 0,
|
|
42
|
+
) -> None:
|
|
43
|
+
"""
|
|
44
|
+
:param delta: relative energy stopping criterion for the inner loop
|
|
45
|
+
:param ext_points: stop when fewer than this many extrema remain
|
|
46
|
+
:param max_imfs: maximum number of IMFs (excluding the trend)
|
|
47
|
+
:param xi: mask-length scale factor (``ALIF.xi`` in the MATLAB code)
|
|
48
|
+
:param max_inner: maximum inner-loop iterations per IMF
|
|
49
|
+
:param max_time: wall-clock time budget in seconds
|
|
50
|
+
:param verbose: print progress when > 0
|
|
51
|
+
"""
|
|
52
|
+
self.delta = delta
|
|
53
|
+
self.ext_points = ext_points
|
|
54
|
+
self.max_imfs = max_imfs
|
|
55
|
+
self.xi = xi
|
|
56
|
+
self.max_inner = max_inner
|
|
57
|
+
self.max_time = max_time
|
|
58
|
+
self.verbose = verbose
|
|
59
|
+
|
|
60
|
+
self.imfs: Optional[np.ndarray] = None
|
|
61
|
+
self.mask_lengths: Optional[np.ndarray] = None
|
|
62
|
+
|
|
63
|
+
def __call__(self, signal: np.ndarray) -> np.ndarray:
|
|
64
|
+
return self.fit_transform(signal)
|
|
65
|
+
|
|
66
|
+
def __str__(self) -> str:
|
|
67
|
+
return "Adaptive Local Iterative Filtering (ALIF)"
|
|
68
|
+
|
|
69
|
+
def _instantaneous_periods(
|
|
70
|
+
self, signal: np.ndarray, extrema: np.ndarray
|
|
71
|
+
) -> np.ndarray:
|
|
72
|
+
"""Cubic-interpolate inter-extrema spacings onto the sample grid."""
|
|
73
|
+
n = signal.size
|
|
74
|
+
# MATLAB: T_f = [diff(maxmins) (maxmins(1)+N-maxmins(end))]
|
|
75
|
+
# extrema are 0-based; convert spacings consistently
|
|
76
|
+
ext = extrema.astype(int)
|
|
77
|
+
t_f = np.diff(ext).astype(np.float64)
|
|
78
|
+
t_f = np.append(t_f, ext[0] + n - ext[-1])
|
|
79
|
+
|
|
80
|
+
# Replicate extrema / periods for smooth periodic interpolation
|
|
81
|
+
temp_t = np.tile(t_f, 11)
|
|
82
|
+
temp_ext = np.concatenate([ext + k * n for k in range(11)]).astype(np.float64)
|
|
83
|
+
# Query 1..11N in MATLAB → 0..11N-1 in Python, then take center block
|
|
84
|
+
query = np.arange(1, 11 * n + 1, dtype=np.float64)
|
|
85
|
+
# Interpolate with cubic; MATLAB interp1(...,'cubic')
|
|
86
|
+
# Use 1-based style abscissa: extrema positions as MATLAB indices
|
|
87
|
+
temp_ext_m = temp_ext + 1.0
|
|
88
|
+
interp = interp1d(
|
|
89
|
+
temp_ext_m,
|
|
90
|
+
temp_t,
|
|
91
|
+
kind="cubic",
|
|
92
|
+
fill_value="extrapolate",
|
|
93
|
+
assume_sorted=False,
|
|
94
|
+
)
|
|
95
|
+
temp_i = interp(query)
|
|
96
|
+
return np.asarray(temp_i[5 * n : 6 * n], dtype=np.float64)
|
|
97
|
+
|
|
98
|
+
def _mask_from_periods(self, i_t: np.ndarray) -> np.ndarray:
|
|
99
|
+
"""
|
|
100
|
+
Smooth the instantaneous-period curve with IF and scale by ``2 * xi``.
|
|
101
|
+
"""
|
|
102
|
+
n_try = 1
|
|
103
|
+
i_t0 = i_t.copy()
|
|
104
|
+
while True:
|
|
105
|
+
iff = IterativeFiltering(
|
|
106
|
+
delta=0.001,
|
|
107
|
+
ext_points=3,
|
|
108
|
+
max_imfs=n_try,
|
|
109
|
+
xi=1.6,
|
|
110
|
+
alpha=1.0,
|
|
111
|
+
max_inner=200,
|
|
112
|
+
verbose=0,
|
|
113
|
+
)
|
|
114
|
+
imf_it = iff.fit_transform(i_t0)
|
|
115
|
+
trend = imf_it[-1]
|
|
116
|
+
n_imfs = imf_it.shape[0] - 1
|
|
117
|
+
if trend.min() <= 0 and n_imfs == n_try:
|
|
118
|
+
n_try += 1
|
|
119
|
+
if n_try > 20:
|
|
120
|
+
# Fall back to a positive smooth version of i_t
|
|
121
|
+
trend = np.maximum(i_t, 1.0)
|
|
122
|
+
break
|
|
123
|
+
elif trend.min() <= 0:
|
|
124
|
+
trend = np.maximum(trend, 1.0)
|
|
125
|
+
break
|
|
126
|
+
else:
|
|
127
|
+
break
|
|
128
|
+
|
|
129
|
+
return 2.0 * self.xi * np.asarray(trend, dtype=np.float64)
|
|
130
|
+
|
|
131
|
+
def fit_transform(self, signal: np.ndarray, return_masks: bool = False):
|
|
132
|
+
"""
|
|
133
|
+
Run ALIF on a 1-D signal.
|
|
134
|
+
|
|
135
|
+
:param signal: input samples (treated as one period of a periodic signal)
|
|
136
|
+
:param return_masks: if True, also return the mask-length functions
|
|
137
|
+
:return: IMFs with shape ``(n_imfs + 1, N)`` (last row = trend),
|
|
138
|
+
optionally ``mask_lengths`` with shape ``(n_imfs, N)``
|
|
139
|
+
"""
|
|
140
|
+
f = np.asarray(signal, dtype=np.float64).ravel().copy()
|
|
141
|
+
n = f.size
|
|
142
|
+
mm = load_prefixed_filter()
|
|
143
|
+
|
|
144
|
+
imfs = []
|
|
145
|
+
masks = []
|
|
146
|
+
t0 = time.perf_counter()
|
|
147
|
+
|
|
148
|
+
extrema = maxmins(f, extension_type="p")
|
|
149
|
+
while (
|
|
150
|
+
extrema.size > self.ext_points
|
|
151
|
+
and len(imfs) < self.max_imfs
|
|
152
|
+
and (time.perf_counter() - t0) < self.max_time
|
|
153
|
+
):
|
|
154
|
+
if self.verbose > 0:
|
|
155
|
+
print("ALIF: extracting IMF #{}".format(len(imfs) + 1))
|
|
156
|
+
|
|
157
|
+
i_t = self._instantaneous_periods(f, extrema)
|
|
158
|
+
mask_len = self._mask_from_periods(i_t)
|
|
159
|
+
|
|
160
|
+
if np.ceil(np.max(mask_len)) >= np.floor(n / 2.0):
|
|
161
|
+
if self.verbose > 0:
|
|
162
|
+
print(
|
|
163
|
+
"Mask length exceeds half the signal; "
|
|
164
|
+
"try reducing xi. Stopping IMF extraction."
|
|
165
|
+
)
|
|
166
|
+
break
|
|
167
|
+
|
|
168
|
+
masks.append(mask_len.copy())
|
|
169
|
+
h = f.copy()
|
|
170
|
+
sd = np.inf
|
|
171
|
+
in_step = 0
|
|
172
|
+
while sd > self.delta and in_step < self.max_inner:
|
|
173
|
+
in_step += 1
|
|
174
|
+
ave = adaptive_average(h, mask_len, mm)
|
|
175
|
+
denom = np.linalg.norm(h) ** 2
|
|
176
|
+
sd = (np.linalg.norm(ave) ** 2 / denom) if denom > 0 else 0.0
|
|
177
|
+
h = h - ave
|
|
178
|
+
if self.verbose > 1 and in_step % 10 == 0:
|
|
179
|
+
print(" step {:3d} SD={:.6e}".format(in_step, sd))
|
|
180
|
+
|
|
181
|
+
imfs.append(h)
|
|
182
|
+
f = f - h
|
|
183
|
+
extrema = maxmins(f, extension_type="p")
|
|
184
|
+
|
|
185
|
+
imfs.append(f)
|
|
186
|
+
self.imfs = np.vstack(imfs)
|
|
187
|
+
self.mask_lengths = np.vstack(masks) if masks else np.zeros((0, n))
|
|
188
|
+
|
|
189
|
+
if return_masks:
|
|
190
|
+
return self.imfs, self.mask_lengths
|
|
191
|
+
return self.imfs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Package data for the prefixed double filter used by ALIF / IF.
|
|
Binary file
|