-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
my program is as follows:
x, _ = librosa.core.load(dataset_path + "test.wav", sr=16000, mono=True)
x = x[26000:40000]
wa = WaveletAnalysis(sig, dt=0.1)
print(wa.reconstruction().shape)
An error occurred during runtime:
File "\wavelets\transform.py", line 85, in cwt
return cwt_time(data, wavelet, widths, dt, axis)
File "\wavelets\transform.py", line 105, in cwt_time
wavelet_data[slices],
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Because there is an error in your source code, as shown below,
def cwt_time(data, wavelet, widths, dt, axis):
# wavelets can be complex so output is complex
......
wavelet_data = norm * wavelet(t, width)
output[ind, :] = scipy.signal.fftconvolve(data,
wavelet_data[slices],
mode='same')
return output
it should be corrected in this way. Obviously, the sequence value operation is missing:
def cwt_time(data, wavelet, widths, dt, axis):
# wavelets can be complex so output is complex
......
wavelet_data = norm * wavelet(t, width)
output[ind, :] = scipy.signal.fftconvolve(data,
wavelet_data[slices[axis]],
mode='same')
return output
Metadata
Metadata
Assignees
Labels
No labels