Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyAudioAnalysis/ShortTermFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ def chroma_features(signal, sampling_rate, num_fft):
else:
I = np.nonzero(num_chroma > num_chroma.shape[0])[0][0]
C = np.zeros((num_chroma.shape[0],))
C[num_chroma[0:I - 1]] = spec
C /= num_freqs_per_chroma
if I > 1:
# If I <= 1 there are no chroma features that can be extracted
C[num_chroma[0:I - 1]] = spec[num_chroma[0:I - 1]]
C /= num_freqs_per_chroma
final_matrix = np.zeros((12, 1))
newD = int(np.ceil(C.shape[0] / 12.0) * 12)
C2 = np.zeros((newD,))
Expand Down