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