0
$\begingroup$

I'm working on the below problem

Given a WSS random process $X(n) = K \cos(2\pi n + \Theta)$, where $K$ is a constant and $\Theta$ is a random variable with a uniform distribution between $0$ and $2\pi$. $X(n)$ has mean value $0$ (zero) and autocorrelation $\phi_{xx}(l) = \frac{K^2}{2} cos(2\pi l)$.

$X(n)$ is applied to an N-point moving average filter, producing the output $Y(n)$. Calculate the average output power $P_Y$.

$\textbf{Solution}$

It is clear that $P_X = \frac{K^2}{2} cos(2\pi \cdot 0) = \frac{K^2}{2}$ ($= \sigma_X^2$ since $m_X = 0$).

The $N$ point moving average filter can be described by the impulse response: $h(n) = \frac{1}{N} \sum_{k=0}^{N-1} \delta(n - k)$. The output of the filter has also zero mean ($m_Y = 0$) and also $\sigma_Y^2 = \sigma_X^2 \sum_{n=-\infty}^{\infty}|h(n)|^2 = \sigma_X^2 \frac{1}{N} = \frac{1}{N} \frac{K^2}{2} = P_Y$

However, if I move to the freq domain then I have the following: The power spectral density of the output $Y(n)$ is given by $S_Y(\omega) = |H(e^{j\omega})|^2 S_X(\omega)$. The average output power $P_Y$ is the integral of the power spectral density $S_Y(\omega)$: $P_Y = \frac{1}{2\pi} \int_{-\pi}^{\pi} S_Y(\omega) d\omega$.

The power spectral density of $X(n)$ is the Fourier transform of the autocorrelation function $ \phi_{XX}(l)$, we get: $S_X(\omega) = \mathcal{F}\left\{\frac{K^2}{2} \cos(2\pi l) \right \} = \frac{K^2}{2} \cdot \pi \left( \delta(\omega - 2\pi) + \delta(\omega + 2\pi) \right)$. If I am to use this $S_X(\omega)$ in the integral for $P_Y = \frac{1}{2\pi} \int_{-\pi}^{\pi} S_Y(\omega) d\omega$ then $\delta(\omega \pm 2\pi) = 0$ within the integration limits $[-\pi, \pi]$ and the result is $0$ !

Pretty sure that I 'm having a fundamental error somewhere (probably in the definition of the $P_Y$ integral).

Any inputs are welcomed!!

$\endgroup$

1 Answer 1

1
$\begingroup$

You found the autocorrelation of $X(n)$ to be $R_X(l)=\frac{K^2}{2}\cos(2\pi l)$ (typo fixed) where $l \in \mathbb{Z}$ since this is a Discrete-Time Random process. Hence, your autocorrelation function is not a sinusoidal but rather a constant: $K^2/2$ since the cosine term is always 1. So its DTFT is not two impulses but rather just a single impulse at DC $(\omega=0)$.

From the constant autocorrelation and actually from the definition of the process itself you can identify that $X(n)$ is constant in each realization.

$X(n+1) \;=\; K \,\cos\!\bigl(2\pi(n+1)+\Theta\bigr) \;=\; K \,\cos\!\bigl(2\pi n + 2\pi + \Theta\bigr) \;=\; K \,\cos\!\bigl(2\pi n + \Theta\bigr) \;=\; X(n).$

So let

$X(n) \;=\; A(\Theta), \quad \text{where } A(\Theta)=K\,\cos\!(2\pi n + \Theta)=K\,\cos(\Theta).$

Which means

$Y(n) \;=\; \sum_{k=0}^{N-1} \frac{1}{N}\,X(n - k) \;=\; \sum_{k=0}^{N-1} \frac{1}{N}\,A(\Theta) \;=\; A(\Theta).$

Hence, $Y(n)$ is the same as $X(n)$ which isn't surprising since $X(n)$ is perfectly correlated and you are taking its moving average. To find the output power we proceed as follows:

$E\bigl[Y(n)^2\bigr] \;=\; E\bigl[A(\Theta)^2\bigr].$

$E\bigl[\cos^2(\Theta)\bigr] \;=\; \frac{1}{2\pi}\,\int_{0}^{2\pi} \cos^2(\theta)\,d\theta \;=\; \frac{1}{2}.$

$E\bigl[A(\Theta)^2\bigr] \;=\; E\bigl[K^2\,\cos^2(\Theta)\bigr] \;=\; K^2 \,E[\cos^2(\Theta)] \;=\; K^2 \times \frac{1}{2} \;=\; \frac{K^2}{2}.$

Both of the methods that you chose in your own working have been applied incorrectly. If you do apply them correctly then you should also get the same answer.

$\endgroup$
3
  • $\begingroup$ Thank you for the detailed explanation. One thing that puzzles me is the following: The impulse response $h(n)$ is nonzero only for $n = 0, 1, \ldots, N-1$. So $\sum_{n=-\infty}^{\infty} |h(n)|^2 = \sum_{n=0}^{N-1} \left( \frac{1}{N} \right)^2$ $= N \cdot \left( \frac{1}{N} \right)^2 = \frac{1}{N}$ Therefore $\sigma_Y^2 = \sigma_X^2 \cdot \frac{1}{N}$ or $\sigma_Y^2 = \frac{K^2}{2} \cdot \frac{1}{N} = P_Y$ since the mean of the output is zero. What am I missing here? $\endgroup$ Commented Jan 17 at 12:25
  • $\begingroup$ The relation that you are using is incorrect, iirc it only works if $X(n)$ is white which in this case it clearly is not... $\endgroup$ Commented Jan 17 at 12:40
  • $\begingroup$ Thank you for the quick reply and clarifications! Searching in "Discrete-Time Signal Processing" from Oppenheim it proves this equation only for White Noise as you point out... $\endgroup$ Commented Jan 17 at 14:06

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.