loctime.m

来自「胡广书著的《现代信号处理教程》一书的例子的源码。都是Matlab程序。」· M 代码 · 共 38 行

M
38
字号
function [tm,T]=loctime(sig);%LOCTIME Time localization caracteristics.%	[TM,T]=LOCTIME(SIG) computes the time localization%	caracteristics of signal SIG. % %	SIG is the signal.%	TM  is the averaged time center.%	T   is the time spreading.%%	Example :%	 z=amgauss(160,80,50); [tm,T]=loctime(z)%%	See also LOCFREQ.%	F. Auger, July 1995.%	Copyright (c) 1996 by CNRS (France).%%	------------------- CONFIDENTIAL PROGRAM -------------------- %	This program can not be used without the authorization of its%	author(s). For any comment or bug report, please send e-mail to %	f.auger@ieee.org [sigr,sigc]=size(sig);if (sigc~=1), error('The signal must have 1 column');else   sig2=abs(sig).^2; 
   %   sig2=sig2/mean(sig2);
   a=mean(sig2);
   sig2=sig2/a;    t=(1:sigr)';
%    t=((1:sigr)-sigr/2)'; tm=mean(t.*sig2);
 b=mean((t-tm).^2 .* sig2); T=2*sqrt(pi*b); 
%  T=2*sqrt(pi*mean((t-tm).^2 .* sig2)); end;

⌨️ 快捷键说明

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