class="resources"
Computes an estimation of the AC and DC levels of the input signal. This routine performs spectral analysis to the extent that it separates DC (bin 0) from AC (the rms sum of the rest of the bins). Details

You must measure AC and DC content of signals you digitize. If you have a periodic signal and you do not have an integral number of periods in the acquisition, you get spectral spreading, regardless of whether you do an FFT later. This routine performs spectral analysis to the extent that it separates DC (bin 0) from AC (the rms sum of the rest of the bins). It applies the Hanning window. This window is sufficient for separating most of the AC energy from the DC bin.
The efficient mean and variance computations are used in place of Fourier analysis because the results you want are the total AC energy and the true DC, not information in each individual frequency bin.
The coherent gain and equivalent noise bandwidth constants for the Hanning window are needed to compensate for the windowing effects on gain and bandwidth.