Skip to content

Commit b4f96fb

Browse files
committed
whenxaun: update the version
1 parent 1d2b639 commit b4f96fb

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎examples/sjmd.ipynb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"from pysdkit import SJMD, SMJMD\n",
5555
"\n",
5656
"print(SJMD())\n",
57-
"print(SMJMD is SJMD)\n"
57+
"print(SMJMD is SJMD)"
5858
]
5959
},
6060
{
@@ -105,7 +105,7 @@
105105
"osc = np.vstack([ch1, ch2, ch3])\n",
106106
"\n",
107107
"Sig = osc + jump_mc + 0.1 * rng.standard_normal((3, n))\n",
108-
"print(\"Sig shape (C, N):\", Sig.shape)\n"
108+
"print(\"Sig shape (C, N):\", Sig.shape)"
109109
]
110110
},
111111
{
@@ -131,7 +131,7 @@
131131
" tau=50,\n",
132132
" beta=0.5,\n",
133133
" b_bar=0.9,\n",
134-
" stopc=4, # power of the last mode (recommended)\n",
134+
" stopc=4, # power of the last mode (recommended)\n",
135135
" tol=1e-5,\n",
136136
")\n",
137137
"\n",

‎pysdkit/__init__.py‎

Lines changed: 1 addition & 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.29"
5+
__version__ = "0.4.30"
66

77
# Empirical Mode Decomposition
88
from ._emd import EMD

‎pysdkit/_jmd/sjmd.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ def _check_stop(
166166
err = np.linalg.norm(f_hat_temp - u_hat_i[:, :, 0].T) ** 2
167167
else:
168168
err = np.linalg.norm(f_hat_temp - np.sum(u_hat_i, axis=2).T) ** 2
169-
bic.append(2 * t_len * np.log(err + np.finfo(float).eps) + (3 * k) * np.log(2 * t_len))
169+
bic.append(
170+
2 * t_len * np.log(err + np.finfo(float).eps)
171+
+ (3 * k) * np.log(2 * t_len)
172+
)
170173
if k > 1 and bic[-1] > bic[-2]:
171174
stop = True
172175
elif stopc == 3:
@@ -288,9 +291,9 @@ def fit_transform(
288291
- u_hat_l[:, c, n + 1]
289292
)
290293
)
291-
den_g = 1.0 + 2.0 * (alpha_val**2) * (
292-
omega_freqs - omega_l[n]
293-
) ** 4
294+
den_g = (
295+
1.0 + 2.0 * (alpha_val**2) * (omega_freqs - omega_l[n]) ** 4
296+
)
294297
g_hat_plus[:, c, n + 1] = num_g / den_g
295298

296299
# shared / single center frequency
@@ -311,9 +314,7 @@ def fit_transform(
311314
u_td = np.zeros((n_ch, t_len), dtype=float)
312315
fr_td = np.zeros((n_ch, t_len), dtype=float)
313316
for c in range(n_ch):
314-
u_td[c, :] = np.real(
315-
np.fft.ifft(np.fft.ifftshift(u_hat[:, c]))
316-
)
317+
u_td[c, :] = np.real(np.fft.ifft(np.fft.ifftshift(u_hat[:, c])))
317318
fr_td[c, :] = np.real(
318319
np.fft.ifft(np.fft.ifftshift(g_hat[:, c]))
319320
)

0 commit comments

Comments
 (0)