diff --git a/wetb/signal_tools/tests/test_first_order.py b/wetb/signal_tools/tests/test_first_order.py new file mode 100644 index 0000000000000000000000000000000000000000..8fc364c1d3c0c9ddc3d2d4559cde25f007ee6c56 --- /dev/null +++ b/wetb/signal_tools/tests/test_first_order.py @@ -0,0 +1,34 @@ +''' +Created on 13. jan. 2017 + +@author: mmpe +''' +import unittest +from wetb.signal_tools.filters import first_order +import numpy as np + +class Test_first_order_filters(unittest.TestCase): + + + def test_low_pass(self): + a = np.random.randint(0,100,100).astype(np.float) + b = first_order.low_pass(a, 1, 1) + self.assertLess(b.std(), a.std()) + if 0: + import matplotlib.pyplot as plt + plt.plot(a) + plt.plot(b) + plt.show() + + def test_high_pass(self): + a = np.random.randint(0,100,100).astype(np.float) + b = first_order.high_pass(a, 1, 1) + self.assertLess(b.mean(), a.mean()) + if 1: + import matplotlib.pyplot as plt + plt.plot(a) + plt.plot(b) + plt.show() +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() \ No newline at end of file