Plot recursive signal in Matlab

3k Views Asked by At

I need to create and plot this signal in matlab with 2000 points:

 x(n) = 0.6530 x(n-1) - 0.7001 x(n-2) + v(n)

Where $x(-1)=x(-2)=0$ and $v(n) =$ white noise

I have no clue about how to do it since I'm pretty new to matlab, I would appreciate any hint to begin with, but I would apreciate more some code.
Thank you.

1

There are 1 best solutions below

3
On

You want to start off by initializing an array of all of your inputs

n=3:2000

You also know that you will have an array of all your answers, so let's initialize an array for that

x=zeros(2000)

now let's go through every element of n and fill in the appropriate x value

for i=n
   x(i)=.6530*x(i-1)-.7001*x(i-2)+v(i)
end

now we can plot everything

plot(1:2000,x)

I am not exactly sure what the white noise is supposed to be, but you will have to fill in your own values for that