Применение метода WTMM

signal (:, l)=signal (:, 1)/1ООО;

%переход к секундам delta =0.1;

scmin = (1)/(delta *f2);

scmax= (l)/(delta*fl);

scres=2* (nextpow2 (scmax-scmin));

l_a=scres;

w=’gaus8’;

fc = centfrq (w);

al= (fc)/(delta*fl);

a2= (fc)/(delta*f2);

lnal=log (al);

lna2=log (a2);

lna=linspace (Inal, lna2, l_a);

A=exp (Ina);

sc=cwt (detrend (signal (:,2)), A, w);

ssc=size (sc);

skelet=zeros (ssc);

for i=l: ssc (1)

[pks, locs]=findpeaks (abs (sc (i,:)));

sp=size (Iocs);

forj=l:sp(2)

skelet (i, Iocs (j))=pks (j);

end;

end;

qmin=-5; qmax=5; l q=101;

q=linspace (qmin, qmax, l_q);

sq=length (q);

Z=zeros (sq, ssc (1));

for i=l: sq

Z_int=exp (q (i)*log (skelet));

Z_int (Z_int==inf)=0;

Z_int(isnan (Z_int))=0;

Z(i,:)= (sum (Z_int,2));

const=polyfit (log2 (A), log2 (Z (i,:)), 1);

tau (i)=const (1);

end;

H=((diff(tau)))./(diff(q));

D= (((H))) *q (1: (end-l))-tau (1: (end-1));

plot(H,D)

Реализация метода MFDFA

signal (:, l)=signal (:, 1)/1ООО; %переход к секундам delta =0.1;

scmin= (l)/(delta*f2); scmax= (l)/(delta*fl);

scres=2"' (nextpow2 (scmax-scmin)-2);

exponents=linspace (log2 (scmin), log2 (scmax), seres);

scale=round (2. "'exponents);

qmin=-5; qmax=5; l_q=101;

q=linspace (qmin, qmax, l_q);

Y=detrend (signal (:,2));

if size (Y,2)==l;

Y=transpose (Y);

end

scale (scale>length (Y))=[];

forns=l: length (scale),

segments (ns)=floor (length (Y)/scale (ns));

for v=l: segments (ns)

Index= ((((v-l)*scale (ns))+l): (v*scale (ns)));

C=polyfit (Index, Y (Index), 2);

warning (‘off, 'аІГ);

fit=polyval (C, Index);

RMS_scale{ns} (v)=sqrt (mean ((Y(Index)-fit). л2));

end

for nq=l: length (q),

qRMS{nq, ns}=RMS_scale{ns}. ^q (nq);

Zq (nq, ns)=mean (qRMS{nq, ns}).Л (1/q (nq));

end

Zy (q==O, ns)=exp (0.5*mean (log (RMS_scale{ns}. л2))); end

Zq (Zq==0)=l;

fornq=l: length (q),

C = polyfit (log2 (scale), log2 (Zq (nq,:)), 1);

Hq(nq) = C(l);

qRegLine{nq} = polyval (C, log2 (scale));

D2 (nq)= (1/length (scale))*sum ((log2 (Zq (nq,:))...

- Iog2 (scale)*C (1)-C (2)). л2);

X0=sum ((log2 (scale)-mean (log2 (scale))). л2);

Da (nq)=D2 (nq)/X0;

tq = Hq. ^q-1; DT=diff(tq); hq = DT./diff(q);

Dq=q( 1: end-1). *hq-tq (1: end-1);

 
Посмотреть оригинал
< Пред   СОДЕРЖАНИЕ   ОРИГИНАЛ   След >