I'm trying to make a bandstop digital filter. I have used butterworth signal library to make a highpass filter, but using same technique I cannot achieve this bandstop filter. Here's an example:
from scipy import signal Bx = data.data[0,] By = data.data[1,] Bxfft = (Bx[100:-100]) Byfft = (By[100:-100]) Sampling = float(266336) / 300 HalfSampling = float(Sampling) / 2 Wn = float(1) / HalfSampling b, a = signal.butter(3, Wn, 'high') BxHPF = signal.filtfilt(b, a, Bxfft) ByHPF = signal.filtfilt(b, a, Byfft)
So for my bandstop filter I need to cutoff 50 Hz, so I try to take lowcut at 49.9 Hz and Highcut at 50.1 Hz, and the order settled at 3. Do You have any ideas how to achieve that?