Need help with expectation of summation for power of Gaussian variable. I am trying to derive a formula, and getting stuck on a part of the derivation. Basically what I have is the following:
$$
P = \sum_{n=0}^{N-1} \sum_{k=0}^{N-1} \mathbb{E} \Big[x^2[n] x^2[k] \Big]
$$
Here, each sample of $x[n]$ is $\sim  \mathcal{N}(0, \sigma^2)$, and we can assume they are i.i.d.
I am confused as to how to proceed. I know that the cross terms are uncorrelated, so what I got is:
$$
P = (N^2 - N)\sigma^4 + \sum_{n=0}^{N-1} \mathbb{E} \Big[x^4[n]  \Big]
$$
But at this point I am not sure what else to do. Thank you.
 A: Let $X \sim {\rm Normal}(0,\sigma^2)$.  Then one way to compute the fourth raw moment ${\rm E}[X^4]$ is to use the moment generating function:  recall that for a normal distribution, $$\begin{align*} M_X(t) &= {\rm E}[e^{tX}] = \int_{x=-\infty}^\infty e^{tx} \cdot \frac{1}{\sqrt{2\pi} \sigma} e^{-x^2/(2\sigma^2)} \, dx \\ &= e^{(\sigma t)^2/2} \int_{x=-\infty}^\infty \frac{1}{\sqrt{2\pi} \sigma} e^{-(\sigma t)^2/2 + tx - x^2/(2\sigma^2)} \, dx\\ &= e^{(\sigma t)^2/2} \int_{x=-\infty}^\infty \frac{1}{\sqrt{2\pi} \sigma} e^{-(x/\sigma - \sigma t)^2/2} \, dx \\ &= e^{(\sigma t)^2/2}, \end{align*}$$ the last equality due to the fact that the integrand is simply a normal density with mean $\sigma^2 t$ and variance $\sigma^2$.
Subsequently, recall that the $k^{\rm th}$ raw moment is simply the $k^{\rm th}$ derivative of $M$ evaluated at $t = 0$:  $${\rm E}[X^k] = \frac{d^k}{dt^k}[M_X(t)]_{t=0}.$$  So we calculate the fourth derivative and get after some work $${\rm E}[X^4] = \left[\sigma^4 (3 + 6(\sigma t)^2 + (\sigma t)^4)e^{(\sigma t)^2/2} \right]_{t = 0} = 3\sigma^4.$$  Hence we obtain the result $$P = N(N+2)\sigma^4.$$
A: As the $X_i$ are non correlated, 


*

*$E(X_i^2 X_j^2) = E(X_i^2) E(X_j^2)$ if $i \neq j$, and 

*$E(X_i^2 X_j^2) = E(X_i^4) = E(X_j^4)$ if $i = j$.


As the $X_i$ are $\mathcal{N}(0, \sigma^2)$, the moments are known $E(X_i^2) = \sigma^2$, and $E(X^4) = 3 \sigma ^4$.
So $$P = \sum_0^{N-1} \sum_0^{N-1} E(X_i^2 X_j^2) = N(N-1) E(X_i^2) E(X_j^2) + 3N E(X_i^2) = N(N+2) \sigma^4.$$
Credits goes to @Spacey
