zoomiose.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 56 行
M
56 行
% Function : zoom in or out of the graphic display of signal to examine the segments.
% Zoomiose does zoom_in on the graph when Zio==1; The reverse if Zio=-1;
% The zooming factor is specified by "zoom_zscale".
%
% Zoomiose.m is a call_function executed by "Zoom_in" and "Zoom_out" on the
% figure(Segchek_f);
% 1. locate the region where we want to zoom in using the mouse
if Zio==1
[str_p y]=ginput(1); % str_p is the current x coordinate of the mouse
str_p=round(str_p);
elseif Zio==-1
str_p=round( (left+right)/2 );
end
% 2. get the zoomimg factor
zscale=str2num(get(zoom_zscale,'String')); % zscale == zooming scale
% 3. calculate the length of the signal to plot
if exist('lethnow')==0
lethnow=lens; % lethnow== the length of signal displayed in the figure
end
if Zio == 1 % zoom in
lethnow=round(lethnow/zscale);
if lethnow>5000
lethnow=5000; % show 5000 pts at most
end
elseif Zio== -1 % zomm out
lethnow=round(lethnow*zscale);
end;
% 4. Set the range, [left right], to display the signal.
left= max([str_p-floor(lethnow/2) 1]);
if left == 1
right= min([lethnow lens]);
else
right= min([str_p+floor(lethnow/2) lens]);
end;
if right == lens
left=max([1 lens-lethnow]);
end;
% 5. plot the signal with the segments
figure(Segchek_f);
plot((left:right),signal(left:right),'b',(left:right),segmentation(left:right),'k');
% set the shift-button on
set(shift_right,'Visible','on');
set(shift_left,'Visible','on');
clear str_p zscale;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?