ds.m
来自「一种新的时频分析方法的matlab源程序。」· M 代码 · 共 42 行
M
42 行
function z=ds(nt)
% z=ds(nt):
% Function to analyze the degree of stationarity of data nt(n,m) by
% calculating the variance for each n, where n specifies the number
% of frequency values, and the length of time series.
%
% Input-
% nt - 2-D matrix nt(n,m) that specifies the HHT spectrum
% Output-
% z - vector that specifies the degree of stationarity
% for each frequency value
%
% Norden Huang (NASA GSFC) Initial
% Jelena Marshak (NASA GSFC) Nov.7, 2003 Modified and edited
% (added mean value check for zero)
%
% Notes-
% An input matrix can be generated by calling a function that
% generates the spectrum, for example 'nsp()' or 'nspab()'.
% If mean value is zero, its components are assumed to be near zero.
%---- Get dimensions (number of frequency and time values)
ii=size(nt);
jf1=ii(1);
%---- Calculate the mean for each frequency value
ms=sum(nt,2);
ms=ms/ii(2);
%---- Normalize and calculate the variance
for i=1:jf1
if(ms(i)~=0)
nt(i,:)=nt(i,:)/ms(i);
end
end
nt=1-nt;
nt=nt.*nt;
z=sum(nt,2);
z=z/ii(2);
%z(1)=0.;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?