LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate Polynomial fit from Waveform graph

Hi,

 

I have an existing waveform graph that I would like to perform a polynomial fit on a sebset of the data.

I have the index values for the subset array I want to analyze but the General Fit Plonomial VI requires X Y data.

I would prefer to keep using the waveform graph and not an XY graph.

What is the easiest way to generate my X value data to be used as the input to the polynomial VI?

 

poly.png

0 Kudos
Message 1 of 2
(2,367 Views)

Your waveform is defined by its timestamp (t0), its sample period (dt) and your Y array.

If you take a subset starting at index i0 you are moving your timestamp to t1 = t0 + i0 * dt.

Then the X array you are looking for has values t1, t1+dt, t1+2*dt ...

 

The easist way to get this is to index a FOR loop with your original Y array and calculate your X array using a shift register initialized with t0 and incremented by dt. You can then use the same subset extraction parameters to both your X and Y arrays.

0 Kudos
Message 2 of 2
(2,353 Views)