From: Aino on 3 Jun 2010 21:25 function [FD]=Higuchi(COP) %This function calculates a fractal dimension of a COP trace using %Higuchi's [Higuchi 1988] method. N=length(COP); kmax=100; L_m=zeros(1,kmax); L_m_length=zeros(kmax,kmax); for k=1:kmax for m=1:k; L_m=zeros(1,kmax); for i=1:fix((N-m)/k) L_m(i)=abs(COP(m+i*k)-COP(m+(i-1)*k)); end a=((N-1))/(fix((N-m)/k)*k); L_m_length(m,k)=(sum(L_m)*a)/k; end L_m_length_mean(k)=mean(nonzeros(L_m_length(:,k))); %Extra zeros from the matrix L_m_length_std(k)=std(nonzeros(L_m_length(:,k))); end k=1:kmax; p=polyfit(log(1./k), log(L_m_length_mean), 1); FD=p(1);%FD is the slope ________________________________________ I sure hope it does what it is supposed to do. But I now have a more resent problem concerning it. The kmax is supposed to be found by plotting FDs that are acquired with different kmaxs against kmaxs. The suitable kmax should be the one at what point the plot plateaus. First of all, does that mean that the FD increases as the kmax increases? And second of all, what if (as in my case) the FD get all the way to 2 before it plateaus? The longer the trace is, the longer the kmax needed, it would seem.. Thank you for your answers. -Aino "Sarah " <sarah.menetre(a)schiller.fr> wrote in message <hm87ru$g4g$1(a)fred.mathworks.com>... > Hello Tikkuhirvi, > > I would be interested to know if you have solved your problem exposed here about the Higuchi's fractal dimension code. Was the proposition from Steen Johansen the solution you adopted ? > Because I found nowhere (neither in the Biomedical signal and image processing book from Kayvan Najarian, Robert Splinter nor on the websites), something like "dimension is the slope of the inverse function you are using" ! > > Thank you in advance, > > Sarah
|
Pages: 1 Prev: Please help I have a question in the MATLAB Next: Compiling FORTRAN on maci64 architecture |