1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Matlab help

  1. Mar 2, 2014 #1
    1. The problem statement, all variables and given/known data

    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.

    3. The attempt at a solution
    In matlab how do I write u(n) in order to get the autocorrelation?
  2. jcsd
  3. Mar 2, 2014 #2


    User Avatar
    Gold Member

    Did you try the built in matlab function 'XCorr' ?
  4. Mar 2, 2014 #3
    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).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted