%Doug Van Nort
%
%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 violin timbre

%%for k-means clustering

    
clusterVall = [ftVL(1:100,:);ftVL(201:300,:)];              %Store all training feature vectors for clustering - we need 
for i=6:12                                                  %to be careful not to include our training data
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end
for i=14:16
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end 
for i=18:21
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end
for i=23:26
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end 
for i=28:31
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end 
for i=33:36
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end 
for i=38:40
 clusterVall = [clusterVall; ftVL((i-1)*100+1:i*100,:)];
end 
clusterVall = [clusterVall; ftVL(4101:4200,:)];

clusterVall = [clusterVall; ftVR(1:100,:);ftVR(201:300,:)];
for i=6:12
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end
for i=14:16
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end 
for i=18:21
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end
for i=23:26
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end 
for i=28:31
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end 
for i=33:36
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end 
for i=38:40
 clusterVall = [clusterVall; ftVR((i-1)*100+1:i*100,:)];
end 
clusterVall = [clusterVall; ftVR(4101:4200,:)];
    
   
        
       
    
    
        
    
   