Filter löschen
Filter löschen

How to do Downward peak detection?

4 Ansichten (letzte 30 Tage)
JamJan am 31 Jul. 2019
Bearbeitet: Jon am 1 Aug. 2019
I have the following double A: attached
If we plot A (figure attached), we caan see a lot of peaks upside down. If you zoom in, for instance at indices 2500 to 3000 at the y-range of 1.5-3, you see a lot of deep down ward peaks. I want to isolate only the deepest peaks (with this I mean, not the small downward peaks next to it) throughout the whole array.
How to do this?

Antworten (1)

Jon am 31 Jul. 2019
Bearbeitet: Jon am 31 Jul. 2019
You can use the MATLAB function islocalmin for example
idx = 1:length(A)
isMin = islocalmin(A);
This will find all the local minima "downward peaks". If you want to eliminate the "small downward peaks next to it" you will need to formulate a more precise definition of what your criteria is for a significant peak.
You can probably use the MinProminence parameter to select the peaks that you want.
  2 Kommentare
JamJan am 1 Aug. 2019
Thank you, but unfortunately I'm using Matlab 2017a at this moment. Is there another way?
Jon am 1 Aug. 2019
Bearbeitet: Jon am 1 Aug. 2019
You can use this approach to find where sign of the local slope changes to locate the minimums
idA = 1:length(A)
dA = diff(A);
isMin = [false sign(dA(1:end-1))< 0 & sign(dA(2:end))>0 false];
Also I assumed that you do not have the Signal Processing toolbox. If you did you could use the findpeaks function.
You will need to define exactly what your criteria is for eliminating any spurious minima, and then you should be able to program up some code to do that. MATLAB uses the concept of "prominence" which they explain (in terms of relative maxima) here
Note also that if you have an algorithm for finding relative maxima you can always invert (multiply by -1) your signal so that the relative minima become relative maxima.
Finally I noticed that there is an offering in the MATLAB FEX (file exchange) that may provide some help

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by