01-16-2017 10:36 AM
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?
01-16-2017 10:59 AM
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.