cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Improve localmax results

Raiko
17-Peridot

Improve localmax results

Hello folks,

 

currently I'm using Mathcad's built in function localmax. It is a great function but it yields too many false positives and in some case (see attached file) also outright false ones.I've fiddled around with the window size but the results are not very convincing.

Does anybody know how to improve this?

 

Thanks

 

Raiko

4 REPLIES 4
LucMeekes
23-Emerald III
(To:Raiko)
Werner_E
25-Diamond I
(To:Raiko)

While you may think that the function erroneously finds local minima - if you zoom in you see that it actually finds local maxima! Maybe applying a smoothing function before looking for maxima will do a better job.

B.png

Werner_E
25-Diamond I
(To:Raiko)

I found a Mathcad function localmax1() in my archive. Not sure where it stems from and whom I should give credit for. Can it be thats it from an early Mathcad DAEP (Data Analysis Extension Pack)  where the functions where delivered as regular and readable Mathcad functions? This would mean that something went wrong in the evolution of that DAEP.

Anyway, this function does away with the missing peaks of the built in localmax, which I consider a bug. Using a window size of 100 may be a solution for your problem as it seems to deal with the local max's caused by the tiny bumps in the signal?

B.png

Raiko
17-Peridot
(To:Werner_E)

Hello Werner,

 

thank you for the function. It works in a fashion. Data smoothing prior to localmax and some other cleaning did the rest.

I don't like to increase the window size too much as I might miss some points. I'm using the local maxima to determine an exponential fit which gives me the envelope. This in turn yields a long term trend from my data set of about 5000 measurements. Therefore I do like to reduce false positives.

 

Raiko

Announcements

Top Tags