LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

averaging data at every nth. iteration of a loop

I guess I add all VIs, but here is the one for LabVIEW 7.0 again.
Message 11 of 21
(1,661 Views)
thanks a ot Tom.. It s working..
On the other hand, I was trying to understand the code so that it helps improving my ability. Actually i have problem with remainder vi which, i guess, controls the averaging process. I looked for example but couldnt find so. I just realized that in the code that u modified my ramping machine is not working properly as i want. Thats why I simplified it and working better ( u can see the attachment). Now it counts 4,3,2,1,0,-1,-2,-3,-4,-4,-3,-2,-1,0,1,2,3,4,4...
so at the beginning i can determine of how many element ll be in the first spectrum, second and so on (18 elemnts for above example). So what I was trying to implement ur averaging process into this new code. I tried to feed the reaminder vi with array length corresponding 1 single spectrum. Although i have struggled all night along, i couldnt manage it:( What is the trick?


0 Kudos
Message 12 of 21
(1,657 Views)
Hi looser,

I did not realy get the point, what you want to do. May be it's better for you to write in German, could you please do so?

TomBaum
0 Kudos
Message 13 of 21
(1,648 Views)
Well, sorry for not being clear..
Anyway, i solved that problem, but now i have another question. Generally, the first spectrum has quite noisy feature, thats why i dont wanna include first spectrum into averaged one.. What i should do? I should put somewhere in the code the alghrotim""exclude first spec"" on the way of data goin averaged one.. But where and what?

0 Kudos
Message 14 of 21
(1,631 Views)
Hi,
if you don't want to use the first spectrum in the avaraged spectrum, you have to modify the functions resulting in the case structure on the left hand side and the case structure itself. There will be choosen when the spectrum values are given to the shiift register. Actually it starts at the first run, when the result of 'quotient and remainder' is equal.
Good luck
TomBaum
0 Kudos
Message 15 of 21
(1,615 Views)
I m sorry for asking too much, but as u guess i m beginner and need to finish this program to start experiments as soon as possible..
Then should I modify the quot. and remainder? And there sth else i realized that when i write the arrays, which goes to averaged spectrum, to spreadsheet, what i get is not a single loop) averaged one, but several ones... Can u also advise me for that please?

thanks alot in advance
0 Kudos
Message 16 of 21
(1,613 Views)
Hi again,

No you should not change the qout. and remainder. But the result of this function is used to set the boolean value for the case structure, to choose the case. You get a avaraged value of several loops, because  I understand your application in this way and developed the VI to avarage the value of all spectrums. Did you want this in another way?

Here are some additional informations, to understand the basics of LabVIEW use the help and the contex help (Ctrl + H) and also have a look into the examples. You can also refer literature as posted on http://zone.ni.com/devzone/cda/tut/p/id/5389 . Furthermore you can call NI to talk to an application engineer on the phone.

TomBaum
0 Kudos
Message 17 of 21
(1,610 Views)
yes. Excatly that s what intention. Average several loops except first one. when it s good enough ( as seeing on the monitor), i ll stop the data acquistaion and ll write to averaged data on a spreadsheet to open with origin..
U suggest to check out for exampoles, but for insatnce, there s no any single example in which quot. remainder func. is used..:(
0 Kudos
Message 18 of 21
(1,605 Views)
Important is what will done with the result behind the function 'qout. and remainder'. I mean the comparison and so. Now it's programmed so that first spectrum will be written to the array and the avarage of the first is the spectrum itself.
You can find an example for quotient and remainder when you search for this function in the LabVIEW help and have a look at the example link. You can also use ni.com to search for topics, i.e. http://zone.ni.com/reference/en-XX/help/371361B-01/glang/quotient_and_remainder/

TomBaum
0 Kudos
Message 19 of 21
(1,602 Views)
ok. What about this.. The averaging takes places everytime R+1 is equal to length of the array which corresponds to 1 spectrum.  Which means first average ll happen when i=5 , so i can add another case into right side structure, like saying when i=5, clear clear which goes to grapg by initialzing array function.
What u think?

0 Kudos
Message 20 of 21
(1,598 Views)