laszukdawid / PyEMD

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

Unable to compute imfs #99

Closed Aditya-Dawadikar closed 2 years ago

Aditya-Dawadikar commented 3 years ago

I wanted to use EMD in Anaconda Jupyter, but the package is only available on PyPI. I cloned the repository and copied the EMD class and all its dependencies in my working directory, and edited the source code to adjust the import paths for the files.

The .py file were imported successfully in Jupyter. When I created an object of EMD class, I tried passing a signal to emd() with max_imf as 3. The function never stops execution, neither it gives any output.

I have attached my Jupyter code.

image

laszukdawid commented 3 years ago

Hey @Aditya-Dawadikar,

Based on you file name I'm assuming you were trying to use it on audio file. Which like means a lot of data samples and a lot of extrema. What's more, wav audio (if I recall correctly) is in ints which can be problematic, i.e. shifts extrema.

My suggestion is to try with short array and gradually increase length and see how long it takes to decompose. You should get some estimate on how long you'd need to wait for the full file. Additionally, try different stopping configurations and different spline methods. You can read more in the doc: https://pyemd.readthedocs.io/en/latest/speedup_eemd.html