LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging data, but needs to be done with queuing

Hi all,

I am using a DAQ USB 6251.  Basically what I need it to do is pretty simple.

* DAQ card generates sine wave - 23Hz and 2.5V with 2.6V offset  (i.e. D/A)
* This signal is then used to drive a device, which then generates an output to be monitored by the DAQ card (A/D)

 

* This all, works fine, but now  I would like to average the data (to improve signal-to-noise ratio) display and save it.


Problem:
1) For averaging I tried putting a FOR loop in the while look where data acquisiton is done.  But, this doesn't work as it just keeps averaging the same data.  So what I need to do is to wait for one set of data to come out, store that, do the same and cumulate, then when the average number is reached, it just divides the entire cumulated array.  I think I would need to use queuing, but am unsure how to do it.  

 

Attached is the vi.  and a screenshot 

 

 

 

Thanks

0 Kudos
Message 1 of 4
(2,815 Views)
Typically, you would just sum the traces in a shift register, e.g. as shown here or here. Modify as needed.
Message Edited by altenbach on 10-15-2008 10:58 PM
0 Kudos
Message 2 of 4
(2,810 Views)

Thanks Altenbach,

 

But like I said I have tried using this in the while loop with shift register.  Doesn't improve signal-to-noise, as its just adding the same buffer.  I need to wait, accumulate the buffers, add the buffers (cumulated), then divide by number buffers.

 

Zientist 

0 Kudos
Message 3 of 4
(2,801 Views)

zientist wrote:

But like I said I have tried using this in the while loop with shift register.  Doesn't improve signal-to-noise, as its just adding the same buffer. 


I could not see this in any of the code you have attached. Can you show us your failed attempt?

0 Kudos
Message 4 of 4
(2,791 Views)