Skip to content

Commit 64dd58b

Browse files
authored
Merge pull request #26 from wwhenxuan/master
Update New Version
2 parents d998c12 + d5dd956 commit 64dd58b

File tree

6 files changed

+40
-11
lines changed

6 files changed

+40
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ plot_IMFs_amplitude_spectra(IMFs, smooth="exp") # use exp smooth
9999
| [`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) | ✖️ |
100100
| [`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) | ✔️ |
101101
| [`TVF_EMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_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) | ✔️ |
102+
| [`EFD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_emd/efd.py) (Empirical Fourier Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/abs/pii/S0888327021005355) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/97747-empirical-fourier-decomposition-efd) | ✔️ |
102103
| [`FAEMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_faemd/faemd.py) (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) | ✔️ |
103104
| [`FAEMD2D`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_faemd/faemd2d.py) (Two-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) | ✖️ |
104105
| [`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) | ✖️ |

pysdkit/__init__.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
A Python library for signal decomposition algorithms.
33
"""
44

5-
__version__ = "0.4.16"
5+
__version__ = "0.4.17"
66

77
__all__ = [
88
"EMD",
@@ -11,6 +11,7 @@
1111
"REMD",
1212
"MEMD",
1313
"TVF_EMD",
14+
"EFD",
1415
"FAEMD",
1516
"EMD2D",
1617
"HVD",
@@ -57,6 +58,9 @@
5758
# Time Varying Filter based Empirical Mode Decomposition
5859
from ._emd import TVF_EMD
5960

61+
# Empirical Fourier Decomposition
62+
from ._emd import EFD
63+
6064
# Fast and Adaptive Empirical Mode Decomposition
6165
from ._faemd import FAEMD
6266

@@ -110,3 +114,19 @@
110114

111115
# Moving Average decomposition
112116
from .tsa import Moving_Decomp
117+
118+
119+
def greet():
120+
print(
121+
"""
122+
____ ____ ____ _ __ _ _
123+
| _ \ _ _ / ___| | _ \ | |/ /(_)| |_
124+
| |_) || | | |\___ \ | | | || ' / | || __|
125+
| __/ | |_| | ___) || |_| || . \ | || |_
126+
|_| \__, ||____/ |____/ |_|\_\|_| \__|
127+
|___/
128+
129+
A Python library for signal decomposition algorithms.
130+
https://github.com/wwhenxuan/PySDKit
131+
"""
132+
)

pysdkit/_emd/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121
from .memd import MEMD
2222

2323
from .tvf_emd import TVF_EMD
24+
25+
from .efd import EFD

pysdkit/_vncmd/incmd.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"""
77
import numpy as np
88
from scipy import linalg
9-
from scipy.integrate import cumtrapz
9+
try:
10+
from scipy.integrate import cumulative_trapezoid
11+
except ImportError:
12+
from scipy.integrate import cumtrapz as cumulative_trapezoid
1013
from scipy.sparse import spdiags, diags, identity, csc_matrix
1114
from scipy.signal import welch
1215
from scipy.sparse.linalg import inv as sparseinv
@@ -165,14 +168,14 @@ def _welch_method_estimate(signal: np.ndarray, time: np.ndarray) -> np.ndarray:
165168
@staticmethod
166169
def _compute_new_phi_1(new_f: np.ndarray, time: np.ndarray) -> np.ndarray:
167170
"""Compute new phi_1"""
168-
integrated_f = cumtrapz(new_f, time, initial=0)
171+
integrated_f = cumulative_trapezoid(new_f, time, initial=0)
169172
phi_diag = np.cos(2 * np.pi * integrated_f)
170173
return diags(phi_diag)
171174

172175
@staticmethod
173176
def _compute_new_phi_2(new_f: np.ndarray, time: np.ndarray) -> np.ndarray:
174177
"""Compute new phi_2"""
175-
integrated_f = cumtrapz(new_f, time, initial=0)
178+
integrated_f = cumulative_trapezoid(new_f, time, initial=0)
176179
phi_diag = np.sin(2 * np.pi * integrated_f)
177180
return diags(phi_diag)
178181

pysdkit/_vncmd/vncmd.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
import numpy as np
1010
from numpy.linalg import solve, norm
1111
from scipy.sparse import diags, eye
12-
from scipy.integrate import cumtrapz
12+
try:
13+
from scipy.integrate import cumulative_trapezoid
14+
except ImportError:
15+
from scipy.integrate import cumtrapz as cumulative_trapezoid
1316
from typing import Tuple, Optional
1417
from pysdkit._vmd.base import Base
1518

@@ -196,10 +199,10 @@ def fit_transform(self, signal: np.ndarray, eIF: Optional[np.ndarray] = None):
196199
# Initialize the variables defined above through loops
197200
for i in range(K):
198201
sinm[i, :] = np.sin(
199-
2 * np.pi * cumtrapz(eIF[i, :], t, initial=0), dtype=self.DTYPE
202+
2 * np.pi * cumulative_trapezoid(eIF[i, :], t, initial=0), dtype=self.DTYPE
200203
)
201204
cosm[i, :] = np.cos(
202-
2 * np.pi * cumtrapz(eIF[i, :], t, initial=0), dtype=self.DTYPE
205+
2 * np.pi * cumulative_trapezoid(eIF[i, :], t, initial=0), dtype=self.DTYPE
203206
)
204207

205208
Bm = diags(

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setuptools.setup(
77
name="PySDKit", # 使用包的名称
88
packages=setuptools.find_packages(),
9-
version="0.4.16", # 包的版本号,应遵循语义版本控制规则
9+
version="0.4.17", # 包的版本号,应遵循语义版本控制规则
1010
description="A Python library for signal decomposition algorithms with a unified interface.", # 包的简短描述
1111
url="https://github.com/wwhenxuan/PySDKit", # 项目的地址通常来说是github
1212
author="whenxuan",
@@ -33,9 +33,9 @@
3333
],
3434
python_requires=">=3.6", # 最低的Python版本限制
3535
install_requires=[
36-
"numpy>=1.24.3,<=1.26.4",
37-
"scipy>=1.11.1,<=1.13.1",
38-
"matplotlib>=3.7.2,<=3.8.4",
36+
"numpy>=1.24.3",
37+
"scipy>=1.11.1",
38+
"matplotlib>=3.7.2",
3939
"tqdm>=4.66.5",
4040
"requests>=2.32.3",
4141
], # 手动指定依赖的Python以及最低的版本

0 commit comments

Comments
 (0)