%Doug Van Nort MUMT 611 Final Project
%
%This Matlab script computes the k means clustering part of an HMM timbre
%recgonition system. This is used for vector quantization of a discrete
%observation probability densities.
%
%in this script we compute clustering for modeling of trumpet timbre



clusterTall = [ftTL(1:100,:);ftTL(201:300,:)];              %Store all training feature vectors for clustering - we need 
for i=6:12                                                  %to be careful not to include our training data
 clusterTall = [clusterTall; ftTL((i-1)*100+1:i*100,:)];
end
for i=14:16
 clusterTall = [clusterTall; ftTL((i-1)*100+1:i*100,:)];
end 
for i=18:19
 clusterTall = [clusterTall; ftTL((i-1)*100+1:i*100,:)];
end
clusterTall = [clusterTall; ftTL(2000+1:2100,:)];
for i=23:26
 clusterTall = [clusterTall; ftTL((i-1)*100+1:i*100,:)];
end 
for i=28:29
 clusterTall = [clusterTall; ftTL((i-1)*100+1:i*100,:)];
end 
clusterTall = [clusterTall; ftTL(3001:3100,:)];
for i=33:34
 clusterTall = [clusterTall; ftTL((i-1)*100+1:i*100,:)];
end 

clusterTall = [clusterTall; ftTR(1:100,:);ftTR(201:300,:)];
for i=6:12
 clusterTall = [clusterTall; ftTR((i-1)*100+1:i*100,:)];
end
for i=14:16
 clusterTall = [clusterTall; ftTR((i-1)*100+1:i*100,:)];
end 
for i=18:19
 clusterTall = [clusterTall; ftTR((i-1)*100+1:i*100,:)];
end
clusterTall = [clusterTall; ftTR(2000+1:2100,:)];
for i=23:26
 clusterTall = [clusterTall; ftTR((i-1)*100+1:i*100,:)];
end 
for i=28:29
 clusterTall = [clusterTall; ftTR((i-1)*100+1:i*100,:)];
end 
clusterTall = [clusterTall; ftTL(3001:3100,:)];
for i=33:34
 clusterTall = [clusterTall; ftTR((i-1)*100+1:i*100,:)];
end
            
end

