LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to average with time

Is there an easy way to average some calculated values over a user-specified period of time (say 10 sec), rather than averaging a number of samples? Example - suppose you are continuously calculating the frequency of a signal using FFT, and the frequency varies unpredicatably with time, and you want to output the average frequency in each successive 10 second (or 1 minute or whatever) time window?

Thanks
0 Kudos
Message 1 of 4
(3,157 Views)
Hi,
1. There is a VI in LabVIEW package which does practically exactly the thing you want. This is
"Functions->Analyze->Signal Processing->Frequency Domain->STFT Spectrogram.vi". This VI performs a sliding FFT and returns the 2D array of spectrums of signal inside sliding window. I've attached the example.

2.Actually to do such things you must set the length of sliding window and use "array subset" function to extract subarrays from your signal. You have to do it inside loop which changes the position of the window relative to the beginning of signal. In such a way you will obtain the set of subsignals which could be processed inside the loop. Then you can output the processing results out of the loop.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 4
(3,157 Views)
OK, thanks for that, but I also need to average three or four other quantities which are derived from the incoming signal, all at the same time, and unrelated to the FFT. Thanks
0 Kudos
Message 3 of 4
(3,157 Views)
Hello there!

I think you might find the "Numeric Integration" node useful for this. It's in the Mathematics/calculus toolbox. You can set the dt arbitrarily.

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 4 of 4
(3,157 Views)