35 views (last 30 days)

Hello! I want to first say I'm incredibly appreciative of this community and its response to questions. People like me very much appreciate it. Here is my situation:

I have an array of 116 curves:

Each cuve is a single peak:

What I'm trying to do is find the edges of the peaks and the position of those edges:

I have successfully used findpeaks() to find the position, location, and peak width of each of the 116 curves/peaks, but the peak width is limited to either the bandwidth at halfheight or halfprominance. I was wondering if anyone could help me with an approach that could help me find the peak edges and what index/pixel it occurs at. I would greatly appreciate it.

Mathieu NOE
on 22 Jan 2021

hello

I suggest to use the attached crossing function , with the y threshold corresponding the y value of the black line in your picture.

the function allows you to get the positive slope (left crossing) point and the negative slope (right crossing) point

hope it helps

Mathieu NOE
on 28 Jan 2021 at 7:52

hello Cristopher

no problem, I like to work on (interesting) posts !

One problem I figured out this night is that the t0_pos and t0_neg values are obtained by linear interpolation for maximal precision; this is good , but on the other side , these "new" time values do not belong to the original time vector , and they are different for eah individual curve;

so at the end, I cannot create a common time axis for all curves , unless I do not merge the crossing points coordinates into the original x and y datas

IMO, we should step back to what was the first implementation and add some steps :

- do a for loop in the main code
- do the crossing stuff on one y vector at a time
- merge the x and y original datas with the crossing points coordinates (and sort x in ascending order to avoid zig zags in plot)
- put the y section between x = t0_pos to t0_neg equal to 0
- repeat for all curves
- this implies each curve a a specific x vector
- plot with hold on

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

Start Hunting!
## 0 Comments

Sign in to comment.