Gaussian function

From Wikipedia, the free encyclopedia

Normalized Gaussian curves with expected value μ and variance σ2. The corresponding parameters are a= 1/(σ√(2π)), b=μ, c=σ
Normalized Gaussian curves with expected value μ and variance σ2. The corresponding parameters are a= 1/(σ√(2π)), b=μ, c

In mathematics, a Gaussian function (named after Carl Friedrich Gauss) is a function of the form:

f(x) = a e^{- { (x-b)^2 \over 2 c^2 } }

for some real constants a > 0, b, and c > 0.

The graph of a Gaussian is a characteristic symmetric "bell shape curve" that quickly falls off towards plus/minus infinity. The parameter a is the height of the curve's peak, b is the position of the center of the peak, and c controls the width of the "bell".

Gaussian functions are widely used in statistics where they describe the normal distributions, in signal processing where they serve to define Gaussian filters, in image processing where two-dimensional Gaussians are used for Gaussian blurs, and in mathematics where they are used to solve heat equations and diffusion equations and to define the Weierstrass transform.

Contents

[hide]

[edit] Properties

Gaussian functions arise by applying the exponential function to a general quadratic function. The Gaussian functions are thus those functions whose logarithm is a quadratic function.

The parameter c is related to the full width at half maximum (FWHM) of the peak according to

\mathrm{FWHM} = 2 \sqrt{2 \ln(2)}\ c.

Alternatively, the parameter c can be interpreted by saying that the two inflection points of the function occur at x=b-c and x=b+c.

Gaussian functions are analytic, and their limit for x→±∞ is 0.

Gaussian functions are among those functions that are elementary but lack elementary antiderivatives; the integral of the Gaussian function is the error function. Nonetheless their improper integrals over the whole real line can be evaluated exactly, using the Gaussian integral

\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt{\pi}

and one obtains

\int_{-\infty}^\infty a e^{- { (x-b)^2 \over 2 c^2 } }\,dx=ac\cdot\sqrt{2\pi}

This integral is 1 if and only if a = 1/(c√(2π)), and in this case the Gaussian is the probability density function of a normally distributed random variable with expected value μ=b and variance σ2=c2. These Gaussians are graphed in the accompanying figure.

Taking the Fourier transform of a Gaussian function with parameters a, b=0 and c yields another Gaussian function, with parameters ac, b=0 and 1/c. So in particular the Gaussian functions with b=0 and c=1 are kept fixed by the Fourier transform (they are eigenfunctions of the Fourier transform with eigenvalue 1).

The product of two Gaussian functions is again a Gaussian, and the convolution of two Gaussian functions is again a Gaussian.

[edit] Two-dimensional Gaussian function

Gaussian curve with a 2-dimensional domain
Gaussian curve with a 2-dimensional domain

A particular example of a two-dimensional Gaussian function is

f(x,y) = A e^{- \left(\frac{(x-x_o)^2}{2\sigma_x^2} + \frac{(y-y_o)^2}{2\sigma_y^2} \right)}.

Here the coefficient A is the amplitude, xo,yo is the center and σx, σy are the x and y spreads of the blob. The figure on the left was created using A = 1, xo = 0, yo = 0, σx = σy = 1.

In general, a two-dimensional Gaussian function is expressed as

f(x,y) = A e^{- \left(a(x - x_o)^2 + 2b(x-x_o)(y-y_o) + c(y-y_o)^2 \right)}

where the matrix

\left[\begin{matrix} a & b \\ b & c \end{matrix}\right]

is positive-definite.

Using this formulation, the figure on the left can be created using A = 1, (xo, yo) = (0, 0), a = c = 1, b = 0.

[edit] Meaning of parameters for the general equation

For the general form of the equation the coefficient A is the height of the peak and (xoyo) is the center of the blob.

If we set

a = \frac{\cos^2\theta}{2\sigma_x^2} + \frac{\sin^2\theta}{2\sigma_y^2}


b = -\frac{\sin2\theta}{4\sigma_x^2} + \frac{\sin2\theta}{4\sigma_y^2}


c = \frac{\sin^2\theta}{2\sigma_x^2} + \frac{\cos^2\theta}{2\sigma_y^2}

then we rotate the blob by an angle θ. This can be seen in the following examples:

θ = 0
θ = 0
θ = π / 6
θ = π / 6
θ = π / 3
θ = π / 3

Using the following MATLAB code one can see the effect of changing the parameters easily

A = 1;
x0 = 0; y0 = 0;
 
sigma_x = 1;
sigma_y = 2;
 
for theta = 0:pi/100:pi
a = cos(theta)^2/2/sigma_x^2 + sin(theta)^2/2/sigma_y^2;
b = -sin(2*theta)/4/sigma_x^2 + sin(2*theta)/4/sigma_y^2 ;
c = sin(theta)^2/2/sigma_x^2 + cos(theta)^2/2/sigma_y^2;
 
[X, Y] = meshgrid(-5:.1:5, -5:.1:5);
Z = A*exp( - (a*(X-x0).^2 + 2*b*(X-x0).*(Y-y0) + c*(Y-y0).^2)) ;
surf(X,Y,Z);shading interp;view(-36,36);axis equal;drawnow
end

Such functions are often used in image processing and in computational models of visual system function -- see the articles on scale space and affine shape adaptation.

Also see multivariate normal distribution.

[edit] Applications

Gaussian functions appear in many contexts in the natural sciences, the social sciences, mathematics, and engineering. Some examples include:

[edit] See also

[edit] External links