@@ -183,15 +183,14 @@ def time_frequency(
183
183
bounds_error = False ,
184
184
fill_value = (gram [:, 0 ], gram [:, - 1 ]),
185
185
)
186
+ signal = interpolator (np .arange (length ))
186
187
else :
187
188
# NOTE: This is a special case where there is only one time interval.
188
189
# scipy 1.10 and above handle this case directly with the interp1d above,
189
190
# but older scipy's do not. This is a workaround for that.
190
191
#
191
192
# In the 0.9 release, we can bump the minimum scipy to 1.10 and remove this
192
- interpolator = _const_interpolator (gram [:, 0 ])
193
-
194
- signal = interpolator (np .arange (length ))
193
+ signal = np .tile (gram [:, 0 ], (1 , length ))
195
194
196
195
for n , frequency in enumerate (frequencies ):
197
196
# Get a waveform of length samples at this frequency
@@ -213,17 +212,6 @@ def time_frequency(
213
212
return output
214
213
215
214
216
- def _const_interpolator (value ):
217
- """Return a function that returns `value`
218
- no matter the input.
219
- """
220
-
221
- def __interpolator (x ):
222
- return value
223
-
224
- return __interpolator
225
-
226
-
227
215
def _fast_synthesize (frequency , n_dec , fs , function , length ):
228
216
"""Efficiently synthesize a signal.
229
217
Generate one cycle, and simulate arbitrary repetitions
0 commit comments