Skip to content

feat(core): Butterworth filter

Arin Wongprommoon requested to merge issue-025 into master

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:

REFERENCES:

Merge request reports