shft.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 59 行
M
59 行
% Function : shft.m shifts the display sequence by 'npts' points
% shifts the display to the left by npts when sf_flag=1;
% The shift is the reverse if sf_flag=-1.
%
%
%
%
global BACK_COLOR TEXT_COLOR LINE_COLOR;
BACK_COLOR=[1 1 1]; %white
TEXT_COLOR=[0 0 0]; %black
LINE_COLOR=[0 0 1]; %blue
% 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;
if exist('signal1') == 1
axes(ax1);
plot((LEFT:RIGHT),signal1(LEFT:RIGHT),'color',LINE_COLOR);
title('Speech signal 1');
end
if exist('signal2') == 1
axes(ax2);
plot((LEFT:RIGHT),signal2(LEFT:RIGHT),'color',LINE_COLOR);
title('Speech signal 2');
end
if exist('signal3') == 1
axes(ax3);
plot((LEFT:RIGHT),signal3(LEFT:RIGHT),'color',LINE_COLOR);
title('Speech signal 3');
end
if exist('signal4') == 1
axes(ax4);
plot((LEFT:RIGHT),signal4(LEFT:RIGHT),'color',LINE_COLOR);
title('Speech signal 4');
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?