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!