Mercurial > hg > gccphat-windowing
annotate 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 |
rev | line source |
---|---|
alice@0 | 1 %Script to run analysis of 20 audio samples. GCC-PHAT is calculated for |
alice@0 | 2 %each audio sample using all framesizes in frameSizeVec and windows in |
alice@0 | 3 %winShapes |
alice@0 | 4 |
alice@0 | 5 |
alice@0 | 6 % Developer: - Alice Clifford (alice.clifford@eecs.qmul.ac.uk) |
alice@0 | 7 |
alice@0 | 8 |
alice@0 | 9 close all |
alice@0 | 10 clear all |
alice@0 | 11 |
alice@0 | 12 Fs=44100; |
alice@0 | 13 |
alice@0 | 14 |
alice@0 | 15 frameSizeVec=[128 256 512 1024 2048 4096 8192]; %framesizes to test |
alice@0 | 16 |
alice@0 | 17 winShapes={ %window shapes to test |
alice@0 | 18 'blackman', |
alice@0 | 19 'blackmanharris', |
alice@0 | 20 'flattopwin', |
alice@0 | 21 'gausswin', |
alice@0 | 22 'hamming', |
alice@0 | 23 'hann', |
alice@0 | 24 'rectwin', |
alice@0 | 25 }; |
alice@0 | 26 |
alice@0 | 27 ds=50; %actual delay derived from visual analysis |
alice@0 | 28 |
alice@0 | 29 PATH='audio/'; |
alice@0 | 30 fid=fopen('analysisFileNames_041112.txt'); |
alice@0 | 31 tempNames=textscan(fid,'%s'); |
alice@0 | 32 |
alice@0 | 33 numFiles=length(tempNames{1}); |
alice@0 | 34 |
alice@0 | 35 fileNames=cell(numFiles,1); |
alice@0 | 36 |
alice@0 | 37 |
alice@0 | 38 for f=1:length(frameSizeVec) |
alice@0 | 39 f |
alice@0 | 40 frameSize=frameSizeVec(f); |
alice@0 | 41 hopSize=frameSize/4; |
alice@0 | 42 |
alice@0 | 43 for n=1:numFiles |
alice@0 | 44 n |
alice@0 | 45 fileNames{n}=tempNames{1}{n}; |
alice@0 | 46 fullPath=strcat(PATH,fileNames{n}); |
alice@0 | 47 |
alice@0 | 48 |
alice@0 | 49 |
alice@0 | 50 [x,Fs]=wavread(fullPath); |
alice@0 | 51 |
alice@0 | 52 for w=1:length(winShapes) |
alice@0 | 53 w |
alice@0 | 54 |
alice@0 | 55 delayVec(:,n,w)=gccPHATFunc_win(x,frameSize,hopSize,winShapes{w}); |
alice@0 | 56 percHitsMat(n,w)=percCorr(delayVec(:,n,w),ds,2); %estimate percentage correct |
alice@0 | 57 end |
alice@0 | 58 |
alice@0 | 59 |
alice@0 | 60 |
alice@0 | 61 |
alice@0 | 62 end |
alice@0 | 63 |
alice@0 | 64 |
alice@0 | 65 % save(strcat('Results/accuracyData_240512_framesize',int2str(frameSize))) |
alice@0 | 66 % %uncomment to save results |
alice@0 | 67 |
alice@0 | 68 clear delayVec percHitsMat mseMat euclidMat |
alice@0 | 69 |
alice@0 | 70 |
alice@0 | 71 |
alice@0 | 72 |
alice@0 | 73 |
alice@0 | 74 |
alice@0 | 75 |
alice@0 | 76 end |
alice@0 | 77 |
alice@0 | 78 display('Instrument audio analysis complete') |