📄 dfapeng.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -