In matlab how do I write u(n) in order to get the autocorrelation?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 2K views
nikki92
Messages
37
Reaction score
0

Homework Statement



u(n) = .4s(n)+.7s(n) -.1s(n-2)+v(n) where v(n) is zero mean and has variance 0.003 and uncorrelated with s(n)

I want the autocorrelation is E[u(n-k)u(n)] I can solve it easily by hand which is the follow
so r(k) = 0.663 for k =0, 0.21 for k=1 , -0.04 for k=2 and the rest are zeros.

The Attempt at a Solution


In MATLAB how do I write u(n) in order to get the autocorrelation?
 
Physics news on Phys.org
Did you try the built in MATLAB function 'XCorr' ?
 
I am not having trouble getting a function for auto-correlation, I am just not sure how to code u(n) in a way to input it into xcorr, also how would I represent v(n) in a way so it remains uncorrelated with s(n).