# How to calculate the full width half maximum (FWHM) of a function or vector?

**URL:** <https://discourse.julialang.org/t/how-to-calculate-the-full-width-half-maximum-fwhm-of-a-function-or-vector/103720>\
**Category:** General Usage\
**Created:** [September 10, 2023, 1:30pm UTC](https://discourse.julialang.org/t/how-to-calculate-the-full-width-half-maximum-fwhm-of-a-function-or-vector/103720 "2023-09-10T13:30:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 10, 2023, 1:30pm UTC](https://discourse.julialang.org/t/how-to-calculate-the-full-width-half-maximum-fwhm-of-a-function-or-vector/103720/1 "2023-09-10T13:30:33Z")

</div>

In a number of different domains, one is interested in the width of a peak. Two common functions one might want to know the width of are probability distributions (statstics) and intensity distributions (optics and more). A simple-to-define and widespread measure of peak width is the full width half maximum (FWHM). It is interesting to find it for both continuous functions and sampled ones (i.e. vectors).

Are there packages that implement functionality to find the FWHM of functions and vectors?

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 10, 2023, 1:33pm UTC](https://discourse.julialang.org/t/how-to-calculate-the-full-width-half-maximum-fwhm-of-a-function-or-vector/103720/2 "2023-09-10T13:33:21Z")

</div>

[Peaks.jl](https://github.com/halleysfifthinc/Peaks.jl) is able to calculate the width of peaks in 1D sampled signals (vectors). It allows you to calculate the width at any point between top and bottom, but defaults to halfway. This means that, by default, the FWHM is found.
