LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

more about running averages

Hi,

I am trying to implement the vi that was posted by Timothy John Streeter on 6/28/2000

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000003A0B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0

We are collecting data continuously, but are taking the mean of one cycle of data using the AIread.vi inside of a while loop (10000 points, because we are sampling at a rate of 10kHz) and plotting it. This is done using the mean vi included with Labview. Therefore, one data point is plotted for each cycle of data collected, or one data point is plotted for each trip through the while loop. We then want to perform a running average on this data in real-time. I believe that the above mentione
d vi is not the correct way to do this, because we need something that can hold the data through the while loop until it runs 5 times and then go and average those points and plot them on a seperate graph.


From reading through other similar questions posted, I believe that this will involve some sort of manupilation using FIFOs, but I am not familiar with this aspect and am asking for help in proberly implementing this or another similar vi.
0 Kudos
Message 1 of 3
(2,735 Views)
Running averages are extremely simple in LV.

Just put the output data into a shift register. On the input side of the loop (the previous data from the shift register), pull it down until you have 5 copies. Then average them (build an array and take the mean). This will give you a running average of the last five (or however many) points.

I believe these nodes you pull down are called instances. You can have any number of previous instances (each is previous to the one above it) with the only limitation being space.

Have fun.

email me if you have questions: labviewguru@yahoo.com
Message 2 of 3
(2,735 Views)
Hi,
no problem, see attached file.
It's an example for demonstrate how to use a FIFO
and FIFI.vi
Mike

lisa wrote:

> Hi,
>
> I am trying to implement the vi that was posted by Timothy John
> Streeter on 6/28/2000
>
> http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000003A0B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
>
> We are collecting data continuously, but are taking the mean of one
> cycle of data using the AIread.vi inside of a while loop (10000
> points, because we are sampling at a rate of 10kHz) and plotting it.
> This is done using the mean vi included with Labview. Therefore, one
> data point is plotted for each cycle of data collected, or one data
> point is plotted for each trip through the while loop. We
then want
> to perform a running average on this data in real-time. I believe
> that the above mentioned vi is not the correct way to do this, because
> we need something that can hold the data through the while loop until
> it runs 5 times and then go and average those points and plot them on
> a seperate graph.
>
> From reading through other similar questions posted, I believe that
> this will involve some sort of manupilation using FIFOs, but I am not
> familiar with this aspect and am asking for help in proberly
> implementing this or another similar vi.
0 Kudos
Message 3 of 3
(2,735 Views)