Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

11-30-2016 02:01 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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…

Best regards,

GerdW

CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

GerdW

CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

11-30-2016 02:48 AM - edited 11-30-2016 02:53 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.)

Best regards,

GerdW

CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

GerdW

CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO

Kudos are welcome

11-30-2016 04:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Greetings from Germany

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

11-30-2016 08:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Spoiler

Somewhere in teh back of my head there is an alarm going off saying "Negative RMS? Doesn't that break some physical law if not qualify one for a Nobel prize or something?

Ben

Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel .............. Great paleotechnics YouTubeChannel... talk about stone knives and bears skins! Check it out!

11-30-2016 10:01 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

11-30-2016 10:33 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

turn it 90° or 270° ??

Greetings from Germany

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Solution

Accepted by topic author MichaGue_01

11-30-2016 12:33 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@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.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines