laszukdawid / PyEMD

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

max_imf parameter issue #98

Closed DivyaShyamSingh closed 3 years ago

DivyaShyamSingh commented 3 years ago

I am trying to calculate the IMFs for the time-series data I have using CEEMDAN. In order to speed up the process, I have tried the things mentioned on the website. Everything works for me except for the max_imf parameter. Currently, I have set the max_imf = 3. However, I still receive 7 IMFs. The following is the small code that I am using

if __name__ == '__main__':   
    emd=CEEMDAN(DTYPE=np.float16,trials=75,parallel=True,processes=16,max_imf=3)
    IMFs = emd(data)

where 'data' is a simple 1D numpy array of length 10000. The result I receive (as IMFs) is a 2D NumPy array of shape 7x10000.

Ideally, I should receive a 2D NumPy array of shape 3x10000 because I set the max_imf=3. Is there something which I am doing wrong?

laszukdawid commented 3 years ago

I think the issue here is that max_imf isn't an argument for CEEMDAN but for your emd, i.e.

ceemdan = CEEMDAN(DTYPE=np.float16,trials=75,parallel=True,processes=16)
IMFs = ceemdan(data, max_imf=3)

Please see docs: https://pyemd.readthedocs.io/en/latest/ceemdan.html. Just noticed that ceemdan.__call__, i.e. the execution line, isn't in the doc. I'll update that.

laszukdawid commented 3 years ago

Just updated (c974984cd3324cbb733446fa2adb00dc12edd842) docs to add ceemdan method docstring.

Closing the issue. Let me know if you need more help.