To answer bennogs comment, and to use this function correctly, you need to observe the additional caveats that I made, along with the correction that Martyn made to the last caveat (i.e. that Measurements apply to the data set currently in the buffer). When I first zoomed in the Math Channel did dissapear, but only temporarily because it was recalculating the trace using the new data in the buffer (re-acquired because of the new zoom level). So the last caveat should read "

Math Channels only work on the current waveform data in the buffer, so zooming will create a new Math Channel in the display as the buffer will now contain a subset of the original waveform data".

To answer HrHunts comment,

when considering the whole trace the RMS calculation is never 100% correct because the instantaneous average of the squared sample values during the early part of the waveform is much smaller than the eventual average squared sample value that it will converge on. So, the region where that convergence is ramping up needs to be kept as short as possible for a good (but not perfect) representative True RMS trace (which you will notice I originally did by using a large number of cycles). However,

if you only consider the latter portion of the RMS Math Channel trace, where it has already settled at the average value, the RMS calculation will be 100% accurate and, if you are making a measurement, you clearly need to make sure that the rulers are only placed in this region, to get the correct measurement.

Bearing all of that in mind, you

CAN zoom in and still get the correct measurement done, but only if you are able place the rulers on a portion of the RMS trace where it has already converged/settled on the average value. If you zoom in too far, you will get a different measurement value, which will not be the True RMS value (as seen in your last post, in the zoomed view the curve starts at zero and doesn't even get to 200mV, while in the non-zoomed view, between the rulers, the curve starts and ends at 354mV, so the areas under the curves divided by the time, or the average values are completely different). So, the first caveat applies here, i.e. "You need to have enough cycles of the signal waveform that you're measuring, to allow the Math Channel waveform to converge on a single value".

Also, for some reason I posted an earlier version of the function. Absolute values are not needed if already squaring, so it should just be:

- Code: Select all
`sqrt(integral((A)^2)/T)`

Regards,

Gerry