PySDKit 0.4.11__tar.gz → 0.4.13__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.
Files changed (101) hide show
  1. {pysdkit-0.4.11 → pysdkit-0.4.13}/PKG-INFO +2 -2
  2. {pysdkit-0.4.11 → pysdkit-0.4.13}/PySDKit.egg-info/PKG-INFO +2 -2
  3. {pysdkit-0.4.11 → pysdkit-0.4.13}/PySDKit.egg-info/SOURCES.txt +12 -9
  4. {pysdkit-0.4.11 → pysdkit-0.4.13}/README.md +1 -1
  5. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/__init__.py +7 -1
  6. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/data/__init__.py +18 -3
  7. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/data/_add_noise.py +0 -8
  8. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/data/_generator.py +266 -30
  9. pysdkit-0.4.13/pysdkit/data/_image.py +364 -0
  10. pysdkit-0.4.13/pysdkit/data/_time_series.py +137 -0
  11. pysdkit-0.4.13/pysdkit/emd/__init__.py +23 -0
  12. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/_find_extrema.py +1 -1
  13. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/ceemdan.py +4 -0
  14. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/eemd.py +4 -0
  15. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/emd.py +16 -7
  16. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/memd.py +4 -0
  17. pysdkit-0.4.13/pysdkit/emd/remd.py +538 -0
  18. {pysdkit-0.4.11/pysdkit/tvf_emd → pysdkit-0.4.13/pysdkit/emd}/tvf_emd.py +10 -0
  19. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/ewt/ewt.py +7 -1
  20. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/faemd/faemd.py +7 -0
  21. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/faemd/md_faemd.py +11 -0
  22. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/faemd/mv_faemd.py +7 -0
  23. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/hvd/hvd.py +4 -0
  24. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/itd/itd.py +16 -6
  25. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/jmd/jmd.py +7 -0
  26. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/jmd/mjmd.py +7 -0
  27. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/lmd/lmd.py +73 -44
  28. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/lmd/rlmd.py +8 -1
  29. pysdkit-0.4.13/pysdkit/plot/__init__.py +19 -0
  30. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/plot/_fourier_spectra.py +2 -2
  31. pysdkit-0.4.13/pysdkit/plot/_plot_images.py +222 -0
  32. pysdkit-0.4.13/pysdkit/plot/_plot_imfs.py +541 -0
  33. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/ssa/ssa.py +4 -0
  34. pysdkit-0.4.13/pysdkit/tsa/__init__.py +8 -0
  35. pysdkit-0.4.13/pysdkit/tsa/_moving_decomp.py +238 -0
  36. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/__init__.py +13 -10
  37. pysdkit-0.4.13/pysdkit/utils/_cite.py +8 -0
  38. pysdkit-0.4.11/pysdkit/utils/instantaneous.py → pysdkit-0.4.13/pysdkit/utils/_instantaneous.py +16 -2
  39. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_smooth1d.py +4 -3
  40. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/acmd.py +13 -0
  41. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/avmd.py +3 -0
  42. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/ba_acmd.py +7 -0
  43. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/base.py +4 -0
  44. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/mvmd.py +4 -1
  45. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/vmd_c.py +4 -0
  46. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd2d/vmd2d.py +14 -0
  47. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vncmd/vncmd.py +6 -1
  48. {pysdkit-0.4.11 → pysdkit-0.4.13}/setup.py +2 -2
  49. pysdkit-0.4.11/pysdkit/data/image.py +0 -44
  50. pysdkit-0.4.11/pysdkit/emd/__init__.py +0 -14
  51. pysdkit-0.4.11/pysdkit/emd/remd.py +0 -28
  52. pysdkit-0.4.11/pysdkit/plot/__init__.py +0 -14
  53. pysdkit-0.4.11/pysdkit/plot/_plot_imfs.py +0 -132
  54. pysdkit-0.4.11/pysdkit/plot/plot_GrayScale.py +0 -57
  55. pysdkit-0.4.11/pysdkit/tvf_emd/__init__.py +0 -7
  56. {pysdkit-0.4.11 → pysdkit-0.4.13}/PySDKit.egg-info/dependency_links.txt +0 -0
  57. {pysdkit-0.4.11 → pysdkit-0.4.13}/PySDKit.egg-info/requires.txt +0 -0
  58. {pysdkit-0.4.11 → pysdkit-0.4.13}/PySDKit.egg-info/top_level.txt +0 -0
  59. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/data/texture.txt +0 -0
  60. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/_prepare_points.py +0 -0
  61. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd/_splines.py +0 -0
  62. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd2d/__init__.py +0 -0
  63. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd2d/bemd.py +0 -0
  64. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd2d/bmemd.py +0 -0
  65. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/emd2d/emd2d.py +0 -0
  66. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/esmd/__init__.py +0 -0
  67. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/esmd/esmd.py +0 -0
  68. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/ewt/__init__.py +0 -0
  69. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/ewt/ewt2d.py +0 -0
  70. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/faemd/__init__.py +0 -0
  71. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/fmd/__init__.py +0 -0
  72. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/fmd/fmd.py +0 -0
  73. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/hht/__init__.py +0 -0
  74. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/hht/hht.py +0 -0
  75. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/hvd/__init__.py +0 -0
  76. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/ifd/__init__.py +0 -0
  77. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/itd/__init__.py +0 -0
  78. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/jmd/__init__.py +0 -0
  79. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/lmd/__init__.py +0 -0
  80. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/plot/_functions.py +0 -0
  81. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/ssa/__init__.py +0 -0
  82. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_Index_of_Orthogonality.py +0 -0
  83. /pysdkit-0.4.11/pysdkit/utils/correlation.py → /pysdkit-0.4.13/pysdkit/utils/_correlation.py +0 -0
  84. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_diagnalization.py +0 -0
  85. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_differ.py +0 -0
  86. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_fft.py +0 -0
  87. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_function.py +0 -0
  88. /pysdkit-0.4.11/pysdkit/utils/hilbert.py → /pysdkit-0.4.13/pysdkit/utils/_hilbert.py +0 -0
  89. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_kernel_matrix.py +0 -0
  90. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_lags.py +0 -0
  91. /pysdkit-0.4.11/pysdkit/utils/mirror.py → /pysdkit-0.4.13/pysdkit/utils/_mirror.py +0 -0
  92. /pysdkit-0.4.11/pysdkit/utils/process.py → /pysdkit-0.4.13/pysdkit/utils/_process.py +0 -0
  93. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/utils/_types.py +0 -0
  94. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/__init__.py +0 -0
  95. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/svmd.py +0 -0
  96. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd/vmd_f.py +0 -0
  97. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vmd2d/__init__.py +0 -0
  98. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vncmd/__init__.py +0 -0
  99. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vncmd/anvcmd.py +0 -0
  100. {pysdkit-0.4.11 → pysdkit-0.4.13}/pysdkit/vncmd/mncmd.py +0 -0
  101. {pysdkit-0.4.11 → pysdkit-0.4.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PySDKit
3
- Version: 0.4.11
3
+ Version: 0.4.13
4
4
  Summary: A Python library for signal decomposition algorithms with a unified interface.
5
5
  Home-page: https://github.com/wwhenxuan/PySDKit
6
6
  Author: whenxuan
@@ -131,7 +131,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
131
131
  | [`BEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd2d/bemd.py) (Bidimensional Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0262885603000945) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/BEMD.py) | ✖️ |
132
132
  | [`CEMD`]() (Complex Empirical Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/4063369) | [[code]]() | ✖️ |
133
133
  | [`EEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/eemd.py) (Ensemble Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/topics/physics-and-astronomy/ensemble-empirical-mode-decomposition) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/EEMD.py) | ✔️ |
134
- | [`REMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/remd.py) (Robust Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0019057821003785) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/70032-robust-empirical-mode-decomposition-remd) | ✖️ |
134
+ | [`REMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/remd.py) (Robust Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0019057821003785) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/70032-robust-empirical-mode-decomposition-remd) | ✔️ |
135
135
  | [`BMEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd2d/bmemd.py) (Bidimensional Multivariate Empirical Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/8805082) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/72343-bidimensional-multivariate-empirical-mode-decomposition?s_tid=FX_rc1_behav) | ✖️ |
136
136
  | [`CEEMDAN`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/ceemdan.py) (Complete Ensemble EMD with Adaptive Noise) | [[paper]](https://ieeexplore.ieee.org/document/5947265) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/EEMD.py) | ✔️ |
137
137
  | [`TVF_EMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tvf_emd/tvf_emd.py) (Time Varying Filter Based EMD) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168417301135) | [[code]](https://github.com/stfbnc/pytvfemd/tree/master) | ✔️ |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: PySDKit
3
- Version: 0.4.11
3
+ Version: 0.4.13
4
4
  Summary: A Python library for signal decomposition algorithms with a unified interface.
5
5
  Home-page: https://github.com/wwhenxuan/PySDKit
6
6
  Author: whenxuan
@@ -131,7 +131,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
131
131
  | [`BEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd2d/bemd.py) (Bidimensional Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0262885603000945) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/BEMD.py) | ✖️ |
132
132
  | [`CEMD`]() (Complex Empirical Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/4063369) | [[code]]() | ✖️ |
133
133
  | [`EEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/eemd.py) (Ensemble Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/topics/physics-and-astronomy/ensemble-empirical-mode-decomposition) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/EEMD.py) | ✔️ |
134
- | [`REMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/remd.py) (Robust Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0019057821003785) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/70032-robust-empirical-mode-decomposition-remd) | ✖️ |
134
+ | [`REMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/remd.py) (Robust Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0019057821003785) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/70032-robust-empirical-mode-decomposition-remd) | ✔️ |
135
135
  | [`BMEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd2d/bmemd.py) (Bidimensional Multivariate Empirical Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/8805082) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/72343-bidimensional-multivariate-empirical-mode-decomposition?s_tid=FX_rc1_behav) | ✖️ |
136
136
  | [`CEEMDAN`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/ceemdan.py) (Complete Ensemble EMD with Adaptive Noise) | [[paper]](https://ieeexplore.ieee.org/document/5947265) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/EEMD.py) | ✔️ |
137
137
  | [`TVF_EMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tvf_emd/tvf_emd.py) (Time Varying Filter Based EMD) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168417301135) | [[code]](https://github.com/stfbnc/pytvfemd/tree/master) | ✔️ |
@@ -9,7 +9,8 @@ pysdkit/__init__.py
9
9
  pysdkit/data/__init__.py
10
10
  pysdkit/data/_add_noise.py
11
11
  pysdkit/data/_generator.py
12
- pysdkit/data/image.py
12
+ pysdkit/data/_image.py
13
+ pysdkit/data/_time_series.py
13
14
  pysdkit/data/texture.txt
14
15
  pysdkit/emd/__init__.py
15
16
  pysdkit/emd/_find_extrema.py
@@ -20,6 +21,7 @@ pysdkit/emd/eemd.py
20
21
  pysdkit/emd/emd.py
21
22
  pysdkit/emd/memd.py
22
23
  pysdkit/emd/remd.py
24
+ pysdkit/emd/tvf_emd.py
23
25
  pysdkit/emd2d/__init__.py
24
26
  pysdkit/emd2d/bemd.py
25
27
  pysdkit/emd2d/bmemd.py
@@ -51,27 +53,28 @@ pysdkit/lmd/rlmd.py
51
53
  pysdkit/plot/__init__.py
52
54
  pysdkit/plot/_fourier_spectra.py
53
55
  pysdkit/plot/_functions.py
56
+ pysdkit/plot/_plot_images.py
54
57
  pysdkit/plot/_plot_imfs.py
55
- pysdkit/plot/plot_GrayScale.py
56
58
  pysdkit/ssa/__init__.py
57
59
  pysdkit/ssa/ssa.py
58
- pysdkit/tvf_emd/__init__.py
59
- pysdkit/tvf_emd/tvf_emd.py
60
+ pysdkit/tsa/__init__.py
61
+ pysdkit/tsa/_moving_decomp.py
60
62
  pysdkit/utils/_Index_of_Orthogonality.py
61
63
  pysdkit/utils/__init__.py
64
+ pysdkit/utils/_cite.py
65
+ pysdkit/utils/_correlation.py
62
66
  pysdkit/utils/_diagnalization.py
63
67
  pysdkit/utils/_differ.py
64
68
  pysdkit/utils/_fft.py
65
69
  pysdkit/utils/_function.py
70
+ pysdkit/utils/_hilbert.py
71
+ pysdkit/utils/_instantaneous.py
66
72
  pysdkit/utils/_kernel_matrix.py
67
73
  pysdkit/utils/_lags.py
74
+ pysdkit/utils/_mirror.py
75
+ pysdkit/utils/_process.py
68
76
  pysdkit/utils/_smooth1d.py
69
77
  pysdkit/utils/_types.py
70
- pysdkit/utils/correlation.py
71
- pysdkit/utils/hilbert.py
72
- pysdkit/utils/instantaneous.py
73
- pysdkit/utils/mirror.py
74
- pysdkit/utils/process.py
75
78
  pysdkit/vmd/__init__.py
76
79
  pysdkit/vmd/acmd.py
77
80
  pysdkit/vmd/avmd.py
@@ -94,7 +94,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
94
94
  | [`BEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd2d/bemd.py) (Bidimensional Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0262885603000945) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/BEMD.py) | ✖️ |
95
95
  | [`CEMD`]() (Complex Empirical Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/abstract/document/4063369) | [[code]]() | ✖️ |
96
96
  | [`EEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/eemd.py) (Ensemble Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/topics/physics-and-astronomy/ensemble-empirical-mode-decomposition) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/EEMD.py) | ✔️ |
97
- | [`REMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/remd.py) (Robust Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0019057821003785) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/70032-robust-empirical-mode-decomposition-remd) | ✖️ |
97
+ | [`REMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/remd.py) (Robust Empirical Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0019057821003785) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/70032-robust-empirical-mode-decomposition-remd) | ✔️ |
98
98
  | [`BMEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd2d/bmemd.py) (Bidimensional Multivariate Empirical Mode Decomposition) | [[paper]](https://ieeexplore.ieee.org/document/8805082) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/72343-bidimensional-multivariate-empirical-mode-decomposition?s_tid=FX_rc1_behav) | ✖️ |
99
99
  | [`CEEMDAN`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/emd/ceemdan.py) (Complete Ensemble EMD with Adaptive Noise) | [[paper]](https://ieeexplore.ieee.org/document/5947265) | [[code]](https://github.com/laszukdawid/PyEMD/blob/master/PyEMD/EEMD.py) | ✔️ |
100
100
  | [`TVF_EMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tvf_emd/tvf_emd.py) (Time Varying Filter Based EMD) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168417301135) | [[code]](https://github.com/stfbnc/pytvfemd/tree/master) | ✔️ |
@@ -7,11 +7,14 @@ from .emd import EEMD
7
7
  # 具有自适应噪声的完全集合经验模态分解
8
8
  from .emd import CEEMDAN
9
9
 
10
+ # 稳健经验模态分解
11
+ from .emd import REMD
12
+
10
13
  # 多元变分模态分解算法
11
14
  from .emd import MEMD
12
15
 
13
16
  # 基于时变滤波器的经验模态分解
14
- from .tvf_emd import TVF_EMD
17
+ from .emd import TVF_EMD
15
18
 
16
19
  # 希尔伯特震动分解
17
20
  from .hvd import HVD
@@ -45,3 +48,6 @@ from .vncmd import VNCMD
45
48
 
46
49
  # 经验小波变换
47
50
  from .ewt import ewt, EWT
51
+
52
+ # 滑动平均分解
53
+ from .tsa import Moving_Decomp
@@ -17,11 +17,26 @@ from ._generator import generate_am_signal, generate_exponential_signal
17
17
  # Generates the main test sample signal
18
18
  from ._generator import test_emd
19
19
 
20
+ # Generator for 1D univariate
21
+ from ._generator import test_uni_signal
22
+
23
+ # Generator for 1D multivariate
24
+ from ._generator import test_multi_signal
25
+
20
26
  # Functions that generate signal visualizations
21
- from ._generator import plot_generate_signal
27
+ from ._generator import plot_signal
22
28
 
23
29
  # add Gaussian noise
24
30
  from ._add_noise import add_noise
25
31
 
26
- # 加载二维灰度图像的测试案例
27
- from .image import test_grayscale
32
+ # Test case for loading a 2D grayscale image
33
+ from ._image import test_grayscale
34
+
35
+ # Test case for univariate image
36
+ from ._image import test_uni_image
37
+
38
+ # Test case for multivariate image
39
+ from ._image import test_multi_image
40
+
41
+ # Generator for 1D univariate time series data
42
+ from ._time_series import generate_time_series
@@ -25,11 +25,3 @@ def add_noise(N: int, Mean: float, STD: float) -> np.ndarray:
25
25
  y = Mean + STD * y
26
26
 
27
27
  return y
28
-
29
-
30
- if __name__ == "__main__":
31
- N = 1000
32
- Mean = 0
33
- STD = 1
34
- noise = add_noise(N, Mean, STD)
35
- print(noise)
@@ -198,7 +198,67 @@ def generate_exponential_signal(
198
198
  return t, noisy_exp_signal
199
199
 
200
200
 
201
- def base_example(
201
+ def test_uni_signal(
202
+ case: int = 1,
203
+ duration: float = 1.0,
204
+ sampling_rate: int = 1000,
205
+ ) -> Tuple[np.array, np.array]:
206
+ """
207
+ Select a test case for a one-dimensional univariate signal based on the input `case`
208
+ :param case: the test number in [1, 2, 3]
209
+ :param duration: Length of the signal in seconds.
210
+ :param sampling_rate: Number of samples per second.
211
+ :return: Tuple containing time array and the generated signal.
212
+ :return: the generated signal for univariate 1D.
213
+ """
214
+ if case == 1:
215
+ return test_1D_1(duration, sampling_rate)
216
+ elif case == 2:
217
+ return test_1D_2(duration, sampling_rate)
218
+ elif case == 3:
219
+ return test_1D_3(duration, sampling_rate)
220
+ else:
221
+ # 当没有这个测试实例是返回`test_emd`这个函数
222
+ print(f"There is no case {case}, so it will return test_emd!")
223
+ return test_emd(duration, sampling_rate)
224
+
225
+
226
+ def test_1D_1(
227
+ duration: float = 1.0, sampling_rate: int = 1000
228
+ ) -> Tuple[np.array, np.array]:
229
+ """4 / np.pi * (np.sin(2 * np.pi * 10 * t) + np.sin(2 * np.pi * 30 * t) / 3 + np.sin(2 * np.pi * (50 * t + 20 * t ** 2)) / 2)
230
+ :param duration: Length of the signal in seconds.
231
+ :param sampling_rate: Number of samples per second.
232
+ :return: Tuple containing time array and the generated signal.
233
+ """
234
+ t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
235
+ signal = (
236
+ 4
237
+ / np.pi
238
+ * (
239
+ np.sin(2 * np.pi * 10 * t)
240
+ + np.sin(2 * np.pi * 30 * t) / 3
241
+ + np.sin(2 * np.pi * (50 * t + 20 * t**2)) / 2
242
+ )
243
+ )
244
+ return t, signal
245
+
246
+
247
+ def test_1D_2(
248
+ duration: float = 10.0, sampling_rate: int = 128
249
+ ) -> Tuple[np.array, np.array]:
250
+ """
251
+ Generate 3 * 2 ^ (-t) * sin(sin(2 * pi * t))
252
+ :param duration: Length of the signal in seconds.
253
+ :param sampling_rate: Number of samples per second.
254
+ :return: Tuple containing time array and the 3 * 2 ^ (-t) * sin(sin(2 * pi * t)) signal.
255
+ """
256
+ t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
257
+ signal = 3 * 2 ^ (-t) * np.sin(np.sin(2 * np.pi * t))
258
+ return t, signal
259
+
260
+
261
+ def test_1D_3(
202
262
  duration: float = 6.0,
203
263
  sampling_rate: int = 128,
204
264
  noise_level: float = 0.0,
@@ -220,18 +280,6 @@ def base_example(
220
280
  return t, noise_signal
221
281
 
222
282
 
223
- def fun(duration: float = 10.0, sampling_rate: int = 128) -> Tuple[np.array, np.array]:
224
- """
225
- Generate 3 * 2 ^ (-t) * sin(sin(2 * pi * t))
226
- :param duration: Length of the signal in seconds.
227
- :param sampling_rate: Number of samples per second.
228
- :return: Tuple containing time array and the 3 * 2 ^ (-t) * sin(sin(2 * pi * t)) signal.
229
- """
230
- t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
231
- signal = 3 * 2 ^ (-t) * np.sin(np.sin(2 * np.pi * t))
232
- return t, signal
233
-
234
-
235
283
  def test_emd(
236
284
  duration: float = 1.0,
237
285
  sampling_rate: int = 1000,
@@ -254,14 +302,156 @@ def test_emd(
254
302
  return t, noise_signal
255
303
 
256
304
 
257
- def plot_generate_signal(
305
+ def test_multi_signal(
306
+ case: int = 1,
307
+ duration: float = 1.0,
308
+ sampling_rate: int = 1000,
309
+ ) -> Tuple[np.array, np.array]:
310
+ """
311
+ Select a test case for a 1D multivariate signal based on the input `case`
312
+ :param case: the test number in [1, 2, 3]
313
+ :param duration: Length of the signal in seconds.
314
+ :param sampling_rate: Number of samples per second.
315
+ :return: Tuple containing time array and the generated signal.
316
+ :return: the generated signal for multivariate 1D.
317
+ """
318
+ if case == 1:
319
+ return test_multi_1D_1(duration=duration, sampling_rate=sampling_rate)
320
+ elif case == 2:
321
+ return test_multi_1D_2(duration=duration, sampling_rate=sampling_rate)
322
+ elif case == 3:
323
+ return test_multi_1D_3(duration=duration, sampling_rate=sampling_rate)
324
+ else:
325
+ # When there is no such test instance, the function returns `case==1`
326
+ print(f"There is no case {case}, so it will return case==1!")
327
+ return test_multi_1D_1(duration=duration, sampling_rate=sampling_rate)
328
+
329
+
330
+ def test_multi_1D_1(
331
+ duration: float = 1.0, sampling_rate: int = 1000
332
+ ) -> Tuple[np.array, np.array]:
333
+ """
334
+ Generate some simple cosine and sine function for multivariate signal decomposition test
335
+ :param duration: Length of the signal in seconds.
336
+ :param sampling_rate: Number of samples per second.
337
+ :return: Tuple containing time array and the multivariate signals of shape [num_vars, seq_len].
338
+ """
339
+ t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
340
+
341
+ # Generate the multi-channels signals
342
+ signal_1 = np.cos(2 * np.pi * 5 * t + np.pi / 3) + 2.5 * np.cos(
343
+ 2 * np.pi * 36 * t + np.pi / 2
344
+ )
345
+ signal_2 = 3 * np.cos(2 * np.pi * 24 * t) + 2 * np.cos(2 * np.pi * 36 * t)
346
+
347
+ # concat all channels
348
+ signal = np.vstack([signal_1, signal_2])
349
+
350
+ return t, signal
351
+
352
+
353
+ def test_multi_1D_2(
354
+ duration: float = 1.0, sampling_rate: int = 1000
355
+ ) -> Tuple[np.array, np.array]:
356
+ """
357
+ Generate four channels simple cosine and sine function for multivariate signal decomposition
358
+ :param duration: Length of the signal in seconds.
359
+ :param sampling_rate: Number of samples per second.
360
+ :return: Tuple containing time array and the multivariate signals of shape [num_vars, seq_len].
361
+ """
362
+ np.random.seed(seed=42)
363
+ t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
364
+ t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
365
+
366
+ # Generate the multi-channels signals
367
+ signal_1 = (
368
+ 2 * np.cos(2 * np.pi * 3 * t**2)
369
+ + 1.7 * np.cos(2 * np.pi * 20 * t)
370
+ + np.cos(2 * np.pi * 40 * t)
371
+ + np.random.uniform(0, 0.2, t.shape)
372
+ )
373
+
374
+ signal_2 = 1.5 * np.cos(2 * np.pi * 3 * t**2) + np.random.uniform(0, 0.2, t.shape)
375
+
376
+ signal_3 = (
377
+ 2 * np.cos(2 * np.pi * 20 * t + np.pi / 3)
378
+ + 1.8 * np.cos(2 * np.pi * 40 * t)
379
+ + np.random.uniform(0, 0.2, t.shape)
380
+ )
381
+
382
+ signal_4 = (
383
+ 1.8 * np.cos(2 * np.pi * 3 * t**2)
384
+ + 2 * np.cos(2 * np.pi * 40 * t)
385
+ + np.random.uniform(0, 0.2, t.shape)
386
+ )
387
+
388
+ # Concat all the input channels
389
+ signal = np.vstack([signal_1, signal_2, signal_3, signal_4])
390
+
391
+ return t, signal
392
+
393
+
394
+ def test_multi_1D_3(
395
+ duration: float = 1.0,
396
+ sampling_rate: int = 1000,
397
+ noise_level: float = 0.1,
398
+ random_state: int = 42,
399
+ ) -> Tuple[np.ndarray, np.ndarray]:
400
+ """
401
+ Generate some simple cosine function for multivariate signal decomposition test
402
+ :param duration: Length of the signal in seconds.
403
+ :param sampling_rate: Number of samples per second.
404
+ :param noise_level: Standard deviation of the Gaussian noise.
405
+ :param random_state: Random seed for the noise generation.
406
+ :return: Tuple containing time array and the multivariate signals of shape [num_vars, seq_len] with noise.
407
+ """
408
+ np.random.seed(seed=random_state)
409
+ t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)
410
+
411
+ # Generate the multi-channels signals
412
+ f_channel1 = (
413
+ (10 * np.cos(2 * np.pi * 2 * t))
414
+ + (9 * (np.cos(2 * np.pi * 36 * t)))
415
+ + np.random.normal(0, noise_level, t.shape)
416
+ )
417
+
418
+ f_channel2 = (
419
+ (9 * (np.cos(2 * np.pi * 24 * t)))
420
+ + (8 * (np.cos(2 * np.pi * 36 * t)))
421
+ + np.random.normal(0, noise_level, t.shape)
422
+ )
423
+
424
+ f_channel3 = (
425
+ (8 * (np.cos(2 * np.pi * 28 * t)))
426
+ + (7 * (np.cos(2 * np.pi * 48 * t)))
427
+ + np.random.normal(0, noise_level, t.shape)
428
+ )
429
+
430
+ f_channel4 = (
431
+ (7 * (np.cos(2 * np.pi * 32 * t)))
432
+ + (6 * (np.cos(2 * np.pi * 36 * t)))
433
+ + np.random.normal(0, noise_level, t.shape)
434
+ )
435
+
436
+ f_channel5 = (
437
+ (6 * (np.cos(2 * np.pi * 19 * t)))
438
+ + (5 * (np.cos(2 * np.pi * 64 * t)))
439
+ + np.random.normal(0, noise_level, t.shape)
440
+ )
441
+
442
+ # concat all channels
443
+ f = np.vstack([f_channel1, f_channel2, f_channel3, f_channel4, f_channel5])
444
+
445
+ return t, f
446
+
447
+
448
+ def plot_signal(
258
449
  t: np.array,
259
450
  signal: np.array,
260
451
  color: str = "royalblue",
261
452
  save: bool = False,
262
- figsize: Tuple = (12, 4),
263
- dpi: int = 600,
264
- fontsize: int = 15,
453
+ dpi: int = 128,
454
+ fontsize: int = 12,
265
455
  ) -> plt.figure:
266
456
  """
267
457
  Plot and optionally save an amplitude modulated (AM) signal with time on the x-axis and amplitude on the y-axis.
@@ -269,26 +459,72 @@ def plot_generate_signal(
269
459
  :param signal: Array containing the signal data to be plotted.
270
460
  :param color: Color of the plot line.
271
461
  :param save: Boolean flag to indicate whether the plot should be saved to a file.
272
- :param figsize: Tuple representing the width and height of the figure in inches.
273
462
  :param dpi: Dots per inch (resolution) of the figure, if saved.
274
463
  :param fontsize: Font size of the axis labels.
275
464
  :return: The figure object containing the plot.
276
465
  """
277
- # Create a figure and a single subplot
278
- fig, ax = plt.subplots(figsize=figsize)
279
- # Plot the signal against time with specified line color
280
- ax.plot(t, signal, color=color)
281
- # Set the x-axis label with specified font size
282
- ax.set_xlabel("Time (seconds)", fontsize=fontsize)
283
- # Set the y-axis label with default font size
284
- ax.set_ylabel("Amplitude")
285
- # Enable grid for better readability
286
- ax.grid(True)
287
- # Display the plot
288
- plt.show()
466
+
467
+ # Determine the number of input signals
468
+ n_dim = len(signal.shape)
469
+
470
+ if n_dim == 1:
471
+ # Create a figure and a single subplot
472
+ fig, ax = plt.subplots(figsize=(8, 3))
473
+
474
+ # Plot the signal against time with specified line color
475
+ ax.plot(t, signal, color=color)
476
+
477
+ # Set the x-axis label with specified font size
478
+ ax.set_xlabel("Time (seconds)", fontsize=fontsize)
479
+
480
+ # Set the y-axis label with default font size
481
+ ax.set_ylabel("Amplitude", fontsize=fontsize)
482
+
483
+ # Enable grid for better readability
484
+ ax.grid(True)
485
+
486
+ elif n_dim == 2:
487
+ # Determining the number of multivariate signals
488
+ n_vars = signal.shape[0]
489
+
490
+ # Create a figure and a single subplot
491
+ fig, ax = plt.subplots(nrows=n_vars, figsize=(10, 1 + 2 * n_vars), sharex=True)
492
+
493
+ for i in range(n_vars):
494
+ # Plot the signal against time with specified line color
495
+ ax[i].plot(t, signal[i, :], color=color)
496
+
497
+ # Set the y-axis label with default font size
498
+ ax[i].set_ylabel("Amplitude", fontsize=fontsize)
499
+
500
+ # Enable grid for better readability
501
+ ax[i].grid(True)
502
+
503
+ # Set the x-axis label with specified font size
504
+ ax[-1].set_xlabel("Time (seconds)", fontsize=fontsize)
505
+
506
+ else:
507
+ raise ValueError("Wrong input signal, please input the 1D signal.")
508
+
289
509
  # Check if the figure needs to be saved
290
510
  if save:
291
511
  # Save the figure with the specified dpi and bounding box tightly around the figure
292
512
  fig.savefig("generate_signal.jpg", dpi=dpi, bbox_inches="tight")
513
+
293
514
  # Return the figure object
294
515
  return fig
516
+
517
+
518
+ if __name__ == "__main__":
519
+ from pysdkit.data import test_emd, plot_signal, test_multi_signal
520
+
521
+ t, signal = test_uni_signal(case=1)
522
+ print(signal.shape)
523
+
524
+ fig = plot_signal(t, signal)
525
+
526
+ t, signal = test_multi_signal(case=2)
527
+ print(signal.shape)
528
+
529
+ fig = plot_signal(t, signal, save=False)
530
+ plt.show()