is there a way to obtain peak width after peak detection ?
Show older comments
I have used the function findpeaks to detect spikes in a signal
however I have initially used the halfprominence as width-reference
is there a way to obtain widths using half-height after such peak detection, having the peak timestamps and their amplitude values ?
Accepted Answer
More Answers (2)
Use the "halfheight" width reference. There's an example here: https://www.mathworks.com/help/signal/ref/findpeaks.html#buhd6xj
[pks,locs,w,p] = findpeaks(PeakSig,x,'Annotate','extents','WidthReference','halfheight')

5 Comments
Adam Danz
on 28 May 2019
LO's comment moved here:
"I know that, thanks. What I wanted to know is whether one could get those values without doing the peak detection again"
Why would you need to run it twice? The widths are returned in the 3rd output.
[pks,locs,w,p] = findpeaks(PeakSig,x,'Annotate','extents','WidthReference','halfheight')
Hi,
I hope this question makes sense (let me know if I need to phrase it better), but I was wondering if there are options other than "halfheight". For example, is there a way to find the width from the bottom (in this case it would be a line going along the x-axis.) Essentially, can you customize the height that you find the width from? I would greatly appreciate any input.
Star Strider
on 29 Jun 2023
@Carlos — See Finding max peaks and full width/half max for both curves in the given plot for one example of determining the FWHM with respect to a signal baseline.
Carlos
on 29 Jun 2023
Thank you so much
Star Strider
on 29 Jun 2023
My pleasure!
LO
on 28 May 2019
0 votes
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!