Autocorrelation function without using xcorr
Show older comments
Hello, I have this code trying to plot the autocorrelation of signal E1 without xcorr function
E1f=[E1 zeros(1,1249)];
for L = 0:length(E1)
for j = 1 : length(E1)
Rxx(j) = (E1f(j)*E1f(j+L));
end
Rxx_sum(L+1) = sum(Rxx);
Rxx = 0;
end
t1=0:1:length(E1);
plot(t1,Rxx_sum);
However i don't the same result using xcorr. E1 is a vector of complex numbers and has a length of [1,1249]
What am I doing wrong?
Answers (0)
Categories
Find more on Correlation and Convolution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!