From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Averaging Multiple FFTS

I'm using an impact hammer to trigger data collection from an accelerometer, then I read back the data and perform an FFT.  I want to put this in a while loop which will allow me to tap the impact hammer multiple times and compute a running average of the FFT's from each tap, then when finished, I'll export this averaged FFT to a measurement file.  I'm using dynamic data and the FFT express VI, but I can't figure out how to average several FFTs. 

 

Right now, I'm converting the dynamic data to waveform data, then appending each tap to an array, then when finished, converting back to dynamic data and feeding this into the FFT VI.  However, because the FFT VI automatically sets the FFT size to the length of the input data, I'm getting a FFT output file which has resolution on the order of 0.1 Hz, yet I'm not collecting data for long enough on each tap to truly get valuable data with this resolution. As a result, only every 10th line or so of my output file is a viable data point.  Since this isn't working, I'd like to try and just compute a running average of the FFTs from each tap.


Any ideas?

0 Kudos
Message 1 of 3
(2,395 Views)

You shouldn't append your data.  That is just making the waveforms longer.  You instead want to build up a 2D array, perform an average on that data (you may have to transpose the array to do it properly), and then perform the FFT.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,375 Views)

I'm sorry, but I can't get even get the 2D array built.  I found an example VI for how to average the 2D array if I could get it built.  This is inside a while loop, and essentially each time the loop runs, I want to add another row to the array (my sensor outputs are rows).  Whenever I attempt to use the 'build array' or 'insert into array' VI's, when I wire them to a 2D array indicator, I get an error saying I've wired together arrays of differing dimensions.

0 Kudos
Message 3 of 3
(2,365 Views)