File Exchange

image thumbnail

fwhm

version 1.0.0.0 (1.49 KB) by Patrick Egan
To calculate the full-width at half-maximum of an input.

75 Downloads

Updated 05 Apr 2006

View License

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.

Comments and Ratings (49)

pz Dang

Lifeng Gan

Amit Kaplan

lemon

jiahao liu

Thanks o(≧v≦)o

useful, thx!

riad didou

hii
i have 5 pulse in my signal ...how to find FWHM for every pulse?

Thanks in advance

Kirk Truax

Paul Bebb

is there a reason why the widths come out negative?

418

Vasanth

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]

BNeto

Great! Quite happy with it.

Rick Hsieh

cai jason

THANKS TO SHARING

Matthew Lee

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 :)

Joao

so good

Subhajit

thanks a lot. Finally I have got the result.

Bob

Works as advertised, a great improvement over the simple algorithm for FWHM I was using.

Jade He

Thank you.

Eric

wow
the code is perfect, thanks a lot

thanks

Nicolas

Brilliant, saved me a lot of time!

Robert

Donald

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

Amr Sadek

very easy to use, thank you

Brian

Need to add y=y-min(x) at beginning to find fwhm of data not going to zero

Nathir Rawashdeh

It does not work for noisy y(x). It keeps saying the peak is an impulse.

John Smith

Superb

bioguider bioguider

easy to use

Ketki V

Fantastic! Im so glad I found this!

Rajiv Bharadwaj

Great Job !

Sue S

Very easy to use!

Igor K

great job!

zm o

This file's suitable to use for experimental datas.

Updates

1.0.0.0

No need to reassign variables 'x' and 'y'.

Remove last 'else' condition.

1) Remove line:
[c_max,k_index] = max(y);

2) Replaced two two "if-end" conditions by "if-else-end" condition

3) The output argument "c" was never returned, hence it has been removed.

1) Remove line:
[c_max,k_index] = max(y);

2) Replaced two two "if-end" conditions by "if-else-end" condition

3) The output argument "c" was never returned, hence it has been removed.

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux