Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | RE: Using XCORR Function

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

RE: Using XCORR Function - vcco...@yahoo.com - Sep 23 7:08:48 2008



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


(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )