[Scipy-svn] r4979 - trunk/scipy/signal/tests

scipy-svn@scip... scipy-svn@scip...
Mon Nov 3 23:48:46 CST 2008


Author: cdavid
Date: 2008-11-03 23:48:37 -0600 (Mon, 03 Nov 2008)
New Revision: 4979

Modified:
   trunk/scipy/signal/tests/test_signaltools.py
Log:
Add rank2 tests with initial conditions.

Modified: trunk/scipy/signal/tests/test_signaltools.py
===================================================================
--- trunk/scipy/signal/tests/test_signaltools.py	2008-11-04 05:48:17 UTC (rev 4978)
+++ trunk/scipy/signal/tests/test_signaltools.py	2008-11-04 05:48:37 UTC (rev 4979)
@@ -151,5 +151,21 @@
 
         y = lfilter(b, a, x, axis = 1)
         assert_array_almost_equal(y_r2_a1, y)
+
+        # Test initial condition handling
+        y_r2_a0_1 = np.array([[1, 1, 1], [7, -5, 7], [13, -11, 13],
+                              [19, -17, 19]])
+        zf_r = np.array([-5, -17, -29, -41])[:, np.newaxis]
+        y, zf = lfilter(b, a, x, axis = 1, zi = np.ones((4, 1)))
+        assert_array_almost_equal(y_r2_a0_1, y)
+        assert_array_almost_equal(zf, zf_r)
+
+        # XXX: disabled because it segfaults ATM
+        #y_r2_a0_0 = np.array([[1, 3, 5], [5, 3, 1], [1, 3, 5], [5 ,3 ,1]])
+        #zf_r = np.array([-23, -23, -23])
+        #y, zf = lfilter(b, a, x, axis = 0, zi = np.ones((1, 3)))
+        #assert_array_almost_equal(y_r2_a0_0, y)
+        #assert_array_almost_equal(zf, zf_r)
+
 if __name__ == "__main__":
     run_module_suite()



More information about the Scipy-svn mailing list