LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fft rms vs pk scaling

Solved!
Go to solution

johnsold, when I get back to my other office where I have the shaker I will post some data.  I have simplified my VI down to just the data acqusition stuff with the normal fft (mag-phase) vi.  The only reason I'm using the sound and vibration one is it makes it easer to use the peak search routine after taking the FFT. 

 

Here is exactly what I am doing in case any of this makes a difference.  I have 32 analog input chanels on my sbRio.  2 channels are acceleration (16 & 19).  The sensitivity of the sensor is 100mv/g.  The accelerometer runs through a seperate power board that provides the supply current and a gain of 25.  So, once the signal reaches the analog input of the sbRio the sensitivity is 2500mv/g. 

 

For the rest of the IO speed isn't really a concern.  So, I run the FPGA loop at 20,000 hz as needed by the vibration, and increment between the rest of the IO every loop cycle.  So, the first FPGA loop iteration I take 3 data points, the two vibration and the first analog input.  The next loop iteration, I take the two vibration chanels and the second analog input.  I repeat this 8192 times at 20,000 hz.  So that gives me 2 acceleration waveforms with 8192 points, and waveforms for the rest of the IO that were taken only at the rate of (20,000hz/number analog points). 

 

At any rate, the rest of the IO doesn't matter I'm mainly trying to get the acceleration chanels to work correctly.

 

My portable shaker can produce a vibration signal at any magnitue and frequency I dial in.  So, I am testing between 10hz and 10,000hz and between 0.25g's rms and 2g's rms.  The attached excel sheet has the results of what my fft result was versus source.  I also messed around with the gain, and found I could vary that depending on the fundamental frequency I was looking at and make the actual fft fundamental frequency result match up perfectly.  However this approach doesn't make sense to me and I don't know what that would do to the rest of the spectrium.

 

Sorry for the long post, I'm just at a loss, and the portable shakers are very expensive to rent and my week with it is coming to an end. 

 

 

0 Kudos
Message 11 of 30
(2,037 Views)

The ideal way to post some data would be to wire an indicator to the output of Read(poly).vi in vibration testing.vi, run the VI, stop it with typical data in the indicator, make the data default, and save. Then post that modified VI. With the data saved in the indicator, we can actaully manipulate your data and see if we can resolve your issue.

 

If you are sampling at 20 kHz and collecting 8192 data points that takes 0.41 seconds and represents 4.1 cycles at 10 Hz.  The frequency resolution of the FFT is df = fs/N where fs is the sampling frequency and N is the number of samples. For your values df = 20000/8192 = 2.44 Hz.  So the first few bins are 0, 2.44, 4.88, 7.32, 9.77, and 12.2 Hz.

 

Recall that the mathematics of the Fourier transform is based on integrating from -infinity to +infinity over time. When working with finite data sets you get the transform of the data signal convolved with the window signal. Your raw data in effect has a rectangular window of 410 ms duration. Your Hanning window "softens" the effect. The finite window broadens the signal so that it has more bandwidth than the ideal infinitely continuous signal. The rectangular window at 410 ms has a sin(x)/x spectrum with the width of the main lobe about 2.44 Hz.

 

When sampling a ~10 kHz signal at 20 kHz you get only about 2 samples per cycle. This means that you have very little information about the signal and it may take a long time to get enough samples to very accurately determine the amplitude of the signal.

 

I put together a simple VI to show some of these things.  Note that the frequency is expressed in normalized units of cycles/sample.  The default value of 5E-4 represents a 10 Hz signal with 8192 samples at 20000 samples/second. Values for a few other frequencies are shown on the front panel. I did not scale the X-axes of the graphs. The units are just sample numbers or the index into the array.  Try it at various frequencies. Expand the x-axes to see the details of the waveforms and the spectra. In particular note that the data points on the spectrum magnitude graph are NOT symmetric about the peak.

 

Lynn

 

0 Kudos
Message 12 of 30
(2,028 Views)

Ok, I have attached some screen shots. The top chart is the results of the FFT, ignore the middle chart, and the bottom chart is the raw signal before FFT.  The gain of the sbRio system should be 2500 mv/g (100 mv/g * board gain of 25).  That picture is the titled sbrio scale 2500.  The next picture is with me messing with the gain to make the fundamental frequency value match my scxi system. 

 

The third picture is another scxi system with the scxi-1531 card.  We have calibrated this several times and it is always spot on.  It is also using the same fft vi that my sbRio code is using. 

 

A clarification from before, my sbRio system is actually running at 25,000hz, still 8192 points.  The scxi system is running at 32,708hz also with 8192 points.  For the scxi system has a lowpass cutoff frequency of 20,000hz (help says frequency in hz that corresponds to the -3db cutoff of the filter).  I understand that I will get slightly different results with different systems, I just didn't expect for the results to be this far off from one another.  I can also prove my system being off a bit with the portable shaker. 

 

I wonder if the company that designed our hardware board has something strange going on in the circuit that puts the gain of 25 on the accelerometer channels.........  When I asked about the physical lowpass cutoffs on our board here was the response:

There is a second order low pass filter that will be -3db at 1.65KHz. The AC coupling network at the input to the channel will give you a first order high pass filter and be -3db at 25Hz.  Here is another thing he said about our custom board:

The bandwidth for the acceleration channels on the analog board is 25-1.65KHz. If the bandwidth is different on another system and there are frequency components outside the bandwidth, the RMS readings between the two systems may differ.

 

I understand vibration fundamentals but I'm just a lowly mechanical engineer and not and EE to understand some of the signal analysis stuff....  😞

 

 

0 Kudos
Message 13 of 30
(2,021 Views)
Solution
Accepted by topic author erfigge

OK. There is the explanation for most of the effect!


There is a second order low pass filter that will be -3db at 1.65KHz. The AC coupling network at the input to the channel will give you a first order high pass filter and be -3db at 25Hz.  Here is another thing he said about our custom board:

The bandwidth for the acceleration channels on the analog board is 25-1.65KHz.


 

Look at your spreadsheet. The 1 g column shows the mid range values at ~1.06. A filter which is -3 dB at 25 Hz will produce an amplitude of 1/sqrt(2) times the input.  That would give an expected value of 0.75 at 25 Hz which is quite close to the 0.7 you have measured.  Similarly the rolloff at 1 kHz probably reasonable for a 1.65 kHz cutoff filter.  Filters in equipment like that are not usually very precise in frequency so the slight difference at the low frequency end is reasonable. I do not have one of my filter books at my desk right now but I think the 1 kHz values are probably due to the filter.

 

With that filter in the signal conditioning board you can probably expect fairly consistent results from 50 Hz to 825 Hz.  Staying an octave away (factor of two in frequency) from the cutoff frequencies will keep your signals in the part of the band where the filters have very little effect.  If you need to operate closer to the band limits, you should run some calibration curves to see what the effects of the filters are. The filters will change the phase of the signal as well as the amplitude. Both the amount of phase change and the amplitude response are functions of frequency.

 

Lynn

Message 14 of 30
(2,016 Views)
Lynn, thank you very much for your expertise. How you explained it makes perfect sense and puts meaning behind the variable scaling chart I put together. On my spreadsheet that is the table and chart on the right side. I accept the fact there are things I don't understand, but I always want a reason as to why the things are the way they are.

I didn't even remember what was in there for cutoff filters until I went digging for that post. Even at that I don't know for sure how the filters do what they do. ------- So right after I wrote this I had to do some searching. This post has a couple of good links in it which explains the filters and the reasoning for them in case anyone else finds this thread.

0 Kudos
Message 15 of 30
(2,006 Views)

Lynn, I thought of a follow up question to this.  So, basically I'm changing the gain of the accelerometer based off the rotating fundamental frequency of the unit under investigation.  By doing that I have verified the 1x reading is spot on with what it should be.  What does that do to the rest of the fundamentals though?  We usually look at the 1/2x, 1x, 2x, 3x and 4x fundamentals.

 

Thanks,

 

Eric.

0 Kudos
Message 16 of 30
(1,992 Views)

Ok, so I've thought about this over lunch and I think I have been making a basic mistake.  The variable gain across the frequency range isn't dependent on the machine frequency, it is dependent on the frequency you are looking at across the chart (x axis frequency, y axis magnitude).  Is this correct?

 

If that is correct, is it the same thing to take the FFT of an unscaled signal and scale the different portions of the waveform after the FFT?

 

I thought I had this solved, but of course sleeping on it over the weekend brought me to these thoughts......

 

Thanks,

 

Eric.

0 Kudos
Message 17 of 30
(1,986 Views)

Hi Eric, 

 

I believe you are right in saying that your previous understanding as descibed in your 08-26-2013 11:29 AM post is incorrect. However,  I am not sure I fully understand what your question is regarding scaling and variable gain. Can you please elaborate?

Best Regards,

Thomas B.
National Instruments
Applications Engineer
0 Kudos
Message 18 of 30
(1,970 Views)

Well, the hardware cutoff filters that are in place are causing the physical signal to come in with a different gain (or scaling) depending on the frequency.  A few posts up I posted an excel sheet that illustrated what I mean with a chart on the right hand side.  As you can see on the variable scaling chart between 150 and 1000 hz the signal gain is fairly constant, with very little drop of due to the cutt off filter.  However, lower than 150 hz the gain required drastically drops off. 

 

To explain how I generated that curve, I have a portable shaker that generates a known signal at about any frequency you can dial in.  So I simulated 1g rms and change my signal scaling until my measured value matched the actual value.  I did that between 10 and 1000 hz. 

 

So, as a follow up to this, now if I have a waveform (or more specifically the cluster output from the fft vi) what would be the easiest way to run three different scale equations on three individual areas of the waveform?

0 Kudos
Message 19 of 30
(1,964 Views)

Hi erfigge, 

 

It appears that you have a couple different options. If you split the signal before sending to the FFT and scale it appropriately, you can then perform the FFT different subsets of the data using the SVTA FFT Spectrum Subset (Mag-Phase).vi. With this VI you can select a subset of the signal based on the frequency, and subsequently perform the FFT.  

 

The other option would be to take the data from the FFT, and use the frequency information to sort the data as it is output. Sorting the information using the frequency data would allow you to split it into the various scale equation windows you want. 

Best Regards,

Thomas B.
National Instruments
Applications Engineer
0 Kudos
Message 20 of 30
(1,940 Views)