Skip to content
Snippets Groups Projects
Commit 9aaec377 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

added test_first_order.py

parent e6316b1f
No related branches found
No related tags found
1 merge request!19More ext
Pipeline #
'''
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment