Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signal.hilbert incorrect axis handling for 2d input (Trac #1093) #1620

Closed
scipy-gitbot opened this issue Apr 25, 2013 · 4 comments
Closed

signal.hilbert incorrect axis handling for 2d input (Trac #1093) #1620

scipy-gitbot opened this issue Apr 25, 2013 · 4 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac scipy.signal
Milestone

Comments

@scipy-gitbot
Copy link

Original ticket http://projects.scipy.org/scipy/ticket/1093 on 2010-01-17 by @josef-pkt, assigned to unknown.

signal.hilbert returns incorrect results if the input matrix is 2d.
reported by Ariel Rokim,
see thread http://mail.scipy.org/pipermail/scipy-dev/2010-January/013686.html

The problem is that fft is done with axis=0, ifft is done with default axis -1

Proposed fix and enhancement:

  • add correct axis statement to all function calls
  • make axis a keyword argument
  • set default axis=-1 to be consistent with usage for fft, this changes the API compared to the description in current docstring. However, since 2d is currently not working correctly it wouldn't break any existing code, since it would be incorrect already.

script with rewritten function and test cases by Ariel are attached

@scipy-gitbot
Copy link
Author

Attachment added by @josef-pkt on 2010-01-17: try_signalhilbert.py

@scipy-gitbot
Copy link
Author

@josef-pkt wrote on 2010-01-17

Note: test in script and docstring for changed function needs some cosmetic changes and adjustments.

@scipy-gitbot
Copy link
Author

@josef-pkt wrote on 2010-01-18

committed in 8348983

not sure whether N argument makes sense but added regression tests for it

I keep this open for now, in case someone wants to review and comment e.g. on axis change

@scipy-gitbot
Copy link
Author

@josef-pkt wrote on 2010-02-03

no comment, I'm closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac scipy.signal
Projects
None yet
Development

No branches or pull requests

1 participant