@@ -117,7 +117,8 @@ def resample(x, sr_orig, sr_new, axis=-1, filter='kaiser_best', parallel=True, *
117117 interp_win , precision , _ = get_filter (filter , ** kwargs )
118118
119119 if sample_ratio < 1 :
120- interp_win *= sample_ratio
120+ # Make a copy to prevent modifying the filters in place
121+ interp_win = sample_ratio * interp_win
121122
122123 interp_delta = np .zeros_like (interp_win )
123124 interp_delta [:- 1 ] = np .diff (interp_win )
@@ -205,7 +206,7 @@ def resample_nu(x, sr_orig, t_out, axis=-1, filter='kaiser_best', parallel=True,
205206
206207 t_out = np .asarray (t_out )
207208 if t_out .ndim != 1 :
208- raise ValueError ('Invalide t_out shape ({}), 1D array expected' .format (t_out .shape ))
209+ raise ValueError ('Invalid t_out shape ({}), 1D array expected' .format (t_out .shape ))
209210 if np .min (t_out ) < 0 or np .max (t_out ) > (x .shape [axis ] - 1 ) / sr_orig :
210211 raise ValueError ('Output domain [{}, {}] exceeds the data domain [0, {}]' .format (
211212 np .min (t_out ), np .max (t_out ), (x .shape [axis ] - 1 ) / sr_orig ))
@@ -214,10 +215,6 @@ def resample_nu(x, sr_orig, t_out, axis=-1, filter='kaiser_best', parallel=True,
214215 shape = list (x .shape )
215216 shape [axis ] = len (t_out )
216217
217- if shape [axis ] < 1 :
218- raise ValueError ('Input signal length={} is too small to '
219- 'resample from {}->{}' .format (x .shape [axis ], x .shape [axis ], len (t_out )))
220-
221218 y = np .zeros_like (x , shape = shape )
222219
223220 interp_win , precision , _ = get_filter (filter , ** kwargs )
0 commit comments