width = fwhm(x,y)
Full-Width at Half-Maximum (FWHM) of the waveform y(x) and its polarity.
The FWHM result in 'width' will be in units of 'x'
The code was developed by an unknown author.
Patrick Egan (2021). fwhm (https://www.mathworks.com/matlabcentral/fileexchange/10590-fwhm), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
I am trying to understand some parts of the code, please could anyone provide me with some guidance? Many thanks
how to run?
Nice work.
Thanks @Brandon Nichols. I update it in lines 12 and 14. Then the codes works well.
y = y - min(y); %need to subtract off minimum to span [0 1]
i = 2;
while (sign(y(i)-lev50) == sign(y(i-1)-lev50) && (i <= N-1))
it work perfectly and accurately, Thank you
Hi, i have a problem using your function, Could you tell me please if i am doing anything wrong.
Index in position 1 exceeds array bounds (must not exceed 1).
width = fwhm([1,2,3,4,5,6,7,8], [2,4,5,6,8,5,3,2]);
Thank you, it's simply perfect.
It works thank you
So helpful. but I have a question! this code can be used for all the data?for all pulses shapes? anyone any experiences?
Thanks o(≧v≦)o
useful, thx!
hii
i have 5 pulse in my signal ...how to find FWHM for every pulse?
Thanks in advance
is there a reason why the widths come out negative?
Can this be extended to find out FWHM of multiple culrves in a single plot and compare between the FWHM? If so, how?
this code is not working for raised sine and raise cosine functions.
Add the following line to handle data with a narrow dynamic range (insert at line 12).
y = y - min(y); %need to subtract off minimum to span [0 1]
Great! Quite happy with it.
THANKS TO SHARING
When I try to take columns out of my array into fwhm - e.g. fwhm(peak(:,1),peak(:,2)) - I am getting an error saying that max is undefined for 'datasets'. So there is an error in y = y / max(y).
Sorry, I have no experience with MatLab. Any help would be greatly appreciated!
Thank you for sharing :)
I'm trying to use this on spectral data from FTIR and I'm getting the error " Attempted to access y(132); index out of bounds because numel(y)=131."
My data is 131 points. Can anyone help me figure out how to use this? I'm very inexperienced with Matlab
Thanks man :)
so good
thanks a lot. Finally I have got the result.
Works as advertised, a great improvement over the simple algorithm for FWHM I was using.
Thank you.
wow
the code is perfect, thanks a lot
thanks
Brilliant, saved me a lot of time!
Simple and easy to read. I modified it to search for the falling edge from the end of the array instead of from the peak because my pulses have high overshoot at the rising/falling edges.
Thanks
very easy to use, thank you
Need to add y=y-min(x) at beginning to find fwhm of data not going to zero
It does not work for noisy y(x). It keeps saying the peak is an impulse.
Superb
easy to use
Fantastic! Im so glad I found this!
Great Job !
Very easy to use!
great job!
This file's suitable to use for experimental datas.