1
#this program corresponds to special.py
6
from unittest import TestCase
7
import scipy_base.limits as limits
8
from scipy_test.testing import *
10
import scipy.signal as signal
13
from Numeric import array
15
class test_convolve(TestCase):
16
def check_basic(self):
19
c = signal.convolve(a,b)
20
assert_array_equal(c,array([3,10,22,28,32,32,23,12]))
22
class test_medfilt(TestCase):
23
def check_basic(self):
24
f = [[3,4,5],[2,3,4],[1,2,5]]
26
assert_array_equal(d, [[0,3,0],[2,3,3],[0,2,0]])
28
class test_wiener(TestCase):
29
def check_basic(self):
30
g = array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d')
31
correct = array([[2.16374269,3.2222222222, 2.8888888889, 1.6666666667],[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],[1.33333333333, 3.92735042735, 6.0712560386, 5.0404040404]])
33
assert_array_almost_equal(h,correct,decimal=6)
35
if __name__ == "__main__":
36
ScipyTest(signal).run()