LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding a "jump" from the graph data *complex*

The Y values at start and end are the locations of the intersections of the three straight lines.  They are not part of the data set.  I probablyw as not very clear about what that VI actually does.

 

First it separates the data into three segments.  It locates the Midpoint Index by calculating a Y value midway between the minimum and maximum Y values in the data set and using the Threshold 1D Array function to locate the X value of the data point below the threshold.  Split 1D Array at [Midpoint Index - 2000] (where the 2000 is an arbitrary choice made by looking at the data). The Before part represents the left side baseline.  Split the After part a [4000] ( = twice the arbitrary choice).  The first part of this split contains the jump and portions of the left and right baselines.  The After part is the right side "baseline." The X array is split at the same indices.

 

The jump section is further trimmed by finding the point where the jump segment crosses the maximum of the left baseline segment and the minimum of the right baseline segment.  This takes out the horizontal "tails."

 

A linear fit is performed on the three data set segments: Before, Trimmed Jump, and After.  The results are presented as "slope before," "intercept before,""slope jump," "intercept jump," "slope after," and "intercept after."  For two straight lines specified by the slope/intercept equation, y = m*x+b, the intersection is located at x = (b2-b1)/(m1-m2) and y = m1*(b2-b1)/(m1-m2)+b1.  The values of "x start,' "y start," "x end," and "y end" are calculated from these expressions.  If you plot the linear fit lines over the data, I think you will see what I did.

 

Lynn

0 Kudos
Message 11 of 11
(343 Views)