curvature.m

来自「一种新的时频分析方法的matlab源程序。」· M 代码 · 共 37 行

M
37
字号
function h=ddk(x);

% The function DDK calculates the curvature of data. 
%
% Calling sequence-
% h=ddk(x)
%
% Input-
%	x	- 1-D vector of input data x(n)
% Output-
%	h	- 2-D matrix of input data h(n,1) that 
%		  specifies the curvature of input data
 
% Z.Shen (Caltech)		Initial

%----- Get dimensions
n=length(x);

%----- Initialize
z=zeros(n,1);
h=zeros(n,1);

%----- Calculate the curvature
for i=2:n-1
   z(i)=(x(i+1)-x(i-1))/2.;
   h(i)=x(i+1)+x(i-1)-2*x(i);
end
z(1)=x(2)-x(1);
z(n)=x(n)-x(n-1);
h(1)=z(2)-z(1);
h(n)=z(n)-z(n-1);

for i=1:n
   a1=(1+z(i)*z(i))*sqrt(1+z(i)*z(i));
   h(i)=-1*h(i)/a1;
end

⌨️ 快捷键说明

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