From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging using the 'basic DC/RMS' VI

Solved!
Go to solution

I seem to end up using the 'basic DC/RMS' VI quite a bit to average my data from my DAQ system. However I have a question regarding what is happening 'under the hood'.

Let's say for simplicity I acquire data at 1kHz in blocks of 1000 samples.

So, every 1 second I shove 1000 samples into the basic DC/RMS VI, as a waveform data type.

This means that the 'DC' and 'RMS' outputs will update at a rate of 1 second.

 

The question is, is the averaging 'continuous'? In the sense that if I were doing 'proper' low pass filtering (averaging is just the same as low pass filtering) - say simple FIR with n taps - in DSP then the filter output would have to update at the same rate as the data input; ie. the taps would 'move along' the input data at the same rate as the input data goes into the filter. I'm guessing based on my explanation above that this is not what is happening. Instead, the DC/RMS VI is averaging an entire block of 1000 samples, and then 'jumping' 1000 samples along and doing the next block.

 

This isn't necessarily a problem, but it is not true low pass filtering and I can image some scenarios where there could be artefacts because the averaging filter is jumping 1000 samples each time it takes an average. I suppose the only alternative is to implement the filtering in a much higher speed loop and this could be problematic at higher sampling rates.

 

Anyone got any thoughts on this? Am I worrying about nothing?

Dave

 

 

0 Kudos
Message 1 of 2
(3,430 Views)
Solution
Accepted by topic author oilyfingers

Hi Dave,

 

 The "Basic Averaged DC-RMS" function is designed to work only with continuous acquisitions, it will throw a warning is the signal is not continuous. When you open the function and look at the code underneath the function there is a subVI with state information which allows the function to continue the average from the previous block of data. 

For this reason we supply a reset terminal if you need "forget" the previous calculations.

A lot of this is discussed in the detailed help on the function, but as always sometimes you have to get your hands dirty to find out how the code actually works and look at the code.

 

Regards
JamesC
NIUK and Ireland

0 Kudos
Message 2 of 2
(3,318 Views)