LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Trendline of 50 Period Moving Average

Solved!
Go to solution

HI, im trying to plot my graph in LabView and trying to do create a treadline of 50 period moving average like in excel.

is it possible for me to do it in LabView?

i have tried General Polynomial Fit VI and some other VIs in Fittings but cant get anything close to the way i want

any ideas? anyone?

0 Kudos
Message 1 of 6
(4,920 Views)

Hi,

 

I've put together a running average example for you:

 

19049i9AEFF2B9DF5E6286

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 2 of 6
(4,896 Views)

thanks for the help

 

i have change abit as i have to use the data i have in hand. apparantly, the data i have is in 2D array and it has 1 colume and 11000 row of data, that's how it is being arranged

but after i changed its not working properly

 

its like it is only taking the first row data only

any idea?

0 Kudos
Message 3 of 6
(4,877 Views)

Use index array to separate each row, and doing moving average, and merge back later.

0 Kudos
Message 4 of 6
(4,856 Views)
Solution
Accepted by topic author 64864050

Charlie, There's a better VI called "Mean PtByPt". Look in the palette "Signal Processing >> Point by Point >> Prob & Stat >> Mean". One added benefit: this VI gives valid data for the first 50 points, even though the mean is not "fully developed" or "stabilized" during the first iterations. (Also, keep in mind that "Delete from Array" and "Build Array" primitives make a call to the memory manager, meaning memory copies for large arrays and fast loop rates will result in a CPU bottleneck. Using circular buffers is one way to mitigate this limitation.)

 

19463i571DA7AF7FC2F11C

 

64864050, try adapting this code to fit your needs:

19465iC57BC2A6A337A6AA

Message 5 of 6
(4,845 Views)

Thank you very much Jack Dunaway, it was a great help!

and i got the result i wanted.

Cheers!

0 Kudos
Message 6 of 6
(4,832 Views)