04-28-2011 03:22 AM
Hi all experts!
I am a new member in labview. I have a "stupid question" that takes a lot my time. Please help me.:mansad:
The problems is that how to take the average of a real-time data. For examples, first taking average of 100 samples and then waiting for next 100 samples and averaging them, and so on...
Anyway, Thanks so much!:manhappy:
Solved! Go to Solution.
04-28-2011 05:09 AM
Hi,
Try this example code.
Siva
04-28-2011 09:44 AM
I have already tried it before asking. But it didn't work. Let me try again. Beside that way, is there any VI in labview having same fucntion?
Anyway I appreciate highly your help. Thanks much!
04-28-2011 12:36 PM - edited 04-28-2011 12:37 PM
You have a "Mean.vi" that seems to do exactly what you need. Have a look to the pic attached.
Although you mentioned real-time data and averaging. Just make sure that the averaging does not take up too much time, i.e. does not affect your determinism.
Krivan
05-05-2011 01:50 AM
Thanks for your suggestion.
But when I export the data into array the numbers do not stop. I want when the first mean exported to array, it will be stored and next one does too so that I can compare these means. So I need more advice and suggestion. Please help.
Thanks all!
P/S: See my attachment and check whether it right or not. I need to compair 2 realtime data, so I want to take means of each channel, export into array and compair together.
05-05-2011 02:02 AM
05-05-2011 03:21 AM
Great. That's exacly what I want. Why I can think so:manmad:
Thanks much Nitzz!:manvery-happy:
05-06-2011 12:51 AM
Hi Nitzz. In your vi, when I change the sample length is 100, I think the "Mean" have to wait for some seconds to get enough 100 samples to take the average. But it nearly runs as the same time I start the vi. And even I adjust the sample length to thousand, the speed of the taking mean does't change (I think it must be slower). I don't know why? Can you explain?
Thanks a lots!
05-06-2011 03:12 AM - edited 05-06-2011 03:12 AM
Hi,
I think that is because it is not adding all the elements in the array and averaging every time. What it does is, it takes the the last random number generated and the mean of rest of the elements in the array (which is the last element in the mean array) and calculates their mean and finally gives the total mean. This process is repeated in each itration because of which the speed remains constant.
This is what i understood. But I'm not much sure about this. So we both can wait for some suggestions from the LabVIEW Experts..:)
Regards,
Nitzz
(Kudos are always Welcome;))
05-06-2011 10:29 AM
I got the process of Nitzz's program. But I want that when I got an average of first 100 samples the "mean" have to wait for next 100 samples to take average. Not average of 0 to 100, then 1 to 101 and so on as program of Nitzz does. So Nitzz, do you have another solution?
I also need help from other members. Please help me everyone. :mansad: