def apply_butter_filter(self, data, order, cutoff, btype): cutoff /= self.nyq b, a = butter(N=order, Wn=cutoff, btype=btype) return filtfilt(b, a, data, axis=1)