gaussian

Gaussian line shape.

Syntax
yabs = gaussian(x,x0,fwhm)
yabs = gaussian(x,x0,fwhm,diff)
yabs = gaussian(x,x0,fwhm,diff,phase)
[yabs,ydisp] = ...
Description

This function returns a Gaussian line shape with center x0 and full width at half height fwhm over the abscissa values defined in the vector x.

diff determines the derivative to compute. 0 stands for no derivative, 1 is the first one, 2 the second one, -1 indicates the integral with [eqn] as lower limit. If diff is not given, it is set to 0 by default.

yabs is the absorption Gaussian line shape, and ydisp is the dispersion Gaussian line shape.

If phase is given, the absorption and dispersion line shapes are both rotated the by the given amount (in radians). E.g., with phase=pi/2, yabs would contain the dispersion line shape.

Examples

To obtain a Gaussian with center at 34 and FWHM of 20, use

x = linspace(-100,100,1e3); x0 = 34; w = 20;
y = gaussian(x,x0,w);
plot(x,y);

The Gaussian is normalised, its integral is one.

sum(y)*(x(2)-x(1))
ans =
    1.0000

Here is a plot of both the absorption and dispersion line shapes

x = linspace(-100,100,1e3); x0 = 14; w = 20;
[ya,yd] = gaussian(x,x0,w);
plot(x,ya,x,yd);
See also

convspec, hilberttrans, lorentzian, lshape, voigtian