dfapeng.m

来自「matlab下实现kaplan算法」· M 代码 · 共 46 行

M
46
字号
function [slow,fast] = dfapeng(vals,slowlen,midlen,fastlen)% [slow,fast] = dfapeng(vals,slowlen,midlen,fastlen)%% Compute DFA in the manner described by C-K Peng,% in C-K Peng, S Havlin, HE Stanley, AL Goldberger (1995)% "Detrended Fluctuation Analysis" Chaos 5(1):82-87% <vals> -- the data, typically RR intervals% <slowlen> -- a slow time scale, 64 beats by default% <midlen>  -- a medium time scale, 16 beats by default% <fast>    -- a fast time scale, 4 beats by default% Returned values:% <slow>    -- the power-law slope on the slow to mid time scales% <fast>    -- the power-law slope on the mid to fast time scalesif nargin < 4  fastlen = 4;endif nargin < 3  midlen = 16;endif nargin < 2  slowlen = 64;end[num,resid] = dfamain( vals, fastlen, slowlen, sqrt(2) );% fit the power-law of the faster time scalesgoods = find( num >= fastlen & num <= midlen);p = polyfit( log(num(goods)), log(resid(goods)), 1 );fast = p(1);% fit the power-law of the slower time scalesgoods = find( num >= midlen & num <= slowlen);p = polyfit( log(num(goods)), log(resid(goods)), 1 );slow = p(1);

⌨️ 快捷键说明

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