def test_bandstop_filter_design_works(self): "Makes sure bandstop filter design works" output = ButterFilterDesign(lowcut=self.low, highcut=self.high, fs=self.fs, order=self.order, btype='bandstop') check = ssp.butter(self.order, [self.low/(self.fs*.5), self.high/(self.fs*.5)], btype='bandstop') self.assertTrue(np.array_equal(output, check))
def test_bandstop_works(self): "Tests bandpass functionality" signal = FilterSignal(self.signal, lowcut=self.lowcut, highcut=self.highcut, fs=self.fs, order=self.order, btype='bandstop') b, a = ButterFilterDesign(lowcut=self.lowcut, highcut=self.highcut, fs=self.fs, order=self.order, btype='bandstop') test_signal = ssp.filtfilt(b, a, self.signal) equal = np.array_equal(signal, test_signal) self.assertTrue(equal)
def test_highpass_filter_design_works(self): "Makes sure highpass filter design works" output = ButterFilterDesign(lowcut=self.low, fs=self.fs, order=self.order, btype='highpass') check = ssp.butter(self.order, self.low / (self.fs * .5), btype='highpass') self.assertTrue(np.array_equal(output, check))