feat(core): Butterworth filter
WHY IS THIS CHANGE NEEDED?:
- as an alternate way to remove long-term trends in time series -- applying a low-pass filter.
HOW DOES THE CHANGE SOLVE THE PROBLEM?:
- general wrapper for scipy.signal.butter in case the process is useful for other things
- renamed parameters from scipy.signal.butter to make them more informative
- wrap filter design (butter) and filter application (sosfiltfilt) in butterfilter -- they are used together anyway. and this makes pandas operations in run() easier to read
- subtract mean to correct initial time points
- applied filter twice to eliminate phase shift
- grafted the original column names onto the output to preserve time units
WHAT SIDE EFFECTS DOES THIS CHANGE HAVE?:
- chucks out time series that have NaNs
EVIDENCE THAT COMMIT WORKS:
- tested with the examples in https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html and modified parameters to match -- output identical to shown
- tested with real data
REFERENCES:
- Issue #25 (closed)
Merge request reports
Activity
Please register or sign in to reply