laszukdawid / PyEMD

Python implementation of Empirical Mode Decompoisition (EMD) method
https://pyemd.readthedocs.io/
Apache License 2.0
857 stars 222 forks source link

Need help to understand the residual part, get different results by using CEEMD and EMD #136

Open j389wang opened 1 year ago

j389wang commented 1 year ago

Describe the bug When I used the EMD method, I can get a smoothed residual. However, if I used the CEEMD, I got a noised residual, the pattern is very fluctuated, such as a real noise term.

To Reproduce

Execute EMD on signal

model = PyEMD.EMD() model.emd(s,T) imfs, residue = model.get_imfs_and_residue()

N = imfs.shape[0]+2 plt.figure(figsize=(30,60))

Plot results

plt.subplot(N,1,1) plt.plot(t, s, 'r') plt.title("TSX60 index decomposition") plt.xlabel("Time [s]")

for n, imf in enumerate(imfs): plt.subplot(N,1,n+2) plt.plot(t, imf, 'g') plt.title("IMF "+str(n+1)) plt.xlabel("Time [s]")

plt.subplot(N,1,N) plt.plot(t, residue, 'r') plt.title("residue") plt.xlabel("Time [s]")

Format the x axis

plt.axes.xaxis.set_major_formatter(mdates.DateFormatter("%Y"))

plt.savefig('emd_example', dpi=120)

plt.show()

Expected behavior A clear and concise description of what you expected to happen.

Screenshots TSX60_index.csv TSX60_index.csv

If applicable, add screenshots to help explain your problem.

Running environment Provide operating system (OS) information, PyEMD version and describe virtual environment (if any).

Additional context Add any other context about the problem here.