LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking average of real-time Data

Solved!
Go to solution

Hi all experts!Smiley Happy
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:

0 Kudos
Message 1 of 15
(7,054 Views)

Hi,

     Try this example code.

 

100 Avg.png

 

Siva

Sivaraj M.S
CLA
Message 2 of 15
(7,044 Views)

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!Smiley Happy

0 Kudos
Message 3 of 15
(7,033 Views)

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

Message 4 of 15
(7,023 Views)

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.

0 Kudos
Message 5 of 15
(7,002 Views)
Solution
Accepted by nguyentron

Hi,

 

May be this will help you..


Regards...

Message 6 of 15
(6,998 Views)

Great. That's exacly what I want. Why I can think so:manmad:

Thanks much Nitzz!:manvery-happy:

0 Kudos
Message 7 of 15
(6,987 Views)

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!

0 Kudos
Message 8 of 15
(6,962 Views)

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;))

Message 9 of 15
(6,957 Views)

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:

0 Kudos
Message 10 of 15
(6,947 Views)