LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

averaging data at every nth. iteration of a loop

Hi all. As u see from attached vi  which  imitates what i want to do. there s a sweeping machine which sweeps my current values between 2 defined values. for each of current value i gain a y value from multimeter. So i start sweeping current from 0 ,+4,-4 and 0 again with equal increments.  When I reach 0 back, the collected data called spectrum1. Iteration goes on and i have spectrum 2 like first one, but the problem is that y values are different than that of first one.
i want to plot averaged spectrum every time when i get new a spectrum. My x values and y values will be different for each iteration due to the noise. What i want to do is that to average first x value of first spectrum with that of seconde spectrum, and do same for all sequent x and y values.
after each spectrum consist of N data depending on the my sweeping current value and increment, i want to plot the averaged spectrum.
would it be complicated?

0 Kudos
Message 1 of 21
(4,635 Views)
Hi looser,

I think the VI I modified solve your problem, have a look into.

Regards
TomBaum
Message 2 of 21
(4,580 Views)
sorrz.. i should have expressed that i m using 7.0..
could u please convert it?  if it s possiible
0 Kudos
Message 3 of 21
(4,575 Views)
...here it is.

TomBaum
Message 4 of 21
(4,572 Views)

Hi Tom,

I would like to humbly request you either talk a little more about your solutions and/or post an image of the code.

This will help us determine if your example is worth looking at and will also provide users of various LV versions to benefit from your posting.

Thank you,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 21
(4,566 Views)
Hi TomBaum..
thanks a lot.. It is impressive.. Frankly, i m not in the level of understading what ur code does but seems working. Only thing that is not sure to me is that the x axis of the averaged spectrum should be same as individual spectrum. I mean, the averaged y values should be corresponding x values...
is it missing there or i dont see it?:)
thanks
Message 6 of 21
(4,566 Views)
Hi looser,

here is a VI, where x-axis of the avarage chart is modified. If you want to have it in another way you can do it if you change the array which results in the bundle to cluster function in the bottom area (avarage spectrum Graph) of the VI and changing the settings for the chart.

@ Ben: I attached VIs for LabVIEW 7.0, 7.1, 8.0 and 8.2, so feel free to choose one of this to look into.

Regards
TomBaum
Message 7 of 21
(4,554 Views)
Vielen dank Tom...
but still there s sth which confused me. First averaged loop is supposed to be same as first spectrum. If u look at, averaged spectrum is reverse of first spectrum? Should i reverse the x array?
0 Kudos
Message 8 of 21
(4,548 Views)
Hi,

yes you should reverse the array. I just forgot this. I attached the corrected VI and also made another change refreshing the 'avarage spectrum Graph'. Have a look!

Regards
TomBaum
Message 9 of 21
(4,504 Views)
Hi Tom..
The lowest version which available in ur zip is 7.1.. Can u add also 7.0 version that i am able to see.
thanks
0 Kudos
Message 10 of 21
(4,502 Views)