⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w5_ed_ta.m

📁 这是一个用于语音信号处理的工具箱
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	w5_edit_target.m
%
%	jmw
%	6/20/94
%
%       User-Specified Maps:  Edit Window
%
%	callback for "target" pushbutton in edit window.  Sets number
%	of targets, and attempts to preserve some of the target positions
%	if number of targets is changed on the fly during editing ...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

TARGETVALUE = get(w5_edit_target_h,'Value');

if (TARGETVALUE == OLDTARGETVALUE)
	;
	% do nothing, same value, no change
else	

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% preserve endpoints (and other target points as well)

[t_m,t_n]=size(target);

if (TARGETVALUE == 1)
	% 2 targets
	new_target = [ target(1,1) target(1,2); target(t_m,1) target(t_m,2)];
	% no need to preserve anything else 

elseif (TARGETVALUE == 2)
	% 3 targets
	new_target=[target(1,1) target(1,2); 50 0 ;target(t_m,1) target(t_m,2)];
	if (OLDTARGETVALUE == 1 | OLDTARGETVALUE == 3)
		;	% do nothing
	elseif (OLDTARGETVALUE == 4)
		% preserve center target at 50
		new_target(2,1)=target(6,1);
		new_target(2,2)=target(6,2);
	end;

elseif (TARGETVALUE == 3)
	% 6 targets
	new_target = [ target(1,1) target(1,2); 20 0 ;...
		40 0 ; 60 0 ; 80 0 ; target(t_m,1) target(t_m,2)];
	if (OLDTARGETVALUE == 1 | OLDTARGETVALUE == 2)
		;	% do nothing
	elseif (OLDTARGETVALUE == 4)
		% preserve target at 20
		new_target(2,2)=target(3,2);
		% preserve target at 40
		new_target(3,2)=target(5,2);
		% preserve target at 60
		new_target(4,2)=target(7,2);
		% preserve target at 80
		new_target(5,2)=target(9,2);
	end;


elseif (TARGETVALUE == 4)
	% 11 targets
	new_target=[target(1,1) target(1,2); 10 0 ; 20 0; 30 0 ; 40 0 ; 50 0;...
		60 0; 70 0; 80 0; 90 0; target(t_m,1) target(t_m,2)];
	if (OLDTARGETVALUE == 1 | OLDTARGETVALUE == 2)
		;	% do nothing
	elseif (OLDTARGETVALUE == 3)
		% preserve target at 20
		new_target(3,2)=target(2,2);
		% preserve target at 40
		new_target(5,2)=target(3,2);
		% preserve target at 60
		new_target(7,2)=target(4,2);
		% preserve target at 80
		new_target(9,2)=target(5,2);
	end;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% set old value(s) to current state for next time

OLDTARGETVALUE = TARGETVALUE;	

target = [];
target = new_target;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% call edit display program

TARGET_SMOOTH = 1;
w5_ed_sm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

end; 	% end: if (TARGETVALUE = OLDTARGETVALUE)

⌨️ 快捷键说明

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