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

📄 diffn.m

📁 一种新的时频分析方法的matlab源程序。
💻 M
字号:
function d=diffn(x,n)

% The function DIFFN provides a variable window differentiation on data.
%
% Calling sequence-
% d=diffn(x,n)
%
% Example-
%	d=diffn(lod78_p',501);
%
% Input-
%   x   - matrix x(r,c) where r is data length and
%         c is number of components. Data should be
%         in column form, or columns.
%   n   - the full Window Width, an odd number greater then 1
% Output-
%   d   - matrix d(r-n+1,c) that contains the difference 
%         between pairs of values located n-1 points apart:
%         Dx/Dt, where Dt=n-1
 
% Steven R.Long (NASA GSFC/WFF/NASIRF)  Initial

[r,c]=size(x); 		% Get Rows & Columns of Data Input x
							% Length of r is data length
							% Number of c is number of components

hw=(n-1)/2;				% Half-Width of Window
bp=(n+1)/2;    		% Beginning Point, Center of First Window

d=zeros(r-n+1,c);		% Result Data is n-1 less in data length

for j=1:c;				% Do Each Component
  for i=bp:r-hw;		% Reduced Size within c
   ii=i-hw;				% Corresponding Locations in Reduced Matrix
							% Difference Over Window Width
   leftpt=ii;
	rightpt=i+hw;
	d(ii,j)=x(rightpt,j)-x(leftpt,j); % Difference of End.Pts,
													% rightpt is later in t
  end;					% Difference Over Window Placed in Center
end;						% Calculated Over All Columns

return;

⌨️ 快捷键说明

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