vt_plt.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 54 行
M
54 行
% Function : plot the voicetype on figure(Vtset_f) and figure(Vtdis_f)
% It has the following features:
% (1) shifts the display to left by npts when sf_flag=1; The reverse if sf_flag=-1
% (2) undo the correction, redraw the plot
figure(Vtset_f);
plot_flag=1;
%--------------%
% SHIFT EFFECT %
%--------------%
if exist('sf_flag')
if sf_flag==1 % shift to left
cfram=max(1,cfram-1);
set(frame_pts,'String',num2str(cfram));
elseif sf_flag==-1 % shift to right
cfram=min(nfram,cfram+1);
set(frame_pts,'String',num2str(cfram));
elseif sf_flag==2 % shift to the user specified (typed) frame
cfram=str2num(get(frame_pts,'String'));
if cfram>nfram
cfram=nfram;
set(frame_pts,'String',num2str(cfram));
end
if cfram<1
cfram=1;
set(frame_pts,'String',num2str(cfram));
end
end
if vctyp1(cfram)==0
set(vt_text,'String','unvoiced');
else
set(vt_text,'String','voiced');
end
clear sf_flag;
end
%------------------------%
% plot the voicetype %
%------------------------%
plot(1:nfram,vctyp,'b',1:nfram,vctyp1,'r+',cfram,vctyp1(cfram),'go');
xlabel('frame');
title('blue line is the old-voicetype & red ''+'' is the new-voicetype');
nfram=length(vctyp1);
text(nframe/2,1.3, '1=Voiced');
text(nframe/2,-0.3,'0=Unvoiced');
axis([1 nfram -0.5 1.5]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?