laszukdawid / PyEMD

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

The ‘residuum’ in CEEMDAN and the decomposition is unstable #42

Closed KrisLeezz closed 5 years ago

KrisLeezz commented 5 years ago

Hello, I am coming again. I try the CEEMDAN() and found some problem. There may be an error about the residuum in the ceemdan(). In my test, the residuum was strange.
This is the result: image CEEMDAN can reconstruct the signal exactly. So, I checked the code. The signal S is scaled S[:] = S/scale_s. The residuum is S-np.sum(C_IMFs, axis=0). S has been changed. I passed the parameter S to the function ceemdan(), and I think the value of S shouldn't be changed. I'm not proficient in programming, this thought maybe wrong.

Another thing is that the decomposition results are unstable. I fixed the S. Except this, I did nothing about codes. This is the second result with he same data S: image This is the third result: image

Why is it?

BlockWaving commented 5 years ago

This looks like the distorting caused by 'end effects' of EMD method. There are numerous academic paper discussed how to mitigate this problem. Here is link to one such paper that gives thorough explanation as well a possible solution to the problem: https://web.nmsu.edu/~spsandov/papers/GlobalSIP2018_Mitigate_End_Effects.pdf

laszukdawid commented 5 years ago

Hey both, apologies for the delay.

Thanks @KrisLeezz for sharing your results. There are plenty of caveats to EMD-related methods. The main one that will affect any results is that there is no "ideal" spline technique. If you are using the default setting for EMD then you are most likely using the Cubic spline. This is not only slow, as it requires transforming a matrix with as many rows are there are extrema, but it also tends to overshoot (sudden value jumps) to make smooth transition down-the-line. Having many of these overshoots in "weird" spots over many iterations will create a component that is not there. (At least from traditional, since-focused human point of view.) From my experience, these "weird spots" occure more often when the noise-to-signal ratio is large; when on short time-span minimum and maximum of similar values are followed by another extremum of significantly different value

Given that your signals are very noisy it this might happen often. Over few years of research I wasn't able to confirm EMD's "magical" properties to robustly handle noise.

Referring to you commend about the stability. CEEMDAN, same as EEMD, is intrinsically unstable. Its premise is that on a infinite ensemble (in practise "sufficiently large") of white noise assisted replicas the decomposition set will converge. Unless you want to fix pseudo-randomness each CEEMDAN execution will create a different component set. Hopefully, these component sets will be similar enough and sufficient for the need but if you see them being different I'd suggest increasing the number of performed iterations.

What I find interesting from your graphs is that the "original" signal has rather low amplitude compared to produced components. Could you confirm where are you getting this from? If that's on my side then it definitely needs fixing.

In the last of your graphs the residue is mainly composed of the machine epsilon noise. In practise, consider this as a 0-component ;-)

KrisLeezz commented 5 years ago

Thanks for your help. I need to think more serious about this method. The strange display of results is may be caused by the codes. Line 172 in CEEMD.py, the S is scaled by scale_s and the value of S is changed. The changed S is continued to be used to calculate residuum. I think this is the cause of 'low amplitude original signal'.