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.
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.
10-30-2018 09:26 AM
I'm attempting to build a peak detection algorithm based on the derivative being equal to zero. I've used a case structure and array max and min point by point to locate the peaks but it struggles to resolve a double peak in the data. I would like to include the second derivative being negative into the conditions for the case structure but I'm struggling to get it to work.
Does anyone have ideas of how to make this work or how to improve the peak detection?
I have attached my vi and some data. The last loop is removes duplicate values and the first three are a boxcar smoothing algorithm.
Thank you
10-30-2018 10:46 AM
Hi swilson8,
What is your actual goal here? Do you want code that accurately finds peaks, or is the point to do the computations manually?
If you're just looking to find the peaks, LabVIEW has a Peak Detector VI that handles all of the 1st and 2nd derivative work for you and you can choose to find peaks or valleys. You would just run your smoothed signal through this VI and it will output the locations and amplitudes of all peaks above the threshold value.
10-30-2018 10:49 AM
My aim is to find the locations of the peaks most importantly, although amplitude is useful aswell.
I am developing my own algorithm to compare it to the inbuilt vi (which is fairly accurate), but I'm having difficulties making it accurate. I have it so it detects peaks to some extent but it definitely isn't too accurate across all peaks.
11-09-2018 02:36 PM
Did you ever try the code I posted here? https://forums.ni.com/t5/LabVIEW/Condition-reset-after-data-goes-below-a-certain-value/td-p/3856488
I've had a bit of time to play with that method today, and its actually a simple but impressive way to detect peaks.
Craig
11-10-2018 02:43 AM
You should look into "Savitzky-Golay" methods (there are VIs in LabVIEW for it) for determining derivatives for identifying overlapping peaks.