I have a time series that consists of noise and a signal, shown here windowed and Wiener filtered:
and the PSD of just the noise (used in filtering):
I want to find the variance of the noise using the PSD in order to estimate the significance of a measurement. I'm not super well-versed in signal processing, so I apologize in advance for any conceptual blunders! From digging around Wikipedia and StackExchange, I found that I can estimate the variance of a deterministic process like so:
$\sigma_{x} ^{2} = \int_{-\infty}^{\infty} S_{x}(f)df - \mu_{x}^{2}$
where $S_{x}(f)$ is the PSD and $\mu_{x}$ is the mean (side note: should there be a factor of $\frac{1}{\pi}$ or $\frac{1}{2\pi}$ in front of the integral?).
I then found this answer that confirmed that.
My question is: what modifications, if any, do I have to make to that formula to apply it to a stochastic process (the noise)? Also, the answer linked above specifies a stationary process- do I have to detrend the noise or can I assume that it is stationary?