gcplt.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 82 行

M
82
字号
% Script : plot two factors of the gain contour on Gcdis_f and the gain contour
%          on Gcontour_f


%% obtain the knobs 
 val=get(env_dsp,'Value');

 if exist('knob_xx')==0
    if val==1  %% ==label grossly==
       knob_xx=[1 nframe];
       knob_yy=[genv1(1) genv1(nframe)];
    else       %% ==label detailed==
       knob_xx=1:nframe;
       knob_yy=genv1(1:nframe);
    end
 end

figure(Gcdis_f);
%% plot the gain perturbation

 gcpert=randn(1,nframe)*gb1.*genv1;
 plot(1:nframe,gcpert,'r'); hold on;

%% plot the gain envelop
 plot(1:nframe,genv1,'k');

%% plot the voicing boundary
 v=axis;
 for kk=1:length(vcbound)
     plot([(vcbound(kk)-1) (vcbound(kk)-1)],[v(3) v(4)],'c');
 end

 % plot the knobs
 plot(knob_xx,knob_yy,'g*');

 hold off;
 title('Gain envelope (black line) and Gain Perturbation (red line) ');

%% label the voicing classification
 text((vcbound(1)-1)/2-1/2, 0.9*v(4)+0.1*v(3), 'U');
 for kk=1:length(vcbound)-1
     if vctyp(vcbound(kk))==0
         text((vcbound(kk)-1)/2+(vcbound(kk+1)-1)/2-1, 0.9*v(4)+0.1*v(3), 'U');
     else
         text((vcbound(kk)-1)/2+(vcbound(kk+1)-1)/2-1, 0.9*v(4)+0.1*v(3), 'V');
     end
 end
 text((vcbound(kk+1)-1)/2+nframe/2-1, 0.9*v(4)+0.1*v(3), 'U');

%% set the axis scaling
 if exist('Left')==0
    Left=1;
    Rite=nframe;
 end
 axis([0 Rite+1 v(3) v(4)]);

figure(Gcontour_f);
%% plot the gain contour

 plot(1:nframe,gntour1,'k');
 axis([0 nframe+1 0 max(gntour1)*1.2]);
 hold on;

 % plot the voicing boundary
 v=axis;
 for kk=1:length(vcbound)
     plot([(vcbound(kk)-1) (vcbound(kk)-1)],[v(3) v(4)],'c');
 end
 hold off;
 title('Gain Contour');

 % label the voicing classification
 text((vcbound(1)-1)/2-1/2, 0.9*v(4)+0.1*v(3), 'U');
 for kk=1:length(vcbound)-1
     if vctyp(vcbound(kk))==0
         text((vcbound(kk)-1)/2+(vcbound(kk+1)-1)/2-1, 0.9*v(4)+0.1*v(3), 'U');
     else
         text((vcbound(kk)-1)/2+(vcbound(kk+1)-1)/2-1, 0.9*v(4)+0.1*v(3), 'V');
     end
 end
 text((vcbound(kk+1)-1)/2+nframe/2-1, 0.9*v(4)+0.1*v(3), 'U');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?