How does FindPeaks works?

17 次查看(过去 30 天)
Anatoly
Anatoly 2020-11-5
编辑: dpb 2020-11-6
Hello.
At least simplified, could you explain the algorithms used in the FindPeax function? Based on the zero crossing of the derivative?
Regards, Anatoly

回答(1 个)

dpb
dpb 2020-11-5
编辑:dpb 2020-11-6
TMW doesn't reveal innards beyond what is in documentation so the answer is "we don't know".
What the documentation says is:
"findpeaks(data) returns a vector with the local maxima (peaks) of the input signal vector, data. A local peak is a data sample that is either larger than its two neighboring samples or is equal to Inf. Non-Inf signal endpoints are excluded. If a peak is flat, the function returns only the point with the lowest index."
How, specifically, the function determines that result isn't documented. However, it is (at least still in R2019b) an m-file and you can read the code to see...
findLocalMaxima(), in fact, does precisely that in looking for and finding local minima. It is, however, as it says, solely a point-by-point comparison, no fancy gradient calculation or smoothing or anything exotic.

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by