shftseg.m

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

M
30
字号
% Function : shift the display the 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(Segchek_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 the segmentation

plot((left:right),signal(left:right),'k',(left:right),segmentation(left:right),'b');

⌨️ 快捷键说明

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