gcdra.m

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

M
88
字号
% Script : draw the gain envelope from the GCI display using mouse.
%
%    pcdra.m is a call_function executed by "env_up" or "env_down" on 
%    figure(Gcset_f).

 figure(Gcdis_f);

 xx=knob_xx(knob_idx);
 yy=knob_yy(knob_idx);

 if exist('o_yy')==0
    o_yy=yy;
 end

 v=axis;
 dev=v(4)/50;
 if UP==1  %%%% move the selected knob up
    yy=yy+dev;
 elseif UP==-1 %%%% move the selected knob down
    yy=max(yy-dev,0);
 end

 knob_yy(knob_idx)=yy;

 val=get(env_dsp,'Value');


 %% 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');

 if val==1  %% label the envelope in a gross way
  
      %% plot the knob
        plot(knob_xx,knob_yy,'g*');

     %% plot the selected knob in new position
        plot(xx,yy,'bx');

     %% plot the knob in original position
        plot(xx,o_yy,'bo');

     %% plot the modeled gain envelop
        plot(1:nframe,menv(1:nframe),'g--');

  elseif val==2

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

     %% plot the selected knob in new position
        plot(xx,yy,'bx');

     %% plot the knob in the original position
        plot(xx,o_yy,'bo');

 end  %% if val==1  %% label 

 %% 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 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([Left-1 Rite+1 v(3) v(4)]);

⌨️ 快捷键说明

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