@@ -79,15 +79,7 @@ def __init__(self,
79
79
80
80
81
81
self .block_size = block_size
82
- if block_size > 1 :
83
- # num_zeros = 4 is a lower-than-normal width for the FIR filter since there
84
- # won't be frequencies near the Nyquist and we don't need a sharp cutoff.
85
- # filter_cutoff_ratio = 9 is to avoid aliasing effects with this less-precise
86
- # filter (default is 0.95).
87
- self .resampler = resampler .Resampler (block_size , num_zeros = 4 ,
88
- filter_cutoff_ratio = 0.9 ,
89
- double_precision = double_precision )
90
-
82
+ assert block_size > 1
91
83
92
84
def compute (self ,
93
85
input ):
@@ -142,7 +134,13 @@ def compute(self,
142
134
smoothed_amplitudes = self .gaussian_filter .apply (summed_amplitudes )
143
135
assert smoothed_amplitudes .shape == summed_amplitudes .shape
144
136
145
- upsampled_amplitudes = self .resampler .upsample (smoothed_amplitudes )
137
+ # num_zeros = 4 is a lower-than-normal width for the FIR filter since there
138
+ # won't be frequencies near the Nyquist and we don't need a sharp cutoff.
139
+ # filter_cutoff_ratio = 9 is to avoid aliasing effects with this less-precise
140
+ # filter (default is 0.95).
141
+ self .resampler = resampler .Resampler (1 , self .block_size , dtype = self .dtype , num_zeros = 4 ,
142
+ cutoff_ratio = 0.9 )
143
+ upsampled_amplitudes = self .resampler .resample (smoothed_amplitudes )
146
144
assert upsampled_amplitudes .shape [1 ] >= signal_length
147
145
148
146
0 commit comments