ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sample average

I was keeping worse part for the end. The biggest problem is the sweeping process.. Well, I command the current supply setting sweep rate and the limits, but out put of the current supplier is not exactly what i set which means my x values slmight slightly change for each spectrum.

briefly, it could be fowwloing 

i (iteration)        Current value             corresponding multimeter value(y)           array of x                array of y

     0                         0                                              y0                                            [0]                               [y0]

     1                         1.001                                         y1                                   [1001,0]                            [y1,y0]

     2                         1.9998                                      y2                                [1998,1001,0]                         [y2,y1,y0]

     :                          :                                                 :                                                :                                   :

12(new sweep)      0.002                                       y12                      [0.002,-1.001,-2...0...1.9998..,0]     [y12,y11.....y0]

13                           0.996                                         y13                         [0.996,0.002,-1,2..0...2..0]                [y13,y12,y11...y0]

and it can change the number of steps in each sweep. That s bad, but unfortunately i have this condition. So I can do 2 things, either i can roll the x values so that i would not need also to average x values? but i have no idea how i can make sure the number of steps is going to be same for each steps?

This is my ph.d thesis and i dont want to miss any data:)

0 Kudos
Message 11 of 29
(1,849 Views)
Hi looser,

if your x-values also differ, you should create your own algorithm similar to this:
collect all y-values where the x-value is near by a setpoint (only different by +-epsilon).

If this is your phd-thesis do we get some acknowledgments for our help? Smiley Happy
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 29
(1,846 Views)

🙂 Definetely the following is gonna be written in the thesis"" the data acquisation software has been written by Labview Forum""

I have no idea where to insert that alghoritm, and to write it with LV? if it s really complicated, i can neglect the those small differs in the x values:)

0 Kudos
Message 13 of 29
(1,844 Views)
*** double entry deleted ***

Message Edited by GerdW on 04-12-2007 04:36 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 29
(1,828 Views)
Hi looser,

here's an example for my proposed algorithm. It's straight-forward, no error checking, no optimizations...

On your phd: now we only need the publication reference for our own papers! Smiley Very Happy
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 29
(1,827 Views)
🙂 finding reference is the hardest part even harder than the ph.d itself...:)
Could you please convert it to 7.0 that i have as a poor ph.d student:)
0 Kudos
Message 16 of 29
(1,821 Views)
Hi looser,

here it is!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 17 of 29
(1,817 Views)

thanks GerdW,

but still dont understand, how this vi ll decide the which elemts of each array will be added and averaged?

I mean how it s gonna average, for example, the y value( first element of averaged array) of corresponding 0th 13th and 26th for 3th average process? 

0 Kudos
Message 18 of 29
(1,809 Views)
Hi looser,

this vi gets some x-data and corresponding y-data.
Then it looks for x-values around a given setpoint (±epsilon). For those x-values it is collecting the corresponding y-values and calculates the mean.
You said you want to calc the mean for y-values at certain x-points (with some noise on the x-values)...
This vi doesn't check for the index of the y-value, it only checks for the corresponding x-value!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 19 of 29
(1,805 Views)
Thanks for manual:) just to check if i nderstood correctly.. so it can perform the process below lets say i have
X= 0.1, 1.2, 2.4, 3.3 ...       corresponding  y values= 2, 4, 6, 8 ....
x= 0.2, 1.1, 2.3, 3.05  ...     corresponding  y values= 2.2, 3.8, 5.8, 7.6....
and assume that i get those values continously in a loop. Now i connect the ''X set "" to x value generater (which is current supply) and set epsilon as 0.3..( thats the maximum shift i expect)
and i am plotting averaged loop providing i have the corresponding arrays
x=0.15, 1.15, 2.35, 1.675 ....        corresponding y values= 2.1, 3.9, 5.9, 7.8  .....
 
and i have xy graph!! is it true?
0 Kudos
Message 20 of 29
(1,800 Views)