shft.m

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

M
33
字号
% Function : shift the display sequence by 'npts' points on figure(m_gci_f) 
%    Shift_lr shifts the display to the left by npts when sf_flag=1; 
%    The shift is the reverse if sf_flag=-1.
%
%    Shift_lr.m is a call_function executed by "shift_left" and "shift_right" 
%    on figure(m_gci_f);
%    
% Note: npts is specified by "shift_pts", the editable text on figure(m_gci_f).

figure(Gchek_f);
% get the shift points
npts=str2num(get(shift_pts,'String'));

lens2=right-left;

% set the region, [left right]

if sf_flag == 1 % shift to left
        left=max(left-npts,1);
        right=left+lens2;
elseif sf_flag == -1 % shift to right
        right=min(right+npts,lens);
        left=right-lens2;
end;

% plot the signal with GCI

% find GCIs between the margins
idx=find(gci0>=left & gci0<=right);
plot((left:right),signal(left:right),'b',gci0(idx),signal(gci0(idx)),'ko');

clear idx;

⌨️ 快捷键说明

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