# Voigt profile

The Voigt profile (named after Woldemar Voigt) is a probability distribution given by a convolution of a Cauchy-Lorentz distribution and a Gaussian distribution. It is often used in analyzing data from spectroscopy or diffraction.

## Definition

Without loss of generality, we can consider only centered profiles, which peak at zero. The Voigt profile is then
    $V(x;\sigma ,\gamma )\equiv \int _{-\infty }^{\infty }G(x';\sigma )L(x-x';\gamma )\,dx',$
where x is the shift from the line center, $G(x;\sigma )$ is the centered Gaussian profile:
    $G(x;\sigma )\equiv {\frac {e^{-{\frac {x^{2}}{2\sigma ^{2}}}}}{{\sqrt {2\pi }}\,\sigma }},$
and $L(x;\gamma )$ is the centered Lorentzian profile:
    $L(x;\gamma )\equiv {\frac {\gamma }{\pi (\gamma ^{2}+x^{2})}}.$
The defining integral can be evaluated as:
    $V(x;\sigma ,\gamma )={\frac {\operatorname {Re} [w(z)]}{{\sqrt {2\pi }}\,\sigma }},$
where Re[w(z)] is the real part of the Faddeeva function evaluated for
    $z={\frac {x+i\gamma }{{\sqrt {2}}\,\sigma }}.$
In the limiting cases of $\sigma =0$ and $\gamma =0$ then $V(x;\sigma ,\gamma )$ simplifies to $L(x;\gamma )$ and $G(x;\sigma )$, respectively.

## History and applications

In spectroscopy, a Voigt profile results from the convolution of two broadening mechanisms, one of which alone would produce a Gaussian profile (usually, as a result of the Doppler broadening), and the other would produce a Lorentzian profile. Voigt profiles are common in many branches of spectroscopy and diffraction. Due to the expense of computing the Faddeeva function, the Voigt profile is sometimes approximated using a pseudo-Voigt profile.

## Properties

The Voigt profile is normalized:
    $\int _{-\infty }^{\infty }V(x;\sigma ,\gamma )\,dx=1,$
since it is a convolution of normalized profiles. The Lorentzian profile has no moments (other than the zeroth), and so the moment-generating function for the Cauchy distribution is not defined. It follows that the Voigt profile will not have a moment-generating function either, but the characteristic function for the Cauchy distribution is well defined, as is the characteristic function for the normal distribution. The characteristic function for the (centered) Voigt profile will then be the product of the two:
    $\varphi _{f}(t;\sigma ,\gamma )=E(e^{ixt})=e^{-\sigma ^{2}t^{2}/2-\gamma |t|}.$
Since normal distributions and Cauchy distributions are stable distributions, they are each closed under convolution (up to change of scale), and it follows that the Voigt distributions are also closed under convolution.

### Cumulative distribution function

Using the above definition for z , the cumulative distribution function (CDF) can be found as follows:
    $F(x_{0};\mu ,\sigma )=\int _{-\infty }^{x_{0}}{\frac {\operatorname {Re} (w(z))}{\sigma {\sqrt {2\pi }}}}\,dx=\operatorname {Re} \left({\frac {1}{\sqrt {\pi }}}\int _{z(-\infty )}^{z(x_{0})}w(z)\,dz\right).$
Substituting the definition of the Faddeeva function (scaled complex error function) yields for the indefinite integral:
    ${\frac {1}{\sqrt {\pi }}}\int w(z)\,dz={\frac {1}{\sqrt {\pi }}}\int e^{-z^{2}}\left[1-\operatorname {erf} (-iz)\right]\,dz,$
which may be solved to yield
    ${\frac {1}{\sqrt {\pi }}}\int w(z)\,dz={\frac {\operatorname {erf} (z)}{2}}+{\frac {iz^{2}}{\pi }}\,_{2}F_{2}\left(1,1;{\frac {3}{2}},2;-z^{2}\right),$
where $_{2}F_{2}$ is a hypergeometric function. In order for the function to approach zero as x approaches negative infinity (as the CDF must do), an integration constant of 1/2 must be added. This gives for the CDF of Voigt:
    $F(x;\mu ,\sigma )=\operatorname {Re} \left[{\frac {1}{2}}+{\frac {\operatorname {erf} (z)}{2}}+{\frac {iz^{2}}{\pi }}\,_{2}F_{2}\left(1,1;{\frac {3}{2}},2;-z^{2}\right)\right].$

### The uncentered Voigt profile

If the Gaussian profile is centered at $\mu _{G}$ and the Lorentzian profile is centered at $\mu _{L}$, the convolution is centered at $\mu _{V}=\mu _{G}+\mu _{L}$ and the characteristic function is:
    $\varphi _{f}(t;\sigma ,\gamma ,\mu _{\mathrm {G} },\mu _{\mathrm {L} })=e^{i(\mu _{\mathrm {G} }+\mu _{\mathrm {L} })t-\sigma ^{2}t^{2}/2-\gamma |t|}.$
The probability density function is simply offset from the centered profile by $\mu _{V}$:
    $V(x;\mu _{V},\sigma ,\gamma )={\frac {\operatorname {Re} [w(z)]}{\sigma {\sqrt {2\pi }}}},$
where:
    $z={\frac {x-\mu _{V}+i\gamma }{\sigma {\sqrt {2}}}}$
The mode and median are both located at $\mu _{V}$.

### Derivatives

Using the definition above for $z$ and $x_{c}=x-\mu _{V}$, the first and second derivatives can be expressed in terms of the Faddeeva function as
    ${\begin{aligned}{\frac {\partial }{\partial x}}V(x_{c};\sigma ,\gamma )&=-{\frac {\operatorname {Re} \left[z~w(z)\right]}{\sigma ^{2}{\sqrt {\pi }}}}=-{\frac {x_{c}}{\sigma ^{2}}}{\frac {\operatorname {Re} \left[w(z)\right]}{\sigma {\sqrt {2\pi }}}}+{\frac {\gamma }{\sigma ^{2}}}{\frac {\operatorname {Im} \left[w(z)\right]}{\sigma {\sqrt {2\pi }}}}\\&={\frac {1}{\sigma ^{3}{\sqrt {2\pi }}}}\cdot \left(\gamma \cdot \operatorname {Im} \left[w(z)\right]-x_{c}\cdot \operatorname {Re} \left[w(z)\right]\right)\end{aligned}}$
and
    ${\begin{aligned}{\frac {\partial ^{2}}{\left(\partial x\right)^{2}}}V(x_{c};\sigma ,\gamma )&={\frac {x_{c}^{2}-\gamma ^{2}-\sigma ^{2}}{\sigma ^{4}}}{\frac {\operatorname {Re} \left[w(z)\right]}{\sigma {\sqrt {2\pi }}}}-{\frac {2x_{c}\gamma }{\sigma ^{4}}}{\frac {\operatorname {Im} \left[w(z)\right]}{\sigma {\sqrt {2\pi }}}}+{\frac {\gamma }{\sigma ^{4}}}{\frac {1}{\pi }}\\&=-{\frac {1}{\sigma ^{5}{\sqrt {2\pi }}}}\cdot \left(\gamma \cdot \left(2x_{c}\cdot \operatorname {Im} \left[w(z)\right]-\sigma \cdot {\sqrt {\frac {2}{\pi }}}\right)+\left(\gamma ^{2}+\sigma ^{2}-x_{c}^{2}\right)\cdot \operatorname {Re} \left[w(z)\right]\right),\end{aligned}}$
respectively.
Often, one or multiple Voigt profiles and/or their respective derivatives need to be fitted to a measured signal by means of non-linear least squares, e.g., in spectroscopy. Then, further partial derivatives can be utilised to accelerate computations. Instead of approximating the Jacobian matrix with respect to the parameters $\mu _{V}$, $\sigma$, and $\gamma$ with the aid of finite differences, the corresponding analytical expressions can be applied. With $\operatorname {Re} \left[w(z)\right]=\Re _{w}$ and $\operatorname {Im} \left[w(z)\right]=\Im _{w}$, these are given by:
    ${\begin{aligned}{\frac {\partial V}{\partial \mu _{V}}}=-{\frac {\partial V}{\partial x}}={\frac {1}{\sigma ^{3}{\sqrt {2\pi }}}}\cdot \left(x_{c}\cdot \Re _{w}-\gamma \cdot \Im _{w}\right)\end{aligned}}$
    ${\begin{aligned}{\frac {\partial V}{\partial \sigma }}={\frac {1}{\sigma ^{4}{\sqrt {2\pi }}}}\cdot \left(\left(x_{c}^{2}-\gamma ^{2}-\sigma ^{2}\right)\cdot \Re _{w}-2x_{c}\gamma \cdot \Im _{w}+\gamma \sigma \cdot {\sqrt {\frac {2}{\pi }}}\right)\end{aligned}}$
    ${\begin{aligned}{\frac {\partial V}{\partial \gamma }}=-{\frac {1}{\sigma ^{3}{\sqrt {2\pi }}}}\cdot \left(\sigma \cdot {\sqrt {\frac {2}{\pi }}}-x_{c}\cdot \Im _{w}-\gamma \cdot \Re _{w}\right)\end{aligned}}$
for the original voigt profile $V$;
    ${\begin{aligned}{\frac {\partial V'}{\partial \mu _{V}}}=-{\frac {\partial V'}{\partial x}}=-{\frac {\partial ^{2}V}{\left(\partial x\right)^{2}}}={\frac {1}{\sigma ^{5}{\sqrt {2\pi }}}}\cdot \left(\gamma \cdot \left(2x_{c}\cdot \Im _{w}-\sigma \cdot {\sqrt {\frac {2}{\pi }}}\right)+\left(\gamma ^{2}+\sigma ^{2}-x_{c}^{2}\right)\cdot \Re _{w}\right)\end{aligned}}$
    ${\begin{aligned}{\frac {\partial V'}{\partial \sigma }}={\frac {3}{\sigma ^{6}{\sqrt {2\pi }}}}\cdot \left(-\gamma \sigma x_{c}\cdot {\frac {2{\sqrt {2}}}{3{\sqrt {\pi }}}}+\left(x_{c}^{2}-{\frac {\gamma ^{2}}{3}}-\sigma ^{2}\right)\cdot \gamma \cdot \Im _{w}+\left(\gamma ^{2}+\sigma ^{2}-{\frac {x_{c}^{2}}{3}}\right)\cdot x_{c}\cdot \Re _{w}\right)\end{aligned}}$
    ${\begin{aligned}{\frac {\partial V'}{\partial \gamma }}={\frac {1}{\sigma ^{5}{\sqrt {2\pi }}}}\cdot \left(x_{c}\cdot \left(\sigma \cdot {\sqrt {\frac {2}{\pi }}}-2\gamma \cdot \Re _{w}\right)+\left(\gamma ^{2}+\sigma ^{2}-x_{c}^{2}\right)\cdot \Im _{w}\right)\end{aligned}}$
for the first order partial derivative $V'={\frac {\partial V}{\partial x}}$; and
    ${\begin{aligned}{\frac {\partial V''}{\partial \mu _{V}}}=-{\frac {\partial V''}{\partial x}}=-{\frac {\partial ^{3}V}{\left(\partial x\right)^{3}}}=-{\frac {3}{\sigma ^{7}{\sqrt {2\pi }}}}\cdot \left(\left(x_{c}^{2}-{\frac {\gamma ^{2}}{3}}-\sigma ^{2}\right)\cdot \gamma \cdot \Im _{w}+\left(\gamma ^{2}+\sigma ^{2}-{\frac {x_{c}^{2}}{3}}\right)\cdot x_{c}\cdot \Re _{w}-\gamma \sigma x_{c}\cdot {\frac {2{\sqrt {2}}}{3{\sqrt {\pi }}}}\right)\end{aligned}}$
    ${\begin{aligned}&{\frac {\partial V''}{\partial \sigma }}=-{\frac {1}{\sigma ^{8}{\sqrt {2\pi }}}}\cdot \\&\left(\left(-3\gamma x_{c}\sigma ^{2}+\gamma x_{c}^{3}-\gamma ^{3}x_{c}\right)\cdot 4\cdot \Im _{w}+\left(\left(2x_{c}^{2}-2\gamma ^{2}-\sigma ^{2}\right)\cdot 3\sigma ^{2}+6\gamma ^{2}x_{c}^{2}-x_{c}^{4}-\gamma ^{4}\right)\cdot \Re _{w}+\left(\gamma ^{2}+5\sigma ^{2}-3x_{c}^{2}\right)\cdot \gamma \sigma \cdot {\sqrt {\frac {2}{\pi }}}\right)\end{aligned}}$
    ${\begin{aligned}{\frac {\partial V''}{\partial \gamma }}=-{\frac {3}{\sigma ^{7}{\sqrt {2\pi }}}}\cdot \left(\left(\gamma ^{2}+\sigma ^{2}-{\frac {x_{c}^{2}}{3}}\right)\cdot x_{c}\cdot \Im _{w}+\left({\frac {\gamma ^{2}}{3}}+\sigma ^{2}-x_{c}^{2}\right)\cdot \gamma \cdot \Re _{w}+\left(x_{c}^{2}-\gamma ^{2}-2\sigma ^{2}\right)\cdot \sigma \cdot {\frac {\sqrt {2}}{3{\sqrt {\pi }}}}\right)\end{aligned}}$
for the second order partial derivative $V''={\frac {\partial ^{2}V}{\left(\partial x\right)^{2}}}$. Since $\mu _{V}$ and $\gamma$ play a relatively similar role in the calculation of $z$, their respective partial derivatives also look quite similar in terms of their structure, although they result in totally different derivative profiles. Indeed, the partial derivatives with respect to $\sigma$ and $\gamma$ show more similarity since both are width parameters. All these derivatives involve only simple operations (multiplications and additions) because the computationally expensive $\Re _{w}$ and $\Im _{w}$ are readily obtained when computing $w\left(z\right)$. Such a reuse of previous calculations allows for a derivation at minimum costs. This is not the case for finite difference gradient approximation as it requires the evaluation of $w\left(z\right)$ for each gradient respectively.

## Voigt functions

The Voigt functions U, V, and H (sometimes called the line broadening function) are defined by
    $U(x,t)+iV(x,t)={\sqrt {\frac {\pi }{4t}}}e^{z^{2}}\operatorname {erfc} (z)={\sqrt {\frac {\pi }{4t}}}w(iz),$
    $H(a,u)={\frac {U({\frac {u}{a}},{\frac {1}{4a^{2}}})}{{\sqrt {\pi }}\,a}},$
where
    $z={\frac {1-ix}{2{\sqrt {t}}}},$
erfc is the complementary error function, and w(z) is the Faddeeva function.

### Relation to Voigt profile

    $V(x;\sigma ,\gamma )={\frac {H(a,u)}{{\sqrt {2\pi }}\,\sigma }},$
with Gaussian sigma relative variables $u={\frac {x}{{\sqrt {2}}\,\sigma }}$ and $a={\frac {\gamma }{{\sqrt {2}}\,\sigma }}.$

## Numeric approximations
### Tepper-García Function

The Tepper-García function, named after Mexican-born, German-Australian Astrophysicist Thor Tepper-García, is a combination of an exponential function and rational functions that approximates the line broadening function $H(a,u)$ over a wide range of its parameters. It is obtained from a truncated power series expansion of the exact line broadening function.
In its most computationally efficient form, the Tepper-García function can be expressed as
    $T(a,u)=R-\left(a/{\sqrt {\pi }}P\right)~\left[R^{2}~(4P^{2}+7P+4+Q)-Q-1\right]\,,$
where $P\equiv u^{2}$, $Q\equiv 3/(2P)$, and $R\equiv e^{-P}$.
Thus the line broadening function can be viewed, to first order, as a pure Gaussian function plus a correction factor that depends linearly on the microscopic properties of the absorbing medium (encoded in $a$); however, as a result of the early truncation in the series expansion, the error in the approximation is still of order $a$, i.e. $H(a,u)\approx T(a,u)+{\mathcal {O}}(a)$. This approximation has a relative accuracy of
    $\epsilon \equiv {\frac {\vert H(a,u)-T(a,u)\vert }{H(a,u)}}\lesssim 10^{-4}$
over the full wavelength range of $H(a,u)$, provided that $a\lesssim 10^{-4}$. In addition to its high accuracy, the function $T(a,u)$ is easy to implement as well as computationally fast. It is widely used in the field of quasar absorption line analysis.

### Pseudo-Voigt approximation

The pseudo-Voigt profile (or pseudo-Voigt function) is an approximation of the Voigt profile V(x) using a linear combination of a Gaussian curve G(x) and a Lorentzian curve L(x) instead of their convolution.
The pseudo-Voigt function is often used for calculations of experimental spectral line shapes.
The mathematical definition of the normalized pseudo-Voigt profile is given by
    $V_{p}(x,f)=\eta \cdot L(x,f)+(1-\eta )\cdot G(x,f)$ with $0<\eta <1$.
$\eta$ is a function of full width at half maximum (FWHM) parameter.
There are several possible choices for the $\eta$ parameter. A simple formula, accurate to 1%, is
    $\eta =1.36603(f_{L}/f)-0.47719(f_{L}/f)^{2}+0.11116(f_{L}/f)^{3},$
where now, $\eta$ is a function of Lorentz ($f_{L}$), Gaussian ($f_{G}$) and total ($f$) Full width at half maximum (FWHM) parameters. The total FWHM ($f$) parameter is described by:
    $f=[f_{G}^{5}+2.69269f_{G}^{4}f_{L}+2.42843f_{G}^{3}f_{L}^{2}+4.47163f_{G}^{2}f_{L}^{3}+0.07842f_{G}f_{L}^{4}+f_{L}^{5}]^{1/5}.$

### The width of the Voigt profile

The full width at half maximum (FWHM) of the Voigt profile can be found from the widths of the associated Gaussian and Lorentzian widths. The FWHM of the Gaussian profile is
    $f_{\mathrm {G} }=2\sigma {\sqrt {2\ln(2)}}.$
The FWHM of the Lorentzian profile is
    $f_{\mathrm {L} }=2\gamma .$
An approximate relation (accurate to within about 1.2%) between the widths of the Voigt, Gaussian, and Lorentzian profiles is:
    $f_{\mathrm {V} }\approx f_{\mathrm {L} }/2+{\sqrt {f_{\mathrm {L} }^{2}/4+f_{\mathrm {G} }^{2}}}.$
By construction, this expression is exact for a pure Gaussian or Lorentzian.
A better approximation with an accuracy of 0.02% is given by (originally found by Kielkopf)
    $f_{\mathrm {V} }\approx 0.5346f_{\mathrm {L} }+{\sqrt {0.2166f_{\mathrm {L} }^{2}+f_{\mathrm {G} }^{2}}}.$
Again, this expression is exact for a pure Gaussian or Lorentzian. In the same publication, a slightly more precise (within 0.012%), yet significantly more complicated expression can be found.

## Asymmetric Pseudo-Voigt (Martinelli) function

The asymmetry pseudo-Voigt (Martinelli) function resembles a split normal distribution by having different widths on each side of the peak position. Mathematically this is expressed as:
$V_{p}(x,f)=\eta \cdot L(x,f)+(1-\eta )\cdot G(x,f)$
with $0<\eta <1$ being the weight of the Lorentzian and the width $f$ being a split function ($f=f_{1}$for $x<0$ and $f=f_{2}$ for $x\geq 0$). In the limit $f_{1}\rightarrow f_{2}$, the Martinelli function returns to a symmetry pseudo Voigt function. The Martinelli function has been used to model elastic scattering on resonant inelastic X-ray scattering instruments.