LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating a moving average with a different window size

Hi All,
 
I would like to calculate the moving average for the data shown in the attached photo. The two plots are from two temperature sensors (resistance sensor) against time. From the figure, at one point, you can see the lines start to broaden. This happens due to high variation of the temperature (resistance of the sensor) at low temperatures. This broadening is actually a sin function variation with very small frequency 1.15Hz (0.0145 min). I would like to find the best way to average the data points located during each cycle (0.0145 min) to eleminate this broadening. 
 
P.S. I would like to the VI to calculate for the data points (whatever the number of alllocated ones) located in each time cycle and produce an average for it.
 
Thank
0 Kudos
Message 1 of 4
(2,572 Views)

You also have the assumption that the sample rate is a multiple of your 1.15Hz in order to get exactly 1 cycle.  Otherwise, you might have to average across many cycles until you can get an integer number of cycles in a reasonable number of sampled points.

 

So what is your sample rate?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,547 Views)

I am going to quote @GerdW from this thread as I think he sums it up perfectly.

 

What is your problem? Where are you stuck?

After all it's (more or less) basic math

 

(When you want someone else to do your job then you should offer a job in the appropriate forum!)

 

mcduff

0 Kudos
Message 3 of 4
(2,524 Views)

LabVIEW has plenty of filter functions to smooth data. If you want to see the data filtered as new data comes in, use a ptbypt function (simplest is "mean ptbypt"). If you want to filter the entire dataset once it is acquired, you have even more options. (Convolution, wavelets, etc.)

0 Kudos
Message 4 of 4
(2,481 Views)