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
Filter frequencies << sampling frequency are unstable #1028
Conversation
Based on this answer, I think we should a) add a warning if the filtering frequencies are very small compared to the sampling rate, and b) switch to |
I think we should backport the second-order filter sections from scipy. This has been an annoying issue for a long time and we cannot simply depend on scipy 0.16 once available. That should be fairly quick to do and incredibly useful. |
It looks like we'd need |
The second-order sections form for filters are much more stable than the form using tranfer functions.
✨ |
Two questions..
|
No to both in my opinion. This is not a bugfix but rather a different algorithm. I would also tend to avoid having a compatibility layer and rather just merge upstream fixes into our backport if we notice them. Otherwise the danger is that the same version of ObsPy with two different scipy yields very different results. |
👍 wooooow ! I can finally remove the low+high pass two lines in msnoise :) |
Then the base branch would have to be changed..
means a maintenance overhead..
That's one way to look at it.. you could also say, having a newer scipy would immediately bring it's benefits without having to wait for a new obspy release. Also, that statement would apply to any of our dependencies. |
Sorry, I snuck this one onto the
It already does so. |
This PR works fine with scipy 0.9.0: http://tests.obspy.org/24261/ Assuming #1031 is ok with everyone and we don't merge it in releases it should be good to go. |
After testing the backport The difference between two filtering is as small as 1e-9 which can be ignored. |
Interesting.. thanks for the feedback. |
Hi,
I just found a possible question about butterworth-bandpass filtering. I download a seismogram from IRIS and try to filter it with a butterworth-bandpass filter from 0.02hz to 0.2hz, but found the result is incorrect with some extremely large number after filtering. I guess it might be caused by some kind of unstability of filtering algorithm. Here is my code:
BTW, when I decrease the sampling rate from original 50hz to 20hz, the filtering will be good. I wonder whether it might also be related to sampling rate.
I also find a similar question about scipy:
http://stackoverflow.com/questions/21862777/bandpass-butterworth-filter-frequencies-in-scipy
Since the filtering in obspy is actually based on scipy, they possibly point to one same question....
Thx