2
\$\begingroup\$

Let's suppose that I am measuring a real-time periodic signal with an oscilloscope. Then I know that the oscilloscope is able to calculate the average value of the periodic waveform, and maybe even the rms values for higher harmoincs.

Now: in order to perform such calculations, the oscilloscope must be somehow aware that the signal is indeed periodic, and moreover it must be aware of how big the period is.

My question is: how can the oscilloscope get these informations from a real-time evolving signal? Does it recognize the waveforms pattern as the time goes by, or something like that?

The same question may be raised for multimeters, which can often perform such calculations on real-time periodic signals

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Many scopes simply analyze the picture on the screen; if that doesn't well capture the situation their "measurements" will be inapplicable. \$\endgroup\$ Commented Nov 12, 2020 at 23:54
  • 1
    \$\begingroup\$ The exact algorithm probably depends on your scope (checked the manual?), but I think the "cycle" measurements just estimate whatever the largest frequency in the measurement window is, then integrate over a time gate equal to one over that value. \$\endgroup\$ Commented Nov 13, 2020 at 0:03

3 Answers 3

3
\$\begingroup\$

Cheap multimeters make the assumption that waveform is a sinusoid and apply a multiplication factor to the peak value of the waveform. If you use them on any other waveform, the RMS reading will not be accurate.

Better devices like oscilloscopes uses the calculus definition of RMS and applies numerical integration to incoming samples over the past n samples (usually the samples displayed on the screen) to calculate RMS and average.

You can verify this by zooming in on the time scale so less than a full period of the waveform is on-screen and the calculated RMS and average will change. Then as you zoom out on the time scale and have more and more cycles on screen, the average and RMS readings will become more stable. That means that your RMS and average value calculations will be wrong if there are few cycles on the screen unless you have exactly an integer number of cycles on-screen. When you have many cycles on screen, it doesn't matter as much if the cycles on the edge of the screen get chopped off because they contribute proportionally less to the total sum/integral and therefore skew the result by less (see the equations at the bottom).

"But what if it's not periodic?" you ask? It doesn't matter; You can still calculate the RMS of any time block of waveform. You can calculate an RMS for any segment of waveform the same way you can calculate the average value for any sample of points. Remember, you can calculate the average for apple size if you wanted to, despite periodicity (and aperiodicty) being completely inapplicable to apples. You can actually calculate the RMS for apple size too, thought it won't carry much useful real world meaning.

There is no waveform recognition because very few real-world waveforms fall under a clear-cut mathematical definition.

In continuous time:

$$Average = \frac{1}{T}\int_0^{T}{f(t)dt}$$

$$RMS = \sqrt{\frac{1}{T}\int_0^{T}{f(t)^2dt}}$$

But in discrete time as would more likely be the case (i.e. a digital oscilloscope)

$$Average = \frac{1}{N}\sum_0^{N}{f(n)}$$

$$RMS = \sqrt{\frac{1}{N}\sum_0^{N}{f(n)^2dt}}$$

These are the generalized definitions of average and RMS and do not rely on knowledge of the waveform classification or periodicity.

\$\endgroup\$
2
\$\begingroup\$

I implemented an RMS function for an oscilloscope program not too long ago, so I have a little practical experience with how the algorithms work.

DKNguyen gave the basic mathematical definition in another answer.

What's missing is that naively applying it to a signal will result in inaccurate values.

If you can capture exact multiples of the signal frequency (number of cycles or half cycles,) then simply applying the RMS definition will get you an accurate number.

It's kind of tricky to do that with arbitrary signals with arbitrary frequencies. How do you tell for sure when you've got a full cycle of some signal with a mixture of frequencies?

To get an accurate value for arbitrary signals, you need to be certain that you get enough cycles of the input signal. Your sampled data needs to include about 8 cycles of the signal in order to get the error low enough to be ignored. I can't find it now, but I had a reference that explained that with more than 8 cycles the error would be less than 1%.

The simplest way to guarantee that minimum of 8 cycles is to pick a lower frequency limit and calculate the RMS function on a block of samples at least 8 times longer than one cycle of your lower limit.

As far as I know, multimeters that calculate RMS values all have a stated frequency range for given accuracy.

Take the Fluke 179 True RMS multimeter as an example.

Here are the specifications for the AC accuracy:

enter image description here

Note that there's a lower frequency limit. As you go below that frequency, the RMS values will be increasingly wrong.

That ties in with the minimum number of cycles needed to get accurate results.

I would expect the meter to integrate the RMS over at least 167 milliseconds.

Setting a lower frequency limit for the input signal and implementing a minimum integration time is simpler than trying to synchronize to the signal and capture some specific number of cycles.


The RMS function I implemented in my oscilloscope software just ignores the problem. It calculates the RMS value directly from the definition. The user (me) is expected to use a sweep speed that captures enough cycles of the displayed signal. It will happily display RMS values to 3 decimal places that are in fact more than 100 percent wrong when the sweep speed is too low.

\$\endgroup\$
2
  • \$\begingroup\$ The DAQ at work is currently set to calculate all samples over the past 500ms so as long as your fundamental is low enough (i,e. 60Hz) it works, but too low and you need to change it. But it is a DAQ with limitless memory. \$\endgroup\$
    – DKNguyen
    Commented Nov 13, 2020 at 14:30
  • \$\begingroup\$ With your current setup, you could expect decent results as long as the input is above about 16 or 17 Hz, and below half the sampling rate of the DAQ. \$\endgroup\$
    – JRE
    Commented Nov 13, 2020 at 14:44
1
\$\begingroup\$

They don't. Even more complex equipment such as Spectrum Analysers don't, they use a mathematical technique called windowing to reduce the impact of sampled partial cycles on the end result.

A true-RMS meter will just perform a mathematical calculation on the set of samples (regardless of number of samples or the "period). This will give an increasing accurate picture as more complete periods are in the sample window. For example if the period is 20ms and the sample window is 105ms (for arguments sake) there will be 5 complete cycles + 5ms total incomplete cycles in addition (on either end of the window). The averaging process in the RMS calculation will reduce this error, the result getting more accurate as the signal period is smaller.

\$\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.