0001 function au_fmt_space_init(hau,type)
0002
0003 if(nargin==1)
0004 type=1;
0005 end
0006 [pb.type pb.num pb.vnum pb.vowel pb.f0 pb.f1 pb.f2 pb.f3]= ...
0007 textread('data/verified_pb.data','%d%d%d%s%f%f%f%f');
0008
0009 vowel_ind=[];
0010 for j=1:length(pb.type)
0011 if(pb.type(j)==type)
0012 if isempty(findstr(char(pb.vowel(j)),'*'))
0013 if isfield(vowel_ind,char(pb.vowel(j)))
0014 vowel_ind.(char(pb.vowel(j)))(end+1)=j;
0015 else
0016 vowel_ind.(char(pb.vowel(j)))(1)=j;
0017 end
0018 end
0019 end
0020 end
0021 names=fieldnames(vowel_ind);
0022 gcolor={'b','g','r','c','m','y','k','b-','g-','r-'};
0023 axes(hau); hold on;
0024 gaussEllipse(names,pb,vowel_ind,gcolor);
0025
0026
0027
0028
0029
0030
0031
0032 xlim=[0 900];
0033 ylim=[500 3000];
0034 xtick=linspace(0,900,5);
0035 ytick=500:500:3000;
0036 xticklabel=floor(linspace(0,900,5));
0037 yticklabel=floor(500:500:3000);
0038
0039
0040
0041 set(hau,'Xlim',xlim,'Ylim',ylim, 'YAxisLocation','left');
0042 set(hau,'XTick',xtick,'YTick',ytick);
0043 set(hau,'XTickLabel',xticklabel,'YTickLabel',yticklabel);
0044
0045
0046
0047 xlabel('F1 Frequency (Hz)');
0048 ylabel('F2 Frequency (Hz)');
0049 title('Acoustic Space');
0050
0051 axis normal;
0052
0053 function gaussEllipse(names,pb,vowel_ind,gcolor)
0054
0055
0056
0057
0058
0059
0060 F.IY=[270 2290 3010];
0061 F.IH=[390 1990 2550];
0062 F.EH=[519 1619 2411];
0063 F.AE=[660 1720 2410];
0064 F.AH=[677 1419 2241];
0065 F.AA=[662 1251 2278];
0066 F.UH=[541 1097 2239];
0067 F.UW=[392 964 2233];
0068 F.ER=[490 1350 1690];
0069 F.AO=[526 910.5 2108];
0070
0071 for i=1:length(names)
0072 cur_dist=[pb.f1(vowel_ind.(char(names(i)))) pb.f2(vowel_ind.(char(names(i))))];
0073 mu=mean(cur_dist,1)';
0074 S=cov(cur_dist);
0075
0076 mu=F.(char(names(i)))([1,2])';
0077
0078 theta=linspace(0,2*pi,1000);
0079 [vv,dd]=eig(S*2);
0080 A=real((vv*sqrt(dd))');
0081 x=sin(theta);
0082 y=cos(theta);
0083 z=[x' y']*A;
0084 z=z+repmat(mu',1000,1);
0085
0086
0087 plot(z(:,1),z(:,2),char(gcolor(i)),'ButtonDownFcn',get(gca,'ButtonDownFcn'),...
0088 'tag',get(gca,'tag'),'parent',gca);
0089 text(mu(1),mu(2),char(names(i)),'ButtonDownFcn',get(gca,'ButtonDownFcn'),...
0090 'tag',get(gca,'tag'),'parent',gca);
0091 end
0092 return