diff Real/runAllAnalysis_20files_7windows_7framesizes.m @ 0:ab043bd3b162 tip

First commit
author Alice Clifford <alice.clifford@eecs.qmul.ac.uk>
date Mon, 11 Jun 2012 17:42:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Real/runAllAnalysis_20files_7windows_7framesizes.m	Mon Jun 11 17:42:13 2012 +0100
@@ -0,0 +1,78 @@
+%Script to run analysis of 20 audio samples. GCC-PHAT is calculated for
+%each audio sample using all framesizes in frameSizeVec and windows in
+%winShapes
+
+
+% Developer:  - Alice Clifford (alice.clifford@eecs.qmul.ac.uk)
+
+
+close all
+clear all
+
+Fs=44100;
+
+
+frameSizeVec=[128 256 512 1024 2048 4096 8192]; %framesizes to test
+
+winShapes={ %window shapes to test
+    'blackman',
+    'blackmanharris',
+    'flattopwin',
+    'gausswin',
+    'hamming',
+    'hann',
+    'rectwin',
+    };
+
+ds=50;  %actual delay derived from visual analysis
+
+PATH='audio/';
+fid=fopen('analysisFileNames_041112.txt');
+tempNames=textscan(fid,'%s');
+
+numFiles=length(tempNames{1});
+
+fileNames=cell(numFiles,1);
+
+
+for f=1:length(frameSizeVec)
+    f
+    frameSize=frameSizeVec(f);
+    hopSize=frameSize/4;
+    
+    for n=1:numFiles
+        n
+        fileNames{n}=tempNames{1}{n};
+        fullPath=strcat(PATH,fileNames{n});
+        
+        
+        
+        [x,Fs]=wavread(fullPath);
+        
+        for w=1:length(winShapes)
+            w
+            
+            delayVec(:,n,w)=gccPHATFunc_win(x,frameSize,hopSize,winShapes{w});
+            percHitsMat(n,w)=percCorr(delayVec(:,n,w),ds,2); %estimate percentage correct
+        end
+        
+        
+        
+        
+    end
+    
+    
+%     save(strcat('Results/accuracyData_240512_framesize',int2str(frameSize)))
+%     %uncomment to save results
+    
+    clear delayVec percHitsMat mseMat euclidMat
+    
+    
+    
+    
+    
+    
+    
+end
+
+display('Instrument audio analysis complete')