LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fft rms vs pk scaling

Solved!
Go to solution

I have a program that is taking waveform data from an accelerometer.  I eventually want the units in g's pk, but in the fft itself I get a cleaner signal by doing the RMS.  It is the same thing taking the g's RMS and then converting it to g's pk without the initial averaging?

 

New Bitmap Image.jpg

0 Kudos
Message 1 of 30
(5,543 Views)

Hi erfigge,

 

Can you clarify a few things about your application?

What do you mean by “g’s pk”? Is g your signal? Do you mean peak-to-peak?

What do you mean by RMS? There is a difference between RMS data and the RMS averaging algorithm.

What do you mean by the initial averaging?

Your FFT VI does not look like the built-in LabVIEW version and I cannot find the UNITS VI as a built-in function either. What version of LabVIEW are you using? Are those functions part of a driver that you are using?

 

Regards,

Kelsey Johnson

National Instruments

0 Kudos
Message 2 of 30
(5,509 Views)

KJohnson42, the NI fft vi I am using is SVFA FFT Spectrum (Mag-Phase).vi. 

 

Let me walk though the entire process.  I have an accelerometer which has a 100 mv/g output.  I am using the rio waveform acquistion vi's as you can see in the picture of my code in the first post.  I have the input scaled in the channel info there.  That waveform is then passed into the fft vi where I use the magnitude output to get graph that has vibration magnitude on the "y" axis and frequency on the "x" axis.  In vibration you have three types of measurement but for the most part only two of them are used, velocity (typically inches/sec) and acceleration (g's). 

 

Now, you can look at those measurements in three methods, peak, peak to peak, and RMS.  In the attached picture is Bently Nevada's explination of those measurements:

 

So my question is what exactly is coming out of the SVFA FFT Spectrium vi, pk, pk-pk or rms?  The SVFA Unit Conversion vi gives me the choice of pk, pk-pk or rms values to convert the units to.

 

0 Kudos
Message 3 of 30
(5,491 Views)

Hi erfigge,

 

This document should be able to answer your question:

http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/fftbasedviunits/

http://forums.ni.com/t5/LabVIEW/SVT-3-1-FFT-Spectrum-Magnitude-VI-output-is-RMS-or-Peak-db-OFF/td-p/...

The FFT it refers to is not the one specific to the Sound and Vibration Toolset, but the underlying code is the same. You can also look at the SVFA FFT Spectrum (Real-Im) VI, which shows that the output is in Vrms. The Mag-Phase VI uses the same process but just gives you the result in a different form (magnitude and phase rather than real and imaginary).

 

Kelsey Johnson

National Instruments

 

0 Kudos
Message 4 of 30
(5,468 Views)

Thanks Kelsey, that does clear it up, obviously I should have caught that in the help but I didn't.  Ok, so the output of the FFT is rms.  My next question is how is the RMS calculated?  Is is simply a square root of 2 function or is it calculating the true actual waveform rms?  A true sign wave will have an RMS value that is a function of square root of 2, but a noisy actual vibration wave will have some other factor.

 

The reason I'm asking is because I have a portible vibration shaker to verify the values I'm getting out of my code.  Here is an example.  I can set the shaker to 250 hz and a magnitude of 1g rms.  When I have my code set to output RMS, I am only showing a peak at 250hz of about 0.75g rms.  However, if I change the output to show peak it will match up exactly with the actual input rms signal.  At the end of the day I can take the signal output and use it as if it was rms, but I would like to try to understand what is going on.  I can post some pictures of the output of my code versus what the portable shaker is doing if that would help.

 

Otherwise, any thoughts?  I can also post that vi if that would help.

0 Kudos
Message 5 of 30
(5,446 Views)

Hi erfigge, 

 

 

When using the SVFA FFT Spectrum (Mag-Phase).vi there are two options when performing the RMS averaging. It can use either linear or exponential weighting. This KnowledgeBase discusses the differences between the two, and lists the equations used behind the scenes with the RMS and other averaging options, for your reference. The default behavior for the VI is to use exponential weighting, rather than linear weighting, which may explain the discrepancies you were seeing. 

 

Which setting you use can be selected on the VI itself. An explaination of what inputs do what for this VI can be found in the context help and detailed help in LabVIEW.

 

I hope this helps. 

Best Regards,

Thomas B.
National Instruments
Applications Engineer
0 Kudos
Message 6 of 30
(5,422 Views)

Thanks Thomas for the reply.  However I understand the linear and exponential averaging.  Even with no averaging I still seem to get a discrepancy.  I have done further testing and here is what I have found.  At low frequency's (<50 hz) my response is way off, if the shaker is producing 1 grms I'm only showing 0.5 - 0.75gs, the lower the frequency the worse this gets.  Between 50 - 500hz the response seems to be pretty close.  Above that frequency however the values start to slowly tail off again. 

 

The high frequency fall off isn't that big of a deal because it is approaching ranges that is outside of what we will be measuring.  I'm at a little bit of a loss as to explain what is going on.  Could a low pass or high pass filter be doing something?  Also, on the FPGA acquisition code I am subtracting the 5 volt bias voltage, is that the correct thing to do?

0 Kudos
Message 7 of 30
(5,418 Views)

One thing you may not have considered is that when taking a spectrum, not all the energy is in one "bin" or element of the spectrum array.  Even if the energy seems to be within one bin, if the sampling is not synchronous with the signal, some spectral leakage may occur.  It can be complicated to compare the energy in a time domain representation of a signal to the energy in the frequency domain representation.

 

Lynn

0 Kudos
Message 8 of 30
(5,412 Views)

Would that cause the effect to change drastically at lower frequency's and not higher frequencys?  I am using a hanning window at the FFT routine.

0 Kudos
Message 9 of 30
(5,409 Views)

I would need to think about that and probably do some calculations to give you an accurate answer.

 

I know that the FFT routines are not happy with input signals which have only a couple of complete cycles or less and can do some strange things with fractions of a cycle.  At higher frequencies you are likely to have many cycles and the fractional cycle component is a smaller percentage of the total signal at that frequency.

 

Can you post some typical data (time domain) at low and high frequencies? I do not have the SVFA toolkit so I cannot use the exact VIs you are using but I think they all use the same FFT algorithms internally.

 

Lynn

0 Kudos
Message 10 of 30
(5,403 Views)