# Implementing the noisy AR(1) Process

I'm trying to implement noisy AR(1) process and plot it. The observed noisy sequence x(n) = s(n) + w(n) where variance of w(n) = 0.2.

s(n) is defined as an AR(1) process with s(n) = 0.5 s(n-1) + e(n), for n=1:100, s(0) = 0 and the variance of e(n) = 1. w(n) and e(n) are independent.

I first do the following:

N = 100;                       % number of process samples.
a = [1, 0.5];                  % denominator coefficients, p = 1.
b = 1;                         % numerator coefficient.
s = filter(b,a, randn(1,N));   % generate N sample of AR(1)

nu = sqrt(0.2) * randn(1,N);
x = s + nu;

figure(1)
plot(s,'r');
hold on;
plot(x,'g');
legend('AR(1) Process','Noisy Process');


Can anybody help me whether I do the correct thing. Any help would be appreciated.

• What is causing you doubt?
– user28715
Dec 16, 2019 at 1:22
• Sir, I couldn't be sure whether I generate the AR(1) model correctly. Is this the way I generated it correct? Dec 16, 2019 at 1:30
• when you add noise to an AR process, the time series is ARMA. why are you adding noise?
– user28715
Dec 16, 2019 at 2:00
• Because that is the observation. After implementing the noisy Ar process, I will apply wiener filter. Assume the filter coefficients are stored in h. Should I apply the Wiener filter to x such that y=filter(h,1,x) which is the filter output? Dec 16, 2019 at 2:37
• I can’t say what you are doing is correct because I don’t know what your ultimate purpose is?
– user28715
Dec 16, 2019 at 3:02

Yes, the method you have used generates an AR-(1) random process by inputting Gaussian white noise of unit variance into the LTI filter defined by the coefficeints $$a$$ and $$b$$.