Technical discussion about Matlab and issues related to Digital Signal Processing.
Hi,
How do you use the XCORR function in matlab to determine and plot the auto correlation of a
square wave? For example if g(t)=rect10. To plot my square wave I did the following:
xa=linspace(-2,2); % x- axis
plot(xa,0);
hold
ya=linspace(0,10); % y- axis
plot(0,ya);
r=linspace(0,8)
plot(0.5,r)
l=linspace(-0,8)
plot(-0.5,l)
top=linspace(-0.5,0.5)
plot(top,8)
hold
xlabel('t')
ylabel('g(t)')
title('Plot of Square Wave')
Would I just use vectors I used to plot the square wave and place then in the XCORR function. I
am just learning matlab so I would appreciate your comments, also Do you have any code
examples?
Thanks