3
3
import numpy as np
4
4
import numpy .testing as npt
5
5
6
- from scipy .signal import signaltools
7
- from scipy import fftpack
6
+ from scipy import fftpack , signal
8
7
9
8
import nitime
10
9
from nitime import algorithms as tsa
@@ -24,16 +23,16 @@ def test_scipy_resample():
24
23
for f in freq_list ]
25
24
tst = np .array (a ).sum (axis = 0 )
26
25
# interpolate to 128 Hz sampling
27
- t_up = signaltools .resample (tst , 128 )
26
+ t_up = signal .resample (tst , 128 )
28
27
np .testing .assert_array_almost_equal (t_up [::2 ], tst )
29
28
# downsample to 32 Hz
30
- t_dn = signaltools .resample (tst , 32 )
29
+ t_dn = signal .resample (tst , 32 )
31
30
np .testing .assert_array_almost_equal (t_dn , tst [::2 ])
32
31
33
32
# downsample to 48 Hz, and compute the sampling analytically for comparison
34
33
dn_samp_ana = np .array ([np .sin (2 * np .pi * f * np .linspace (0 , 1 , 48 , endpoint = False ))
35
34
for f in freq_list ]).sum (axis = 0 )
36
- t_dn2 = signaltools .resample (tst , 48 )
35
+ t_dn2 = signal .resample (tst , 48 )
37
36
npt .assert_array_almost_equal (t_dn2 , dn_samp_ana )
38
37
39
38
0 commit comments