# Mean of input based on acf of filtered output

By looking at the ACF of the output of a filter whose impulse response I know, can I approximate the mean of the input?

For example

x = randn(1000,1);
y1=filter(ones(5,1),[1],x);
y2=filter(ones(5,1),[1],x + 0.2);
res1 = xcorr(y1,'unbiased');
res2 = xcorr(y2,'unbiased');


When I plot res1 and res2 it is clear res2 has an identical shape but shifted up. This makes me think that just by looking at the ACF I can tell which process has more 'DC' but is there a way to quantify it?

Yes. Mathematically, the limiting value of the autocorrelation function $$R_X(\tau)$$ of a wide-sense-stationary process is $$\lim_{\tau\to\infty}R_X(\tau) = \lim_{\tau\to-\infty}R_X(\tau) = \mu_X^2$$ where $$\mu_X$$ is the mean of the process. So it is not too surprising that res1 and res2 have identical shapes but res2 is shifted upwards in comparison to res1 and the above equation tells you how much the shift is.
• Would it be fair to say that practically finding this mean would be impossible as xcorr actually gets more and more unreliable as \tau increases ? – Bula Mar 5 at 22:27