10-27-2016 09:31 AM
Dear Community,
Please help my sanity! I am acquiring a 400Hz signal using a PXIe-6363 DAQ card and performing an RMS calculation within LabView. Reading the white papers published by NI I should need a sample rate ten times the fundamental to accurately represent the sinewave in the digitial domain and get the right result.
When I perform the measurements in the lab the thereory does not seem to align with reality! I have tried a number of different measurement configurations using whereby I vary the number of samples recorded to capture a single sinewave cycle at different sample rates. At a sample rate of 4kHz each time I run the acquisition I get a slightly different RMS value. Only when I perform the measurement at a 24kHz sample rate (60 times) do I get an acceptable and repeatable result.
Am I missing something?
10-27-2016 10:21 AM - edited 10-27-2016 10:22 AM
It would help if you supplied code.
My first thought is your RMS calculation. To get a really accurate RMS measurement, you have to have exact whole number of cycles in your array. Here is a VI I used to cut out samples from a waveform for this purpose.
10-27-2016 02:40 PM - edited 10-27-2016 02:42 PM
A big part of your issues is the weight you are giving each sample by only doing 10pts per cycle, and only one cycle (i.e only 10 samples). In statistical terms, this is a sampling error that approaches zero as samples increase. When you couple with this a few realities of your system, some issues emerge. Here's a few of them:
1. Your measurement system and generation sytem do not share the same timebase. One of them will be faster or slower than the other, so you will probably not ever actually get one exact full cycle. How severe these vary depends on how stable the two are. The DAQ device will be quite stable since its clocks are derived from a good quality crystal (be it on the board or through the backplane). However, I cannot comment on how stable your source is in time. Non-integer numbers of cycles can likely be fixed with a windowing function, but the effect of the window must be taken into account as well.
2. A true RMS calculation will include the effects of a mean value (offset). A standard deviation calculation will not include the effects of offset, which could be used if you only want to measure the AC portion of your signal. You mention that increasing the points per sample improves your result, so this is likely not the case.