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

📄 ti_go.m

📁 这是一个用于语音信号处理的工具箱
💻 M
字号:
%
% Callback function for Time analysis button in the Analysis window
% Author : Minkyu Lee
% Date : 4-Feb-1995
% Modified by D. G. Childers

% Set position and size of analysis window
if exist('time_out_win_pos') == 1
	PV=time_out_win_pos;
else
	PV=[100 20 300 300];
end

% Open analysis window	
if exist('time_out_win_h') == 1
	figure(time_out_win_h);
	clg;
	set(time_out_win_h,'Name','Time domain analysis');
	
else
	time_out_win_h=figure('Position',PV,...
		'Resize','on',...
		'Numbertitle','off',...
		'color',BACK_COLOR,...
		'Name','Time domain analysis');
end


signal=speech(left:right);
% Normalize the amplitude of the analyzing signal

AMAX=max(abs(signal));
signal=14000/AMAX*signal;

% Remove components around d.c.
signal=filtfilt([1 -1],[1 -.99],signal);

% Segmentize the underlying signal

ntotal=length(signal);
old_ntotal = ntotal;	% bug fix by Hu and JW 4/22/93
nframe=floor(ntotal/200);
if ntotal-nframe*200-13 > 0
	nframe=nframe+1;
end;
ntotal=nframe*200+13;
signal(ntotal)=0;

for i=old_ntotal+1:ntotal,
	signal(i)=rand(1) - 0.5;
	sig2(i)=rand(1)-0.5;
end;

cofa=zeros(nframe,14);  
curmaxp=zeros(1,nframe);
compa=1e7;

aa=zeros(size(sig2));
energy=zeros(1,nframe);
zcr=zeros(1,nframe);

disp('Analysing the data file');
t_start = clock;

% Calculate the lpc coefficients and get residue;
% Please see "lpc_1a.m" for the I/O arguments.

% ********************* do for FIRST segment *************************
	sso=signal(1:250+13);
	nmax=max(sso);
	nmin=min(sso);
	[cofa1,emp(1),energy(1),residue1]=lpc_1a(sso,num_poles);
	zcr(1)=zcr_cnt(sso, nmax, nmin);

	subplot(211),plot(energy);
	V=axis;
	axis([1 nframe V(3) V(4)]);
	title('Energy');
	subplot(212),plot(zcr);
	V=axis;
	axis([1 nframe V(3) V(4)]);
	title('Level crossing rate');

% ******************** do for middle segments ************************
for k=2:nframe-1
	sso=signal((k-1)*200+1:k*200+13+50);
	[cofa1,emp(k),energy(k),residue1]=lpc_1a(sso,num_poles);
	zcr(k)=zcr_cnt(sso, nmax, nmin);

	subplot(211),plot(energy);
	V=axis;
	axis([1 nframe V(3) V(4)]);
	title('Energy');

	subplot(212),plot(zcr);
	V=axis;
	axis([1 nframe V(3) V(4)]);
	title('Level crossing rate');

	pause(0.01);
end;

⌨️ 快捷键说明

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