Gaussian line shape.
y = gaussian(x,x0,fwhm) y = gaussian(x,x0,fwhm,diff)
This function returns a Gaussian lineshape with centre 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 as lower limit. If
diff
is not
given, it is set to 0 by default.
To obtain a Gaussian with centre 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
convspec, lorentzian, lshape, voigtian