Can anyone provide a code for calculating autocorrelation without autocorr?
36 次查看(过去 30 天)
显示 更早的评论
Can anyone provide a code for calculating autocorrelation without using autocorr as I do not have the econometrics toolbox?
回答(3 个)
Abdul Wasay
2020-2-16
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');
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!