LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Binning or averaging XY data

Hi,
 
Im using a USB-6009 to measure two voltages continuously at 22 kHz. The data is given to Labview by the DAQ in pieces of 1000 samples which constituate the X and Y data of an array (they are actually the probe voltage and current of a Langmuir probe). I wish to do some averaging to cancel out some of the noise, for instance, by binning the 1000 point data set to 100 points using 10-point mean averaging. How would I go about doing this? As far as I can see, the built in averaging routines of Labview only work on waveforms (X- and Y- versus time respectively), and cannot be applied on a (time independent) XY set.
 
Regards,
 
Casper
0 Kudos
Message 1 of 6
(5,888 Views)

Hey Casper,

      Do the 1000 samples represent 500 X/Y pairs?  How are the Voltage/Current values embedded in the data, and which (voltage or current) is on the X-axis of your chart?  In this situation, will the bins have to be different "widths" in order to keep the same number of points in each [vertical] bin?


@budtz wrote:
Hi,
 
Im using a USB-6009 to measure two voltages continuously at 22 kHz. The data is given to Labview by the DAQ in pieces of 1000 samples which constituate the X and Y data of an array (they are actually the probe voltage and current of a Langmuir probe). I wish to do some averaging to cancel out some of the noise, for instance, by binning the 1000 point data set to 100 points using 10-point mean averaging. How would I go about doing this? As far as I can see, the built in averaging routines of Labview only work on waveforms (X- and Y- versus time respectively), and cannot be applied on a (time independent) XY set.
 
Regards,
 
Casper



 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 6
(5,863 Views)
Hey tdb,

Im reading two voltage channels via the DAQ assistant (the conversion to current is done later, but the current is the Y-axis) of 1000 samples each - each of those (X,Y) pairs being correlated. Both are in the range -10 to 10 V. Its not important for the bins to be the same size. What ever is easiest. What I want to do is to bin the X-axis down to, say, 100 data points to get rid of some of the noise present in the Y-axis (thus, each "bin" would represent the weighted average of ~10 (X,Y) pairs). I imagine somethin along the line of creating equally sized bins on the X-axis and setting the Y-axis value of the bin Bn to a weighted average of the Y-values that fall into Bn. Im not sure its correct of me to use the term "binning" in this context, but I hope you can see what I'm looking for.


Thanks for you reply,

Casper
0 Kudos
Message 3 of 6
(5,839 Views)


Its not important for the bins to be the same size. What ever is easiest. What I want to do is to bin the X-axis down to, say, 100 data points to get rid of some of the noise present in the Y-axis (thus, each "bin" would represent the weighted average of ~10 (X,Y) pairs).

Up to here, I'm thinking we could calculate & plot the "centroid" of every 10 consecutive X values (once sorted on X).

... not that I really know how to calculate a centroid! Smiley Wink


 I imagine somethin along the line of creating equally sized bins on the X-axis and setting the Y-axis value of the bin Bn to a weighted average of the Y-values that fall into Bn

If you mean each bin might span the same range of current, what guarantee is there that any data-points will fall (or have fallen) into a particular current-range?

Cheers!

Message Edited by tbd on 04-27-2007 12:07 AM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 6
(5,830 Views)

Hey Casper,

      In case you can (still) use it, I went ahead and implemented the "Centroid" binning described earlier.

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Download All
0 Kudos
Message 5 of 6
(5,793 Views)
Hi tdb,

I had a chance to look at the VI you sent me... it does the job for me. Thanks a lot for you help!!

Casper
0 Kudos
Message 6 of 6
(5,759 Views)