gcdsp.m

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

M
75
字号
% Script : label the gain envelope in a gross or detailed way on Gcdis_f 
%
%    gcdsp.m is a call_function executed by "env_dsp" on figure(Gcset_f).


val=get(env_dsp,'Value');

if val==1  %% label the envelope in a gross way

    set(env_lbl,'Visible','on');
    set(env_zoom,'Visible','off');
    set(env_fit,'Visible','on');
    set(env_shl,'Visible','off');
    set(env_shr,'Visible','off');

    knob_xx=[1 nframe];
    knob_yy=[genv1(1) genv1(nframe)];
    clear Rite Left;

elseif val==2 %% label the envelope in a detailed way

    set(env_lbl,'Visible','off');
    set(env_zoom,'Visible','on');
    set(env_fit,'Visible','off');
    set(env_shl,'Visible','on');
    set(env_shr,'Visible','on');

    knob_xx=1:nframe;
    knob_yy=genv1(1:nframe);
    clear menv;
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
 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');

% plot the labeled point
  hold on;
  plot(knob_xx,knob_yy,'g*')
  hold off;

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

⌨️ 快捷键说明

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