pcapp.m

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

M
67
字号
%FUNCTION: Apply button for the pitch contour modification.
%  
%  pcapp.m is a call function by "apply_pb" on figure(Pset_f).

if App==1 % execute the apply buttom
          %-------------------------

    % 1. construct pw1
    %-----------------
    if exist('mwave')
         pw1=mwave;
    end
    gci1=g_gci(p01,pw1,jitter,gcidx1,seglens1);

    % 2. construct new gain contour
    %------------------------------
    m_len=basic(5)-basic(6);
    gm_x=1;
    gm_y=0;

    for kf=1:nframe
       startp=m_len*(kf-1)+Order+1;
       tmp_x=m_len/4*[0 1 2 3]+m_len/8+startp;
       gm_x=[gm_x tmp_x];
       gm_y=[gm_y ngm(kf,1:4)];
    end
    gm_x=[gm_x startp+m_len-1];
    gm_y=[gm_y 0];
    gm3=interp1( gm_x,gm_y,gci1 );

    clear seg_eng;

    % 3. estimate the new factors for the new pitch contour
    %------------------------------------------------------

    gci3=gci1; 
    [p01,pw1,pb1,gcidx1,seglens1]=pctour(gci1);   
    jitter=p01*pb1*randn(1,length(pw1));  %pitch jitter

    clear knob_xx knob_yy mwave
    pcplt;

elseif App==0 % execute the undo buttom
              %------------------------

    if exist('gci3')==0
      gci1=gci;
    else
      gci1=gci3;
    end

    clear knob_xx knob_yy mwave;

    [p01,pw1,pb1,gcidx1,seglens1]=pctour(gci1);
    jitter=p01*pb1*randn(1,length(pw1));  %pitch jitter
   
    pcplt;
end

% set the values on Pset_f
set(pertb_cg,'Value',pb1);
set(pertb_val,'String',num2str(pb1));
set(pitch_pts,'String',num2str(p01));
set(pitch_sh,'Value',p01);

clear nxx nyy knob_idx; 

⌨️ 快捷键说明

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