Exemple #1
0
 def test_return_all_signals_with_reference(self):
     "Tests with return all signals with reference."
     output = NormalizeSignal(self.signal,
                              self.reference,
                              fs=self.fs,
                              return_all_signals=True)
     self.assertEqual(len(output), 5)
Exemple #2
0
 def test_no_reference_nor_detrend(self):
     "Tests with no reference and no detrend."
     output = NormalizeSignal(self.signal, fs=self.fs, detrend=False)
     test_output = FilterSignal(self.signal, highcut=40.0, fs=self.fs)
     test_output = DeltaFOverF(test_output)
     equal = np.array_equal(test_output, output)
     self.assertTrue(equal)
Exemple #3
0
 def test_no_reference_with_detrend(self):
     "Tests with no reference but detrend"
     output = NormalizeSignal(self.signal, fs=self.fs, detrend=True)
     test_output = FilterSignal(self.signal, highcut=40.0, fs=self.fs)
     test_output = DeltaFOverF(test_output)
     test_output = test_output - FilterSignal(test_output, btype='savgol')
     equal = np.array_equal(test_output, output)
     self.assertTrue(equal)
 def test_correct_functionality(self):
     "Tests that NormalizeSignal is run correctly"
     ProcessSignalData(seg=self.segment, sig_ch='Signal', ref_ch='Reference', 
         name='Test', fs=self.fs)
     output = self.segment.analogsignals[-1].magnitude
     test_signal = NormalizeSignal(self.analog1, self.analog2, fs=self.fs)
     equal = np.array_equal(output, test_signal)
     self.assertTrue(equal)
 def test_with_reference_no_detrend(self):
     "Tests with reference and no detrend."
     output = NormalizeSignal(self.signal, self.reference, 
         fs=self.fs, detrend=False)
     test_sig = FilterSignal(self.signal, highcut=40.0, fs=self.fs)
     test_ref = FilterSignal(self.reference, highcut=40.0, fs=self.fs)
     test_sig = DeltaFOverF(test_sig)
     test_ref = DeltaFOverF(test_ref)
     test_output = test_sig - test_ref
     equal = np.array_equal(test_output, output)
     self.assertTrue(equal)