📄 display_1_zoom.m
字号:
%Callback function for the zoom button
%To zoom a segment of speech, click the left mouse button on the beginning and end points
%To zoom out, click the left and right mouse buttons in any order(but not together)
%To exit the zooming function, click the right mouse button twice, slowly
%
%Modified by D. G. Childers, October 15, 1997
%
AXIS = axis;
button = [1 1];
while button(1)~=3 | button(2)~=3
[xx,yy,button] = ginput(2);
xx=round(xx);
if button(1)== 1 & button(2) ==1
LEFT1(zoom_level) = LEFT;
RIGHT1(zoom_level) = RIGHT;
zoom_level = zoom_level + 1;
if (xx(2)>xx(1))
LEFT = round(xx(1));
RIGHT = round(xx(2));
else
LEFT = round(xx(2));
RIGHT = round(xx(1));
end
axis1 = LEFT:RIGHT;
if exist('signal1') == 1
axes(ax1);
plot(axis1,signal1(LEFT:RIGHT));
title('Speech signal 1');
end
elseif (button(1)==1 & button(2) ==3)|(button(1) == 3 & button(2) ==1)
zoom_level = zoom_level -1;
if zoom_level <=0
zoom_level = 1;
end;
LEFT = LEFT1(zoom_level);
RIGHT = RIGHT1(zoom_level);
axis1 = LEFT:RIGHT;
if exist('signal1') == 1
axes(ax1);
plot(axis1,signal1(LEFT:RIGHT));
title('Speech signal 1');
end
elseif button(1) ==3 & button(2) ==3
if zoom_level==1
if exist('signal1') == 1
axes(ax1);
plot(signal1);
title('Speech signal 1');
end
if exist('signal2') == 1
axes(ax2);
plot(signal2);
title('Speech signal 2');
end
if exist('signal3') == 1
axes(ax3);
plot(signal3);
title('Speech signal 3');
end
if exist('signal4') == 1
axes(ax4);
plot(signal4);
title('Speech signal 4');
end
LEFT=1;
LENS=length(signal1);
RIGHT=LENS;
end;
break;
end
end;
clc;
disp('Exiting the zooming function');
clear xx
% set the shift-button on
set(shift_right,'Visible','on');
set(shift_left,'Visible','on');
%return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -