Effacer les filtres
Effacer les filtres

Can anyone provide a code for calculating autocorrelation without autocorr?

23 vues (au cours des 30 derniers jours)
Anuradha Bhattacharya
Anuradha Bhattacharya le 26 Oct 2015
Commenté : ASWIN SEKHAR C S le 16 Août 2023
Can anyone provide a code for calculating autocorrelation without using autocorr as I do not have the econometrics toolbox?

Réponses (3)

Walter Roberson
Walter Roberson le 26 Oct 2015

Abdul Wasay
Abdul Wasay le 16 Fév 2020
x=input('Enter the first Sequence : ');
h=input('Enter the second sequence : ');
n=length(x);
m=length(h);
k=n+m-1;
x=[x zeros(1,k-n)]';
h=wrev(h);
h=[h zeros(1,k-m)]';
for i=1:k
c(:,i)=circshift(x,i-1);
end
y=c*h;
disp('Correlation of the sequences')
disp(y');

i Wijayanto
i Wijayanto le 29 Sep 2020

Community Treasure Hunt

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

Start Hunting!

Translated by