I have implemented a python butterworth filter but it seems to shift the data a lot, the x location of my data is very important to me for my analysis. Is there a way to correct for this shift precisely?

Does it shift all the data uniformly? Or does certain areas get shifted further/less far that others?

  • $\begingroup$ This answer might be helpful. $\endgroup$ – Matt L. Aug 27 '14 at 21:08
  • $\begingroup$ This is useful, and i believe i am using an FIR filter. Its just a butterworth filter created with scipy.butter How do i know if my filter is linear-phase and FIR? Once i determine that is there a way to determine the shift from the filter specifications? $\endgroup$ – Aaron Silman Aug 27 '14 at 21:12
  • 2
    $\begingroup$ Your filter is an IIR filter (it has numerator and denominator coefficients called b and a), so unfortunately there is no constant delay. Different frequencies of the input signal experience different delays. $\endgroup$ – Matt L. Aug 27 '14 at 21:14
  • $\begingroup$ Is there a filter that is recommended for creating a bandpass near low frequencies that has a defined shift (or maybe one that reduces shift as much as possible automatically)? $\endgroup$ – Aaron Silman Aug 27 '14 at 21:25
  • 1
    $\begingroup$ You can try to design a linear phase FIR filter for the given specifications. However, if you need a steep filter with high stopband attenuation, then the delay will be quite large due to the high filter length. $\endgroup$ – Matt L. Aug 28 '14 at 6:48

The delay or "shift" of an IIR butterworth filter varies with frequency. If you want a constant delay that you can correct for in a simple manner, you need to instead use a linear phase FIR filter, not an IIR filter.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.