LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What does restart average mean in FFT functions ?

Solved!
Go to solution

Hello everyone,

 

I would like to know what "restart average" does to the FFT functions. According to help, "restart averaging specifies whether the VI restarts the selected averaging process. If restart averaging is TRUE, the VI restarts the selected averaging process. If restart averaging is FALSE, the VI does not restart the selected averaging process. The default is FALSE. When you call this VI for the first time, the averaging process restarts automatically. A typical case when you should restart averaging is when a major input change occurs in the middle of the averaging process"

 

I understood that the FFT function takes in an array of values and perform FFT on it. Could it be that the FFT function keep a buffer of previous values and will clear out when Restart average = true ? Since FFT functions are not Point by point and they take in all data at once to process, how can "a major input change occurs in the middle of the averaging process" be true ?


Thanks !

0 Kudos
Message 1 of 8
(4,125 Views)

Look at the other inputs in Help or Context Help for that.  You will see it has another input called Averaging Parameters.

 

It will maintain a level of averaging from previous calls to the function.  The Restart Averaging input will clear out the data maintained from previous calls.

0 Kudos
Message 2 of 8
(4,105 Views)

Regrettably, the LabVIEW Help is vague on this topic.  What I think this is for is estimating the Power Spectrum of a continuous signal, in particular a signal that doesn't stop.

 

Suppose you are sampling at 1 KHz, and are sampling 1000 points at a time.  From your sample of 1000 points, you can get a PSD with frequencies from 1 to 500 Hz, and can get a new estimate every second.  What I think the Averaging bit is all about is to ask how you want to deal with such potentially time-varying spectra -- do you want to average them (and for how many waveforms), do you want exponential weighting (which I think means the most recent estimate is weighed more heavily, kind of a low-pass filter on the PSD), etc.  The "Reset" simply clears out the evolving Average, and is equivalent to setting the Averaging Mode to 0, no averaging (in which case you can ignore Reset).

 

Bob Schor

 

P.S. -- it should be easy to test this assumption -- do a simulation of a known signal with added noise.  As you average, the noise in the spectrum should decrease, but if you do a Reset Average in the middle, you should see the noise level of the spectrum return, assuming you are averaging, of course ...

0 Kudos
Message 3 of 8
(4,099 Views)

How to prove that with Restart Average = False, the Power spectrum FFT maintains data from previous calls ? In my example VI, the FFT waveform looked the same regardless of Restart Average parameter..

0 Kudos
Message 4 of 8
(4,088 Views)

I have modified the VI per Bob's suggestion and I see that the noise level of the 2 graphs are the same when I toggle the Restart Average bit.

 

0 Kudos
Message 5 of 8
(4,080 Views)
Solution
Accepted by topic author zigbee1

Sigh.  I really tried to explain what was (probably) going on with this function, which you are using (and, I naively assumed, you understood), but you've proven me wrong.

PSD Averaging.png

This VI generates a zero-mean noise signal, providing 1024 points every second.  Do you know what the power spectrum of such a signal should be?  Because of the random nature of the input signal, the Power Spectrum (for a small, finite sample) will also have a random component.  If you were to average multiple Power Spectra, the average would start to converge to the expected Power Spectrum for random noise.

 

If you run this VI and watch the resulting (averaged) spectra, you will notice that the first Spectrum is the most "spiky", and as the Spectra are averaged, the variation gets smaller and the peak value (shown by looking at the Amplitude scale) decreases.  At any time, you can push "Reset Average" and see that ... the Average resets, the next Spectrum shows the increasing nose, etc.

 

This shows the proper way to test the Power Spectrum function and discover what it does. My suggestion as to what this Function is doing appears to be largely correct.

 

Bob Schor

Message 6 of 8
(4,038 Views)

Sounds like you are using the SpectralMeasurements ExpressVI. (I can't view your code since I have LV2014.). 

You are right that "the FFT function takes in an array of values and perform FFT on it", but you are not using FFT.vi.

(FFT.vi is on the Transforms subpalette on the SIgnal Processing palette.)

One the properties of this express VI is "Averaging". If and only if this option is checked, you get an input to the Express VI called "restart averaging". The averaging process restarts when this input goes true.  When Averaging is selected, the express VI remembers the spectrum after it is called. Then, the next time it is called, it computes the average of the current and the past spectra.  It then puts out the average spectrum.  You set the number of calls to average in the express VI properties.  If you set numbr of averages to 10,  and then you call it 15 times without restarting, the output on passes 10 through 15 will be the average of the spectra of the inputs from passes 1 through 10. 

If you wire the output "Average Done" back to the Input "Restart averaging", then the express VI wil start fresh once the number of averages is reached.

A demonstration file is attached.

Bill

Message 7 of 8
(4,019 Views)

Thank you everyone for providing a demo VI to help me understand the concept 🙂

0 Kudos
Message 8 of 8
(3,993 Views)