Mercurial > hg > gccphat-windowing
comparison Real/accuracyVspecSpread.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 plot the accuracy of Rectangular and Hann window for different windowshapes against spectral spread of audio file | |
2 | |
3 %Developer: - Alice Clifford (alice.clifford@eecs.qmul.ac.uk) | |
4 | |
5 clear all | |
6 close all | |
7 | |
8 | |
9 load 'Results/accuracyData_290512_frameSize2048' | |
10 load 'SpectralAnalysis/specSpreadData' | |
11 | |
12 | |
13 figWidth=7; | |
14 figHeight=4; | |
15 | |
16 fid=fopen('analysisInstNames_041112.txt'); | |
17 tempNames=textscan(fid,'%s'); | |
18 numNames=length(tempNames{1}); | |
19 | |
20 instNames=cell(numNames,1); | |
21 | |
22 | |
23 for n=1:numNames | |
24 instNames{n}=tempNames{1}{n}; | |
25 end | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 percHits_rect=percHitsMat(:,7); %extract data for rectangular window | |
32 | |
33 figure | |
34 | |
35 set(gcf, 'units', 'inches', 'pos', [0 1000 figWidth figHeight]) | |
36 | |
37 scatter(spreadData,percHits_rect,'k.') | |
38 | |
39 set(gca,'FontSize',8) | |
40 ylim([0 100]) | |
41 xlim([min(spreadData)-100 max(spreadData)+100]) | |
42 | |
43 | |
44 | |
45 %PLOT TEXT LABELS | |
46 for n=1:length(percHits_rect) | |
47 if n==11 %Electric Guitar | |
48 text(spreadData(n)-600,percHits_rect(n),instNames{n},'FontSize',8); | |
49 | |
50 elseif n==17 %Bass Recorder | |
51 | |
52 text(spreadData(n)+50,percHits_rect(n),instNames{n},'FontSize',8); | |
53 elseif n==1 %Female Vocal | |
54 | |
55 text(spreadData(n)+50,percHits_rect(n),instNames{n},'FontSize',8); | |
56 elseif n==14 %Shaker | |
57 | |
58 text(spreadData(n)-350,percHits_rect(n)-2,instNames{n},'FontSize',8); | |
59 | |
60 elseif n==15 %Tambourine | |
61 | |
62 text(spreadData(n)-550,percHits_rect(n),instNames{n},'FontSize',8); | |
63 | |
64 | |
65 elseif n==4 %Snare | |
66 | |
67 text(spreadData(n)+50,percHits_rect(n),instNames{n},'FontSize',8); | |
68 | |
69 | |
70 elseif n==12 %Male Vocal | |
71 | |
72 text(spreadData(n)-450,percHits_rect(n),instNames{n},'FontSize',8); | |
73 | |
74 elseif n==8 %Violin | |
75 | |
76 text(spreadData(n)+50,percHits_rect(n)-2,instNames{n},'FontSize',8); | |
77 elseif n==13 %Rhodes | |
78 | |
79 text(spreadData(n)+50,percHits_rect(n)+2,instNames{n},'FontSize',8); | |
80 | |
81 elseif n==16 %Acoustic Guitar | |
82 | |
83 text(spreadData(n)-625,percHits_rect(n),instNames{n},'FontSize',8); | |
84 | |
85 else | |
86 text(spreadData(n)+50,percHits_rect(n),instNames{n},'FontSize',8); | |
87 end | |
88 end | |
89 | |
90 | |
91 lsline | |
92 | |
93 | |
94 ylabel('Accuracy (%)') | |
95 xlabel('Spectral Spread') | |
96 | |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | |
108 | |
109 | |
110 %HANN WINDOW | |
111 | |
112 | |
113 | |
114 percHits_hann=percHitsMat(:,6); %set data for hann window | |
115 | |
116 | |
117 figure | |
118 set(gcf, 'units', 'inches', 'pos', [1000 300 figWidth figHeight]) | |
119 | |
120 scatter(spreadData,percHits_hann,'k.') | |
121 set(gca,'FontSize',8) | |
122 | |
123 ylim([99.3 100]) | |
124 xlim([min(spreadData)-100 max(spreadData)+100]) | |
125 | |
126 %PLOT TEXT LABELS | |
127 | |
128 for n=1:length(percHits_hann) | |
129 if n==13 %Rhodes | |
130 text(spreadData(n)+50,percHits_hann(n),instNames{n},'FontSize',8); | |
131 elseif n==11 %Electric Guitar | |
132 text(spreadData(n)-550,percHits_hann(n),instNames{n},'FontSize',8); | |
133 elseif n==16 %Acoustic Guitar | |
134 text(spreadData(n)-600,percHits_hann(n),instNames{n},'FontSize',8); | |
135 else | |
136 text(spreadData(n)+50,percHits_hann(n),instNames{n},'FontSize',8); | |
137 end | |
138 end | |
139 | |
140 lsline | |
141 | |
142 ylabel('Accuracy (%)') | |
143 xlabel('Spectral Spread') |