MATLAB Answers

how to find duration of peak; starting and ending points

조회 수: 29(최근 30일)
I've used findpeaks to isolate the largest peak in my signal. I wanted some help in finding the duration of the peak aka the starting and ending points of this peak, so that I could calculate area under curve? Right now Im having to visually inspect and pick arbitrary points to define this start and end points.

  댓글 수: 0

로그인 to comment.

채택된 답변

Star Strider
Star Strider 25 Feb 2020
Experiment with ths ischange function, and if you have the Signal Processing Toolbox, the findchangepts function.

  댓글 수: 7

표시 이전 댓글 수: 4
Star Strider
Star Strider 25 Feb 2020
In the plot you posted, there are several things findchangepts can consider to be change points.
The findchangepts function has a number of name-value pair arguments that you can use to tell it what you want it to do. The 'Statistic' and 'MinDistance' arguments are the ones I usually use. A different subset may be more appropriate for your purposes.
Raheema Al Karim Damani
Thank you your advice was helpful. The statistics arguments is really helpful in the findchangepts functions.
Star Strider
Star Strider 26 Feb 2020
As always, my pleasure!

로그인 to comment.

추가 답변(1개)

Sindar
Sindar 25 Feb 2020
widths are an optional output from findpeaks:
[pks,locs,widths,~] = findpeaks(data);

  댓글 수: 2

Sindar
Sindar 25 Feb 2020
Alternatively, you could potentially define the starting and ending points using findpeaks on the negative of your data.
Raheema Al Karim Damani
I believe that it finds the widths from the half prominence or half height, which would not accurately characterize the starting and ending points.
Also, I would like to find the index (x values) of the peak based on start and end points

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by