Kaly Posted June 4, 2018 Share Posted June 4, 2018 Somehow, I can't find an 'rms' function in Daqfactory. Is there truly no way to calculate the actual rms value of an array? The array may not be a sine wave so I cannot simply divide by the square root of 2. How would one go about obtaining the actual rms value of an array? Link to comment Share on other sites More sharing options...
AzeoTech Posted June 6, 2018 Share Posted June 6, 2018 There is no built in function for calculating RMS, but if you can point me to a page with the formula you'd like to use, I can probably show you how to write it in DAQFactory. Link to comment Share on other sites More sharing options...
SteveMyres Posted June 7, 2018 Share Posted June 7, 2018 I thought 'Root Mean Square' WAS the formula? Link to comment Share on other sites More sharing options...
AzeoTech Posted June 9, 2018 Share Posted June 9, 2018 Yup, but I'm not sure how well it will work with quantized data. The accuracy is going to depend on the sampling interval, and some sort of curve fit might be helpful. But ignoring that and assuming you have a channel / array "X" with your data, the RMS calculation in DAQFactory would simply be: mean(x^2) ^ 0.5 Remember, doing x^2 returns an array the same size as x, where each value of x is squared. Mean() takes the mean of whatever array is provided to it. And ^ 0.5 raises whatever is to the left to the 1/2 power, which is the same as square root. Link to comment Share on other sites More sharing options...
Kaly Posted June 13, 2018 Author Share Posted June 13, 2018 OK So I think I have it all figured out. I attached a .ctl file showing how I did it. The file uses an original daqfactory example as a starting point. Does all seem well? Thanks. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 14, 2018 Share Posted June 14, 2018 I don't think so. You were on the right track at the bottom, but the field labelled RMS is: max(captureddata) / 2^0.5 when it should be: mean(captureData^2) ^ 0.5 Link to comment Share on other sites More sharing options...
Kaly Posted June 18, 2018 Author Share Posted June 18, 2018 The field labeled RMS is from the original Daqfactory example. That field calculates RMS value by first determining the peak. That would only work for a true sine wave. I added the 'TrueRMS' field (and some other things). The 'TrueRMS' field should show the true RMS value for any wave shape. Accuracy depends on the field labeled 'capture length'. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.