I am trying to bandpass filter a signal using a butterworth filter, but I am getting the following result (click to enlarge):
The original signal is the blue and the filtered one is the green.
Why does the first part of the filtered signal (from 0 to 50) is changing so much from the original? Can you help me understand why this is happening?
Here goes some details:
- Signal length: 256
- Frequency: 22Hz
- Cutoff frequencies: 0.7Hz and 3.0Hz
- Filter order: 6
nyq = 0.5 * fs low = lowcut / nyq high = highcut / nyq b, a = butter(order, [low, high], btype='band') y = lfilter(b, a, data)