From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding minimum from a curve

I've gathered a 1D array of data points that fits a curve (similar to a sine curve). I'm now looking for a method to find all the minimum or maximum points from the curve. Have been looking in the Analyze but couldn't find any useful VI. Anyone know how I can get it done?

Also what if my data is a flatline (straight)? How do I "toogle" between the curve and line?
0 Kudos
Message 1 of 3
(2,450 Views)
Just found this thread with similar problem: "How to see the peak values in a chart?" and my initial idea aws pretty similar to one of the suggested method:
1. find the best fit curve
2. use the derivative to find the tangential change hence locating the min/max points.

I'll try this method and see if it works. 🙂
0 Kudos
Message 2 of 3
(2,445 Views)
I recently had a similar problem. The attached VI will accept a 1D array and return 4 arrays. The arrays are the values of the negative and positive peaks and the indicies of both. It's a brute force method, but it works.

It's large because I left the original data as the default value. Emptying the input array and making it the default value will cut the size.
0 Kudos
Message 3 of 3
(2,394 Views)