フィルターのクリア

Code to calculate a cross correlation function for many scales

1 回表示 (過去 30 日間)
tilfani oussama
tilfani oussama 2018 年 3 月 21 日
編集済み: tilfani oussama 2018 年 3 月 21 日
I would like to calculate a cross correlation function on many scales, in the file attached chapter 2 Multiscale correlation function. I don't know if the code here is the right one, i have some small differences with results in the paper. >> X=cumsum(x); %%integrate and set profile series
>> Y=cumsum(y);
>> X=transpose(X);
>> Y=transpose(Y);
>> N=length(X);
for n=3:150,
for i=1:N-n,
ind1=i;
ind2=i+n;
index=(ind1:ind2);
C0=polyfit(index, X(index),1);
C1=polyfit(index,Y(index),1);
fit0=polyval(C0,index);
fit1=polyval(C1,index);
Cov{n}(i)=(1/(n-1))*sum((X(index)-fit0).*(Y(index)-fit1));
CovX{n}(i)=(1/(n-1))*sum((X(index)-fit0).*(X(index)-fit0));
CovY{n}(i)=(1/(n-1))*sum((Y(index)-fit1).*(Y(index)-fit1));
end
CovXY(n)=(1/(N-n))*sum(Cov{n});
VarX (n)=(1/(N-n))*sum(CovX{n});
VarY (n)=(1/(N-n))*sum(CovY{n});
end
for j=1:150
rho (j)=CovXY(j)/sqrt(VarX(j).*VarY(j));
end

回答 (1 件)

tilfani oussama
tilfani oussama 2018 年 3 月 21 日
this is the paper of reference, look at paragraph 2 Multiscale cross correlation

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by