From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Average Data

Solved!
Go to solution

What I want:

 

I want to have a numeric control that controls the amount of data that will be averaged.

(ex: numeric control set to 10)

This control results in the 10 data points before and the 10 data points after the current iteration will be averaged

 

My guess at a solution:

 

The numeric control will be combined with the iteration in a for loop.

My array of data will enter this for loop and combine with this.

My output of the for loop will be the averaged data.

I will then delete the first 10 lines of the array but I can do that.

 

An example vi of this would be awesome, I figured it will take someone no time at all to implement this.

 

Thanks!

 

Christian

0 Kudos
Message 1 of 20
(3,532 Views)

Hi cseymour,

 

this really sounds like homework. The usual reply for homework is:

Start to code on your own. Then attach what you have achieved so far and ask for specific problems of your code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 20
(3,523 Views)

If only it was homework.....

 

It's for a senior project that I have been working on, I am novice to many aspects of LV since was just introduced to it a month ago.  Right now my mind is running in circles so that's why I need help. But I'll attach the subvi that I have that I will implement this in.

 

Long story short, I have IMU data that has already been saved to a tdms file. I am pulling the separate waveforms out and I simply want to cancel some noise out and smooth the data. I want to average it as I posted above.

 

The vi is really a mess right now so dont be shocked.

 

Thanks!

Christian

0 Kudos
Message 3 of 20
(3,513 Views)

Hi cseymour,

 

have a look at PtByPt-Mean and try to use that on one of your waveforms…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 20
(3,508 Views)

Yes I have looked at it.

 

What it does is take your sample length and use the previous values to find the mean.  

 

I want to use the previous and future values to find the mean.

 

Thanks,

Christian

0 Kudos
Message 5 of 20
(3,501 Views)

How is the program supposed to predict the data from the future?

0 Kudos
Message 6 of 20
(3,497 Views)

I have already collected all the data and now i am running it through post-processing.

 

Thanks,

Christian

0 Kudos
Message 7 of 20
(3,490 Views)

OK, so this is a trivial problem. Can you attach some typical data?

 

 

0 Kudos
Message 8 of 20
(3,483 Views)

File attached. Is that what you want?

 

Thanks,

Christian

0 Kudos
Message 9 of 20
(3,472 Views)

@cseymour05 wrote:

I have already collected all the data and now i am running it through post-processing.


No, don't flood us with tons of irrelevant data. Just attach the 1D array that contains the data. You also need to decide what to do with the data at the beginning and end, where the averaged subset is truncated.

0 Kudos
Message 10 of 20
(3,467 Views)