06-30-2014 02:01 PM
Hi experts!
Can anybody tell me, how the "DC-RMS Measurements.vi" works? More specifaclly, I would like to know if it returns a moving average or does it work on blocks of data, like averaging lets say over 1000 samples and returning only one value/1000samples ...
Best wishes,
Luke
Solved! Go to Solution.
06-30-2014 03:38 PM
Hi BrainDrain.
This VI only takes a single sample of data at every time, so it seems to be calculating a moving average. In its configuration window you can set the measurement time and the expected sample rate, so you can define the actual number of measurements samples. Once the number of samples which has passed through your system is getting closer to this "number of measurement samples" the accuracy will get better. You can use "output valid" to check.
Regards!
06-30-2014 04:55 PM
I think you're referring to the DC and RMS Measurements VI on the FPGA Math & Analysis palette? That one operates on blocks (or frames) of data, so it will return one valid output for every N inputs. As agomez mentioned, you can verify this by monitoring the output valid signal while executing in Simulation mode or under My Computer.
A continuous averaging measurement would be handy, but also requires storing the entire frame so you can subtract out the effect of the oldest point when it leaves the window.
06-30-2014 10:02 PM
07-01-2014 07:54 AM
Thanks all for the replies!
Indeed the DC-RMS.vi did not return the moving average. After beeing reminded to use the "execute on DevelopmentComputer"-mode, I quickly verified it with the script below. It returns the average/RMS/... of the numbers of samples specified during set up. It keeps this result until the next full sample is acquired...
Sorry for posting a trivial question...
Best wishes
07-01-2014 09:11 AM
@sth wrote:
Storing the past N values is not much different in terms of resource than taking the N values of input. An RMS calculation is not terribly difficult depending on how they implement the root function.
It's different in requiring BRAM or distributed RAM to store the N values. This was a bigger deal at the time it was written, both in terms of RAM availability and G language support for it. For the newer targets, not so much.