File Exchange

## fwhm

version 1.0 (1.49 KB) by

To calculate the full-width at half-maximum of an input.

4.84848
33 Ratings

123 Downloads

Updated

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.

Geoffrey Chase

Nikita Vasilev

Hsu-Cheng Cheng

useful, thx!

riad didou

### riad didou (view profile)

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

Thanks in advance

Kirk Truax

Paul Bebb

### Paul Bebb (view profile)

is there a reason why the widths come out negative?

418

Vasanth

### Vasanth (view profile)

Can this be extended to find out FWHM of multiple culrves in a single plot and compare between the FWHM? If so, how?

krishna mohan dwivedi

### krishna mohan dwivedi (view profile)

this code is not working for raised sine and raise cosine functions.

Brandon Nichols

### Brandon Nichols (view profile)

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

### BNeto (view profile)

Great! Quite happy with it.

Rick Hsieh

cai jason

### cai jason (view profile)

THANKS TO SHARING

Matthew Lee

### Matthew Lee (view profile)

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!

Parimalah Velo

### Parimalah Velo (view profile)

Thank you for sharing :)

Benjamin Ficara

### Benjamin Ficara (view profile)

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

Rafael Ribeiro

### Rafael Ribeiro (view profile)

Ilias Giannakopoulos

Thanks man :)

Joao

so good

Subhajit

### Subhajit (view profile)

thanks a lot. Finally I have got the result.

Bob

### Bob (view profile)

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

Jade He

Thank you.

Eric

### Eric (view profile)

wow
the code is perfect, thanks a lot

Bakhtiyar Orazbayev

Mikhail Konnik

yongbiao shi

thanks

Nicolas

### Nicolas (view profile)

Brilliant, saved me a lot of time!

Robert

Donald

### Donald (view profile)

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.

Tom Phillips

Thanks

Amr Sadek

### Amr Sadek (view profile)

very easy to use, thank you

Brian

### Brian (view profile)

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

 3 Apr 2006 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. 3 Apr 2006 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 6.5 (R13)
##### Tags Add Tags

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.