From 9c60875b5831c923dba0fbb40c2450421b2a2d9d Mon Sep 17 00:00:00 2001 From: Justin Bacle Date: Mon, 20 Jul 2020 11:18:39 +0200 Subject: [PATCH] Fixed array casting error on edges of chroma_features --- pyAudioAnalysis/ShortTermFeatures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyAudioAnalysis/ShortTermFeatures.py b/pyAudioAnalysis/ShortTermFeatures.py index 82ff5c18..5ee4edf2 100644 --- a/pyAudioAnalysis/ShortTermFeatures.py +++ b/pyAudioAnalysis/ShortTermFeatures.py @@ -271,7 +271,7 @@ def chroma_features(signal, sampling_rate, num_fft): spec = signal ** 2 if num_chroma.max() < num_chroma.shape[0]: C = np.zeros((num_chroma.shape[0],)) - C[num_chroma] = spec + C[num_chroma] = np.pad(spec, (0, len(C[num_chroma]) - len(spec))) C /= num_freqs_per_chroma[num_chroma] else: I = np.nonzero(num_chroma > num_chroma.shape[0])[0][0]