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!