Voigtian line shape.
y = voigtian(x,x0,fwhm) y = voigtian(x,x0,fwhm,deriv)
This function returns a Voigtian line shape with centre x0
and full width at
half height fwhm
over the abscissa values defined in the vector
x
. A Voigtian line shape is the convolution of a Gaussian and Lorentzian.
fwhm
specifies the full width at half height for both convolution components
fwhm = [fwhmGauss fwhmLorentz]
.
deriv
determines the derivative to compute. 0 stands for 0th derivative,
1 is the first one, 2 the second one, -1 indicates the integral with as
lower limit. If
deriv
is not given, it defaults to 0.
For long x
vectors, the convolution takes time. If the performance is
critical, pseudo-Voigt line shapes (linear combination of Gaussian and Lorentzian) can be
computed with the function
lshape.
To obtain a Voigtian with centre at 350 mT and FWHM of 20 mT for both Gaussian and Lorentzian, use
x0 = 350; x = x0+100*linspace(-1,1,1e3); y = gaussian(x,x0,[20 20]); plot(x,y);
The Voigtian is normalised, its integral is one.
sum(y)*(x(2)-x(1))
ans = 1.0000
convspec, gaussian, lorentzian, lshape