In [3]:
import numpy as np
labels = np.empty(20, np.int32)
labels[0:9] = 1 # First 10 are the first sample type, e.g. snare
labels[10:20] = 2 # Second 10 are the second sample type, e.g kick
model_snare = KNeighborsClassifier(n_neighbors = 1)
model.fit(scaledTrainingFeatures, labels.take(train_index, 0))
model_output = model_snare.predict(scaledTestingFeatures)
Extract features from the drum signals that you separated in Lab 4 Section 1.
Classify them using the K-NN model that you built.
Does K-NN accurately classify the separated signals?
Repeat for different numbers of separated signals (i.e., the parameter K
in NMF).
Overseparate the signal using K = 20
or more. For those separated components that are classified as snare, add them together using `sum}. The listen to the sum signal. Is it coherent, i.e., does it sound like a single separated drum?
...and more!
Good luck!