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
![]() |
Signal is the input, time-domain signal, usually in volts. At least three cycles of the signal must be contained in the time-domain record for a valid estimate. |
![]() |
AC estimate is the estimate of the input signal AC level, usually in volts rms if the input signal is in volts. |
![]() |
DC estimate is the estimate of the input signal DC level, usually in volts if the input signal is in volts. |
You must measure AC and DC content of signals you digitize. Of course if you have a periodic signal and you don't have an integral number of periods in the acquisition, you get spectral spreading, whether or not you're doing 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 desired results 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.