laszukdawid / PyEMD

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

Bug fix - First IMF obtained from EEMD with zeros #71

Closed rfmiotto closed 4 years ago

rfmiotto commented 4 years ago

The _eemd method was being applied to get the first IMF, and it was returning a null IMF. That is because the iterator all_IMFs was being used more than once, which would raise a StopIteration exception after its first use. Then, the code wasn't entering the loop to give values to E_IMF because all_IMFs was an empty list. There are 2 ways to fix this problem: (1) simply convert the iterator to a list before the next use, or (2) create two more iterators using itertools.tee. In this commit, option (2) is employed.

laszukdawid commented 4 years ago

Thanks for creating a pull request. I appreciate putting time to fixing this.

Build is failing due to spuriously different EEMD results due to different noise.