[Scipy-svn] r7019 - trunk/scipy/signal/tests
scipy-svn at scipy.org
scipy-svn at scipy.org
Tue Dec 21 23:05:47 EST 2010
Author: warren.weckesser
Date: 2010-12-21 22:05:46 -0600 (Tue, 21 Dec 2010)
New Revision: 7019
Modified:
trunk/scipy/signal/tests/test_fir_filter_design.py
Log:
3K: signal: use explicit integer division in FIR filter tests where appropriate
Modified: trunk/scipy/signal/tests/test_fir_filter_design.py
===================================================================
--- trunk/scipy/signal/tests/test_fir_filter_design.py 2010-12-19 14:19:41 UTC (rev 7018)
+++ trunk/scipy/signal/tests/test_fir_filter_design.py 2010-12-22 04:05:46 UTC (rev 7019)
@@ -104,7 +104,7 @@
taps = firwin(ntaps, cutoff=0.5, window=('kaiser', beta), scale=False)
# Check the symmetry of taps.
- assert_array_almost_equal(taps[:ntaps/2], taps[ntaps:ntaps-ntaps/2-1:-1])
+ assert_array_almost_equal(taps[:ntaps//2], taps[ntaps:ntaps-ntaps//2-1:-1])
# Check the gain at a few samples where we know it should be approximately 0 or 1.
freq_samples = np.array([0.0, 0.25, 0.5-width/2, 0.5+width/2, 0.75, 1.0])
@@ -123,7 +123,7 @@
pass_zero=False, scale=False)
# Check the symmetry of taps.
- assert_array_almost_equal(taps[:ntaps/2], taps[ntaps:ntaps-ntaps/2-1:-1])
+ assert_array_almost_equal(taps[:ntaps//2], taps[ntaps:ntaps-ntaps//2-1:-1])
# Check the gain at a few samples where we know it should be approximately 0 or 1.
freq_samples = np.array([0.0, 0.25, 0.5-width/2, 0.5+width/2, 0.75, 1.0])
@@ -138,7 +138,7 @@
pass_zero=False, scale=False)
# Check the symmetry of taps.
- assert_array_almost_equal(taps[:ntaps/2], taps[ntaps:ntaps-ntaps/2-1:-1])
+ assert_array_almost_equal(taps[:ntaps//2], taps[ntaps:ntaps-ntaps//2-1:-1])
# Check the gain at a few samples where we know it should be approximately 0 or 1.
freq_samples = np.array([0.0, 0.2, 0.3-width/2, 0.3+width/2, 0.5,
@@ -154,7 +154,7 @@
pass_zero=True, scale=False)
# Check the symmetry of taps.
- assert_array_almost_equal(taps[:ntaps/2], taps[ntaps:ntaps-ntaps/2-1:-1])
+ assert_array_almost_equal(taps[:ntaps//2], taps[ntaps:ntaps-ntaps//2-1:-1])
# Check the gain at a few samples where we know it should be approximately 0 or 1.
freq_samples = np.array([0.0, 0.1, 0.2-width/2, 0.2+width/2, 0.35,
@@ -175,7 +175,7 @@
pass_zero=False, scale=False, nyq=nyquist)
# Check the symmetry of taps.
- assert_array_almost_equal(taps[:ntaps/2], taps[ntaps:ntaps-ntaps/2-1:-1])
+ assert_array_almost_equal(taps[:ntaps//2], taps[ntaps:ntaps-ntaps//2-1:-1])
# Check the gain at a few samples where we know it should be approximately 0 or 1.
freq_samples = np.array([0.0, 200, 300-width/2, 300+width/2, 500,
@@ -288,8 +288,8 @@
# make sure the filter has correct # of taps
assert_(len(h) == N, "Number of Taps")
- # make sure it is type III (anti-symmtric tap coefficients)
- assert_array_almost_equal(h[:(N-1)/2], -h[:-(N-1)/2-1:-1])
+ # make sure it is type III (anti-symmetric tap coefficients)
+ assert_array_almost_equal(h[:(N-1)//2], -h[:-(N-1)//2-1:-1])
# Since the requested response is symmetric, all even coeffcients
# should be zero (or in this case really small)
More information about the Scipy-svn
mailing list