In this part of the assignment, you will need to calculate the cross-correlation of two random...

50.1K

Verified Solution

Question

Electrical Engineering

In this part of the assignment, you will need to calculate thecross-correlation of two random signals. In the Appendix: Part II,we include the function ccorr that gives you the crosscorrelationof two input vectors.

MATLAB provides other built-in function that may be useful forthis part of the assignment

• max: gives you the maximum value of a vector. For moreinformation type help max

find: gives you the index corresponding to a value of a vector.For more information type help find.

Finally, you will also need to use a linear filter in Exercise3. You can use the function linfilt that you already used inMA2.

You can calculate the cross-correlation between two randomsignals in MATLAB by using the function ccorr given in theAppendix: Part II. As an example, consider two random signals x(t)and y(t), which are both modeled as white Gaussian random processeswith mean 0 and variance 1. We plot the cross-correlation functionRxy(? ) of the random signals x(t), y(t) by applying the followingMATLAB code:

t = -10:0.01:9.99;

x = randn(1, length(t));

y = randn(1, length(t));

[cc, tau] = ccorr(x,y,t);

plot(tau,cc);

In the same way you can plot the autocorrelation of signal x(t)[ac, tau] = ccorr(x,x,t); plot(tau, ac);

Now assume that y(t) is the output of a linear filter withimpulse response h(t) = |sinc(t ? 2)|

where the input x(t) is a white Gaussian random signal with mean0 and variance 1. Create an M-file to:

(a) Calculate y(t) using the function linfilt and plot x(t) andy(t) where t ranges from ?10 to 9.99, using 0.01 increments. NOTE:y(t) is the output signal of the filter, so if N is the length ofthe vector t, the length of y(t) is N + N ? 1 (convolution of twofunctions with length N). You will have to find the indices thatcorrespond to t from ?10 to 9.99.

(b) Plot the cross-correlation function Rxy(? ).

(c) Plot the autocorrelations Rxx(? ) and Ryy(? ) of x(t) andy(t), respectively.

Answer & Explanation Solved by verified expert
3.9 Ratings (598 Votes)
clcclear allclose allt10001999x1randn1lengtht0 inputhsinct2 filterylinfiltxhlengtht functionsubplot211plotthtitleInput random signalxlabeltimeylabelAmplitudesubplot212plotyt1200011998plott1ytitleConvoluted    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students