LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am sampling a signal at 1kHz for every 1 second. How do i average the signal for N seconds?

I am sampling a signal at 1kHz for 1 second. After one second of pause, i sample again for 1 second at 1kHz. If i do this for Nth time, how do i average the signal over the 1 second period?
0 Kudos
Message 1 of 4
(2,988 Views)
If the signals are all in phase :
You have to acquire the N signals in N columns of a 2D vector (use a while loop or a for loop for the acquisition).

Then you transpose your 2D array

Then you use a "for" loop and compute the average of each row.
That's it

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 2 of 4
(2,988 Views)
How do i do it in real time? The averaging is performed when the next array is feed.
0 Kudos
Message 3 of 4
(2,988 Views)
Anyway you need to have the data to compute the average... and usually you don't get the data point-by-point unless it is very low frequency acquisition.

If it is the case, you have to update your 2D vector point by point and then compute the average after each new point (much slower process indeed). You keep say 20 vectors of data and fill in the data (1, 2...20) and then( 1,2..20), so you compute the average on the last 20 acquisitions

(don't forget the rating)
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 4 of 4
(2,988 Views)