I am trying to understand something with respect to autocorrelation. If the process is iid, I can say:
$R_{XX}[n, n + m] = E[x[n]] \times E[x[n + m]] \quad \textrm{if} \quad m \ne 0$
But if $m= 0$
We should get:
$R_{XX}[n, n + m] = E[x[n]] \times E[x[n]] \quad \textrm{if} \quad m = 0$
That is
$R_{XX}[n, n + m] = (E[x[n]])^2$
But in text books I always see, for m = 0
$R_{XX}[n, n + m] = E[x^2[n]]$
Why is it the latter rather than the former?
The general formula is $R_{XX}[n, n + m] = E[x[n] x[n + m]],$ which you can always use.
Specifically, $(x[n],x[n])$ is not an independent pair so you use the general formula.
But for i.i.d. the equation reduces to what you have when $m\neq 0.$