Closed kritchie closed 1 year ago
@laszukdawid I could submit a PR depending on your call. Happy to help if I can, let me know!
Hey @kritchie,
I think the confusion is from distinguishing what is an IMF (Intrinsic Mode Function). I had a long chat initially with folks who were using this package (and also for own research). The conclusion was to extract IMFs and then any remaining is added as the residue. In such a case, if you set max_imf=3
you'll get at least 3 signals and sometimes 4 - the last being residue. If you prefer, you can also use emd.get_imfs_and_residue
method which returns tuple of (imfs, residue).
Hope this helps, Dawid
Hi @laszukdawid , thanks for your comment. I understand your point.
I still believe the documentation could be made a bit more explicit, for example the documentation of the method states: Returns IMF functions in numpy array format.
, there's no mention of the residue here.
Additionally, the return type is documented as:
Returns
-------
IMF : numpy array
Set of IMFs produced from input signal.
Maybe simply adding a [...] and residue
to those documentation strings could make it clearer.
That being said, it's not a big deal for me and I'll update my code as per your instructions.
I'm new to using EMD and I love the library, it's very useful! Thank you for your work!
Sorry for closing too early. You're right :) At the very least I could update the documentation to make this more clear.
Added info with commit 7ebc39eb449b234e401d006266430a62de2db0c5
Describe the bug From the documentation, the
`EMD.emd()
method is supposed to returnmax_imf
number of IMFsHowever, it returns that number + 1.
To Reproduce
Expected behavior Either return the appropriate number of IMFs or adjust the documentation.