MATLAB File Help: dfa View code for dfa WFDB Contents
dfa



function [ln,lf]=dfa(varargin)

 [ln,lf]=dfa(x,p,integrateFlag,minBoxSize,maxBoxSize,slideWindowFlag)


 Wrapper to the DFA Algorithm in:
    http://www.physionet.org/physiotools/dfa/

 References: 
 Peng C-K, Buldyrev SV, Havlin S, Simons M, Stanley HE, Goldberger AL. Mosaic organization of DNA nucleotides. Phys Rev E 1994;49:1685-1689.
 Peng C-K, Havlin S, Stanley HE, Goldberger AL. Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series. Chaos 1995;5:82-87.

 Please cite at least one of the above publications when referencing this
 material.

 Required Input Options are:

 x
       A Nx1 vector of doubles. 

 Optional Input Options are:

 p
       Detrend using a polynomial of degree p (default: p=1, linear
       detrending).

 integrateFlag
       Input series is already integrated ( default= false ).

 minBoxSize
       Smallest box width (default: 2p+2)

 maxBoxSize
       Largest box width (default: N/4)

 slideWindowFlag
       Sliding window DFA (default =false);


 The Output variables are:

 ln
       A (MaxBoxSize -MinBoxSize) x 1 vector of log(boxsize)

 lf
       A (MaxBoxSize -MinBoxSize) x 1 vector of the log of the root
       mean square fluctuation for the given boxsize. 


 Written by Ikaro Silva, 2014
 Last Modified: November 21, 2014
 Version 1.0

 Since 0.9.8

 %Example:

  gqrs('mitdb/117');
  [rr]=ann2rr('mitdb/117','qrs');
  [ln,lf]=dfa(rr);
  plot(ln,lf)



 See also MSENTROPY, SURROGATE