LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a low pass filter with Amplitude and Level Measurements RMS.

I am trying to pass the output of the Amplitude and Level Measurements Express VI (outputting RMS) into a low-pass filter, but cannot, as the RMS signal is only a single value. I have tried using the Repack Values express VI without success. How can I filter the RMS measurement?

Thanks,
Logan Williams
0 Kudos
Message 1 of 6
(3,851 Views)
Logan,

Can you explain more clearly what you are trying to do? As you mentioned filtering a single value does not make any sense. Are you calling the Amplitude and Level Measurements VI multiple times and want to filter the results?

If so, then accumulate the results into an array. Then filter the array.

Perhaps you should filter first and then do the Amplitude and Level Measurements.

Lynn
0 Kudos
Message 2 of 6
(3,839 Views)
Yes, Amplitude and Level Measurements is in a while structure, so it is being called multiple times, in this case, 20 times a second, as it is processing data from a DAQ card which is collecting 500 samples at 10khz.

Filtering it first would not help, as it is a sine wave input that should have a consistent RMS voltage, but Amplitude and Level Measurements jumps around a little, and I wanted to filter that jump out.

Accumulating the results into an array sounds like what I want to do, but how do I go about doing it? Can I use the Repack Values Express VI, or do I need to use the Insert into Array VI? I am new to LabVIEW, so any help is appreciated.

Thanks,
Logan Williams
0 Kudos
Message 3 of 6
(3,829 Views)
Logan,

Use a shift register to pass the data from one iteration to the next. The most memory efficient way to handle a growing array is to initialize the array outside the loop (to a size equal to or greater than the largest amount of data you expect to accumulate) and us Replace Array Subset inside the loop.

Your measurements may be jumping around because you do not have integral numbers of cycles of your sine wave. Mathematically RMS is meaningful for infinitely continuous signals or for integer numbers of complete cycles of a periodic signal. If your signal starts at a zero crossing and ends at 3 volts, you will not get good results. Physical voltmeters use an exponentially decaying weighting to attenuate and minimize these effects, but you can see jumping if the frequency is low enough.

Lynn
0 Kudos
Message 4 of 6
(3,823 Views)
Thanks for the help with shift registers, I'll try that out.

It is a 60 Hz sine wave, and I have tried capturing data at 6000 Hz, but that just makes the jumping worse, if anything.

Logan
0 Kudos
Message 5 of 6
(3,819 Views)
Logan,

If the signal to noise ratio is quite high, try using the Array Min and Max function and calculate the RMS from the peak to peak. This method does not care about integral cycles. If the signal is noisy, apply a moving window average to small segments before finding the peaks.

Lynn
0 Kudos
Message 6 of 6
(3,804 Views)