\begin{exercise}{Autocorrelation function of a random process}
Consider the following real-valued random process
\[
x[n]= A\cos(\omega_{0}n)+ w[n]
\]
where $A$ is a Gaussian random variable with zero mean and variance $\sigma_{A}^{2}$ and where $w[n]$ is a zero-mean white noise process, independent of $A$, with variance $\sigma_{w}^{2}$.
\begin{enumerate}
\item What is the autocorrelation of $x[n]$?
\item Can we define the power spectral density of the process?
\item Repeat (a) and (b) in the case when the cosine starts with a random phase offset, uniformly distributed over $[-\pi, \pi]$ and independent of all the other random variables.
\begin{exercise}{Filtering a Sequence of Independent Random Variables in Python}
Let $x[n]$ be a real-valued white Gaussian random process, with zero mean and variance $\sigma_x^2=3$. We filter the process with the FIR filter $h[n]$ where
\[
h[1]=1/2, \quad h[2]=1/4, \quad h[3]=1/4, \quad
h[n]=0~\forall~n\neq1,2,3
\]
Moreover, at the output of the filter, we add white Gaussian noise $z[n]$ with unit variance. The system is shown in the
\item Write a routine in Python to generate $N$ samples of the input process, $N$ samples of the additive Gaussian noise and compute the output of the system.
\item write a routine to estimate the power spectral density of the output
\item compare the numerical estimation of the PSD with its theoretical value