Finding peaks in data based on certain threshold
이전 댓글 표시
Hi I have an array [V Data] (Attached data file).The plot is shown below.

I want to detect the # of peaks (3 in this case) which are above a certain threshold (value is = 0.1) I also want to find the points where it crosses the threshold and extract respective values from V
Thanks SATEJ
채택된 답변
추가 답변 (1개)
Image Analyst
2014년 12월 20일
Describe what "detect" means to you. Obviously you threshold:
abovePointOne = v > 0.1;
but then what? What kind of numbers do you want? The length of the stretches above 0.1? The starting points? The count of the number of stretches above 0.1? What????
댓글 수: 6
Satej
2014년 12월 20일
편집: Image Analyst
2014년 12월 20일
Image Analyst
2014년 12월 20일
It looks like Star's code gives you that plus even better in that it gives you sub-element resolution. If you need it on the exactly elements you said, then you'll have to do a more specialized, complicated routine. Probably a for loop where you're detecting if you're above the threshold and "in" the peak (in which case you'll keep the last index before you went above the threshold), or below the threshold but just went below it on this index (in which case you'll take that index instead of the prior one.)
Star Strider
2014년 12월 20일
Thanks, I A.
To provide a context, I deleted my Answer because it was neither Accepted nor Voted.
Image Analyst
2014년 12월 20일
Why bother to do that? It had good and clever code in it that may help someone else someday.
Satej
2014년 12월 22일
Joshua Briggs
2017년 3월 28일
Hi I am looking to do something similar to Satej, and IA's description of SS's code sounds like exactly what I need, just wondering if anyone has it, or if SS could please repost it.
카테고리
도움말 센터 및 File Exchange에서 Parametric Modeling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!