1
\$\begingroup\$

I require the method to calculate average voltage from a series of discrete points from an AC waveform.

Everywhere I look the answer is Vavg = Vpk * 0.637. I understand that this works for a perfect sinusoidal waveform but my data wont be perfect and I need the actual average voltage.

Could I just convert all my points to their absolute value and calculate the mean of them?

\$\endgroup\$
1
  • \$\begingroup\$ "the average value (mathematical mean of absolute values of all points on the waveform)" - Wikipedia \$\endgroup\$
    – Cornelius
    Commented May 26, 2014 at 19:21

3 Answers 3

0
\$\begingroup\$

Yes, since absolute value \$\Leftrightarrow\$ full wave rectification. For a perfect sine-wave, the MAV (Mean Absolute Value) is 0.637 of peak. In a general form:

$$E(MAV)=\frac{1}{T}\int_{0}^T|e(t)|dt$$

where \$e(t)\$ is the AC signal and \$T\$ is the time interval over which the average is the interest.

Measuring real waveforms, the precision of calculations depends on number of points taken. If measuring voltage, avoid the use of rectifier diodes - due to errors with voltage drops. Consider precision rectifiers based on op. amp. Another option (also with AD converter) is to handle the entire AC wave, with proper scaling and DC offset; and taking the absolute value in software.

\$\endgroup\$
0
\$\begingroup\$

I take it you are looking for the dc value of the AC signal. If so then...

If you want true average value of a series of points then sum all the points and divide by how many points there were. If you want a result in kind-of pseudo real-time then limit yourself to (say) 100 points, store all the values, do the sum and the divide then when the next sample comes "lose" the original 1st sample from the average and now include the new sample. It's called a rolling average.

\$\endgroup\$
0
\$\begingroup\$

Another way to find an average-like signal in real time, and are taking periodic readings then consider a constant \$\alpha\$ such that \$\alpha\$ << 1.

When you start up, set the output variable, call it y, to the first reliable value you get, or start with zero (but it will take longer to get to a value).

Each time you read a value, x, calculate \$ y := \alpha |x| + (1-\alpha) y\$

This is equivalent to a precision absolute value rectifier followed by a discrete-time IIR (infinite impulse response) filter with time constant \$ \tau = \frac {T_S}{\alpha}\$.

For example, if your sample time is 1msec and \$\alpha\$ = 0.001 you'll have a 1 second time constant filter.

One nice thing about this is that the storage and calculation requirements are minimal (which makes a difference in a resource-starved environment such as a PIC).

Of course you can also store a bunch of readings and make a FIR (finite impulse response) filter, and that may make sense in some situations. One advantage of the FIR filter is that there is no memory of the past after the number of readings you choose have expired- so if you have an enormous spike the hangover is not too bad.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.