How to do Downward peak detection?

3 ビュー (過去 30 日間)
JamJan
JamJan 2019 年 7 月 31 日
編集済み: Jon 2019 年 8 月 1 日
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?
Thanks!

回答 (1 件)

Jon
Jon 2019 年 7 月 31 日
編集済み: Jon 2019 年 7 月 31 日
You can use the MATLAB function islocalmin for example
idx = 1:length(A)
isMin = islocalmin(A);
plot(idx,A,idx(isMin),A(isMin),'o')
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 件のコメント
JamJan
JamJan 2019 年 8 月 1 日
Thank you, but unfortunately I'm using Matlab 2017a at this moment. Is there another way?
Jon
Jon 2019 年 8 月 1 日
編集済み: Jon 2019 年 8 月 1 日
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];
plot(idA,A,idA(isMin),A(isMin),'o')
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 https://www.mathworks.com/help/signal/ug/prominence.html
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 https://www.mathworks.com/matlabcentral/fileexchange/11755-peak-finding-and-measurement

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by