#脚本作者:凌锋(上海大学),使用此脚本进行学术研究并撰写论文时,请在脚注中予以说明或在参考文献中进行援引! #用praat画声学元音图,我们首先需要准备一个共振峰数据文件。 #以praat内置的荷兰语元音数据为例。我们可以先在praat主窗口new/tables/creat tableofreal(pols 1973) #生成这样一个数据文件。生成之后,大家可以用write保存这个文件。这是一个纯文本的文件,改一下里面相 #关参数和数据就可以生成自己的共振峰文件了。 #然后就可以用下面这个script来画声学元音图。 #请注意,其中optionmenu biankuang(是否清空后画边框)的作用有两个,一个是清空作图区域,另一个是画出边框 #所以如果要再叠加其他数据图形,biankuang就要选择no form 元音散点和椭圆 comment 注意:要先选中tableofreal文件。 integer Daxiao 18 optionmenu Color: 1 option Black option Blue option Purple option Red option Pink option Green option Teal option Grey optionmenu xianxing(线条类型): 1 option Solid line option Dotted line option Dashed line option Dashed-dotted line optionmenu tuoyuan(是否画元音椭圆): 2 option yes option no optionmenu sandian(是否画元音散点): 1 option yes option no optionmenu biankuang(是否清空后画边框): 1 option yes option no endform call yanse name$ = selected$("TableOfReal") Copy... bark Formula... if col = 2 then hertzToBark(self)*(-1) else self fi Formula... if col = 1 then hertzToBark(self)*(-1) else self fi # draw a vowel chart axis, with the F1 F2 in bark scale xleft=-17.617 xright=-4.074 ytop=-1.073 ybottom=-10.573 Axes... xleft xright ybottom ytop if biankuang$="yes" Erase all Select inner viewport... 0.5 5.015 0.5 3.667 Text left... no F1 Text bottom... no F2 Axes... xleft xright ybottom ytop One mark top... xleft no yes no 4000 One mark top... xright no yes no 400 One mark right... ytop no yes no 100 One mark right... ybottom no yes no 1400 One mark bottom... xleft no yes no One mark bottom... xright no yes no One mark left... ytop no yes no One mark left... ybottom no yes no #为了间隔都是整数,不用for循环 zuixiaokedu=4000-250 shuzibiaoji=1;用于控制间隔做数字标记 while zuixiaokedu >400 shuzibiaoji=-1*shuzibiaoji keduweizhi=-1*hertzToBark(zuixiaokedu) if shuzibiaoji>0 One mark top... keduweizhi no yes no 'zuixiaokedu' else One mark top... keduweizhi no yes no endif One mark bottom... keduweizhi no yes no zuixiaokedu=zuixiaokedu-250 endwhile zuixiaokedu=1400-100 while zuixiaokedu >100 keduweizhi=-1*hertzToBark(zuixiaokedu) One mark right... keduweizhi no yes no 'zuixiaokedu' One mark left... keduweizhi no yes no zuixiaokedu=zuixiaokedu-100 endwhile endif # draw scatter plots of the vowel samples if sandian$="yes" Draw scatter plot... 2 1 0 0 'xleft' 'xright' 'ybottom' 'ytop' 'daxiao' yes + no endif # draw ellipses if tuoyuan$="yes" To Discriminant Draw confidence ellipses... 0.95 no 2 1 -17.6 -4 -10.1 -1.07 'daxiao' no Remove endif select TableOfReal bark Remove select TableOfReal 'name$' procedure yanse if color=1 Black elsif color=2 Blue elsif color=3 Purple elsif color=4 Red elsif color=5 Pink elsif color=6 Green elsif color=7 Teal elsif color=8 Grey endif if xianxing=1 Solid line elsif xianxing=2 Dotted line elsif xianxing=3 Dashed line elsif xianxing=4 Dashed-dotted line endif endproc