LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak detection

Solved!
Go to solution

There are mainly 2 peaks in the curve as the 1st subplot in the attachement. It need to detect the dividing point as the red cycle.

 

I tried to detect where the Second Derivative change polarity to locate the point.

 

But sometimes it has sub peak such in case 1, so will miss it.

 

The duration of each peak may also change as in case 2, so I give up to locate the peak in time constraint window.

 

I also tried the peak detection function in LV, but some case also not fit.

 

But for all the cases, I can detect the point by my eye.

 

Is there any good way to make it, may you give any details, thanks.

0 Kudos
Message 1 of 3
(2,550 Views)
Solution
Accepted by topic author alex.

Here is one possible algorithm:

 

1. Calculate dydt for the data.
2. Apply a threshold for the dydt values that are of interest.  Retain the index numbers of each element whose absolute value is above the threshold.  This would narrow your search to the regions where the value is increasing or decreasing rapidily.
3. Look at the "window" of data around each point of interest.  You would have to decide how many data points make up the window.  
4. Find the window where there is both a positive dydt and a negative dydt within a reasonable proximity.  One way would be to use array max/min and do a subraction.

I think this will work if you play with the threshold and window sizes.

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 2 of 3
(2,518 Views)

Attached is my program and data.

 

Your suggestion is really good, but I am still thinking how to implement, since the duration of the first peak and second peak may change.

0 Kudos
Message 3 of 3
(2,490 Views)