11-30-2016 02:01 AM
Hello,
I acquire a sinusodial waveform signal and calculate the RMS value using "Average DC-RMS.vi". The calculation works, if the waveform is symmetric around 0. If I add an offset, the calculation is wrong. Any ideas how to solve this?
Thanks a lot and best regards.
Michael
P.S.: I am using LabVIEW 2012.
Solved! Go to Solution.
11-30-2016 02:34 AM - edited 11-30-2016 02:35 AM
Hi Micha,
If I add an offset, the calculation is wrong.
What exactly is wrong with the result? Which result do you expect?
You know how the RMS is defined?
Any ideas how to solve this?
You might subtract the DC offset from your waveform before calculating the RMS…
11-30-2016 02:48 AM - edited 11-30-2016 02:53 AM
Hello Gerd,
if amplitude is less high then the negative offset the vi calculates a positive value (e.g. amplitude 1V, offset -2V ==> RMS = 2,12V). Okay, depending on the definition, the result might be right, but in realitiy for me it is wrong. In reality it should be a negative value.
How can get the offset, if I only have a acquired wafevorm?
Thanks a lot and best regards.
Michael
11-30-2016 02:53 AM
Hi Micha,
In reality it should be a negative value.
So you want to have a negative value - from an operation, which involves to square values and take the root from a sum?
Really???
Okay, depending on the definition, the result might be right, but in realitiy for me it is wrong.
No, even in reality the result is correct!
You need to define your requirements - and develop an algorithm to fulfill those requirements…
How can get the offset, if I only have a acquired wafevorm?
There are functions to calculate the DC offset from a waveform…
(Basically it's just the mean value.)
11-30-2016 04:22 AM
So, what is the task you have to solve?
I have a maybe similar task when I calibrate DAQ cards: My calibrator (Fluke 5700A :)) create a well defined RMS output and the DAQ will read a sine including an offset (and more) . In my application the sine amplitude is the value of interest.
So I apply a sine fit ( easy method is tone detection.vi 🙂 ) to get the amplitude and phase and look at the residual (RMS :), peak to peak noise, offset and (harmonic) distortion). Read a full number of periodes that also matches full periodes of your line frequency and you can get nice results.
11-30-2016 08:03 AM
@MichaGue_01 wrote:
How can get the offset, if I only have a acquired wafevorm?
Suppose I generate a random signal (using the NI Random Number generator which gives values between 0 and 1) of 1000 points and ask "What is the offset of this signal"? What would you answer? How did you get that? What if I added an (unknown-to-you) additional offset to it? How would you compute the offset?
You could do the same thing with a sinusoidal signal, but you might be a little bit "off" depending on how you define "offset". To understand what I mean, consider that the signal represents a half-sinusoid, i.e. sin (theta), where theta goes from 0 to pi. If you have many cycles of a sinusoid, the "offset estimation" method I hope you figured out from the previous paragraph should give a more accurate answer.
Bob Schor
11-30-2016 08:33 AM
Us the;
Signal Processing >>> Waveform Measurments >>> Basic Averaged DC-RMS
to calculate the DC level and simply subtract that DC from your waveform PRIOR to getting the RMS value and you will get the value you want save the negative sign.
Ben
11-30-2016 10:01 AM
11-30-2016 10:33 AM
turn it 90° or 270° ??
😄 😄
11-30-2016 12:33 PM
@MichaGue_01 wrote:
if amplitude is less high then the negative offset the vi calculates a positive value (e.g. amplitude 1V, offset -2V ==> RMS = 2,12V). Okay, depending on the definition, the result might be right, but in realitiy for me it is wrong. In reality it should be a negative value.
No. RMS is a measurement of the AC component of a signal (closely related to peak-to-peak). Offset is the DC component. So RMS should never be negative.
As Ben stated, to do your measurements properly you need to calculate the average of the signal (gives you the offset), subtract that value from every data point and then calculate the RMS. If you have really tight limits, you should also do some processing to make sure you have an integer number of cycles captured.