# Uncertainty of approximately sinusoidal voltage measurement

Say one is interested in measuring the mean value an approximately sinusoidal voltage with an instrument that has an accuracy of 0.01 V, according to its spec sheet. 10 periods of the oscillation have been acquired, with 1000 voltage samples per period. How would one go about stating an uncertainty for the sample mean voltage?

My thought is to first calculate a confidence interval on the mean by dividing the time series into ensembles, one for each period, then using the standard deviation of those ensemble means to compute a confidence interval for the overall mean, using the Student-t table. This would make the number of independent observations 10, not 10000 (the total number of samples), but would give a smaller sample standard deviation.

I would then combine this value root-sum-square with the published instrument accuracy. This method doesn't seem quite right to me. Am I off the mark?

• When you say "mean" do you mean RMS mean voltage, or do you mean to say "how far from zero is the mean of this sinusoid"? Do you know the frequency accurately (you say 10 periods and 1000 samples per period, so that suggests that you do...) Nov 28 '14 at 15:49
• I mean the true mean of the signal, as in how far from zero. I assume I know the frequency of the signal, since it is caused by a mechanical process, for which I know the phase angle. Nov 28 '14 at 16:51
• What do you mean by instrument accuracy? Is this a random error in each measurement or a systematic bias in every measurement you have taken? Are the voltage samples taken randomly over the whole cycle or with a known even sampling interval? Nov 29 '14 at 10:34
• Instrument accuracy is what would be published on a data sheet, e.g., combined error from non-repeatability, non-linearity, etc., derived from the factory calibration. It's sort of vague, but it's all I have to work with. The voltage samples are taken at a known sampling interval. Dec 1 '14 at 17:08

Several things spring to mind here.

The "brain dead" way to estimate things would be to take the mean of all the samples and divide by the standard deviation. But as you point out, that gives you a rather large standard deviation and it does not take advantage of everything you know. In general, such an approach would suffer very badly from aliasing: if you don't sample an exact number of wave forms, you will get huge errors in estimating the DC offset (in the extreme case imaging you are sampling just half a wave form and you can see what I mean).

Usually, if the frequency is not exactly known (or not an exact multiple of the sampling frequency) you can address this issue with a windowing function (Hamming or Hanning window) which give less weight to the samples near the ends of the sampling interval, and which results in less spectral spreading. But in this case you are interested in the mean (DC, frequency 0) of the signal, so I would suggest another approach.

First - find the amplitude of the sinusoid. If you are sure that your signal frequency is exactly locked to the sampling frequency, you can do a simple DFT. In Matlab, you could do:

t = 0:9999; % not interested in actual frequency; just need 10k samples
s = sin(2*pi*t/1000); % template of sin wave - 10 complete cycles
c = cos(2*pi*t/1000); % template of cos wave
normVal = s*s'; % value you would get for an amplitude of 1
s_component = signal*s'/normVal; % multiply and add - assume signal is 10k element row vector
c_component = signal*c'/normVal; % ditto
best_fit = s * s_component + c * c_component;
residual = signal - best_fit;


Now you can process the residual: you can see if there are any other frequencies present (for example you could do an FFT), and/or you can look at the RMS value of the mean.

It's usually a good idea to study residuals carefully: it tends to show you structure that you might not see when the main signal is on top of it. So compute it, plot it, histogram it, analyze it (do a normality test) and decide how to proceed. There is no 'one size fits all' answer.

As always - ask questions if you need clarification.