clear all;
x=input('enter the sequence x=');
N=length(x);
y=x;
z=x;
for i=1:N-1
for i=N-1:-1:1
x(i+1)=x(i);
end
x(1)=0;
z=[z; x];
end;
m=[z]*[y'];
m=m/N
stem(m);
title('auto-correlation');
xlabel('time index');
ylabel('amplitude');
how does this work
ReplyDeleteDoes this even work? I think there is a typo here
ReplyDeletefor i=1:N-1
for i=N-1:-1:1
How can you have a nested for loop using the counter variable (i)?