📄 auto_go.m
字号:
%
% Callback function for Time analysis button in the Analysis window
% Author : Minkyu Lee
% Date : 25-March-1995
% Modified by D. G. Childers
% Set position and size of analysis window
PV=[270 44 515 268];
s2 = 'Time domain Analysis - Output';
% Open analysis window
while exist('time_out_win_h')==1
try1 = 'get(time_out_win_h,''position'');';
eval(try1,catch2);
if check ==0
clear time_out_win_h;
check = 1;
break;
end
s1 = get(time_out_win_h,'Name');
if ~strcmp(s1,s2)
clear time_out_win_h;
break;
end
figure(time_out_win_h);
break;
end;
if exist('time_out_win_h')~=1;
time_out_win_h=figure('Position',PV,...
'Resize','on',...
'Numbertitle','off',...
'Name',s2);
end
if window_type == 1
win = hamming(time_frame_len); % Window type
elseif window_type == 2
win = hanning(time_frame_len); % Window type
elseif window_type == 3
beta=0.5;
win = kaiser(time_frame_len,beta); % Window type
elseif window_type == 4
win = triang(time_frame_len); % Window type
elseif window_type == 5
win = bartlett(time_frame_len); % Window type
elseif window_type == 6
win = blackman(time_frame_len); % Window type
elseif window_type == 7
win = boxcar(time_frame_len); % Window type
elseif window_type == 8
rdb=3;
win = chebwin(time_frame_len,rdb); % Window type
end
button=1;
while button == 1
if ti_mark_flag == 0
S=sprintf('The analysis frame is the first %d points of current data window',time_frame_len);
disp(S);
speech1=SPEECH_OLD(LEFT:LEFT+time_frame_len-1);
x=LEFT;
button=0;
else
disp('Please select a starting point for the analysis frame');
figure(ana_wav_win_h);
[x,y,button]=ginput(1);
x=round(x);
if button ~= 1
return;
end
end
x_end = x+time_frame_len-1;
if x > RIGHT
disp('You have reached the end of the data. The analysis will use');
disp('the last data point.');
x=RIGHT-time_frame_len;
x_end=x+time_frame_len-1;
end
if x_end > RIGHT
disp('You have reached the end of the data. The analysis will use');
disp('the last data point.');
x_end = RIGHT;
x=RIGHT-(time_frame_len-1);
end
speech1=SPEECH_OLD(x:x_end);
figure(time_out_win_h);
win = win(1:(x_end-x+1));
speech1=win.*speech1;
xc_b=xcorr(speech1,'biased');
plot(xc_b);
title('Biased autocorrelation function');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -