
In
electronics
Electronics is a scientific and engineering discipline that studies and applies the principles of physics to design, create, and operate devices that manipulate electrons and other Electric charge, electrically charged particles. It is a subfield ...
and
signal processing
Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, Scalar potential, potential fields, Seismic tomograph ...
, mainly in
digital signal processing
Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner are a ...
, a Gaussian filter is a
filter whose
impulse response
In signal processing and control theory, the impulse response, or impulse response function (IRF), of a dynamic system is its output when presented with a brief input signal, called an impulse (). More generally, an impulse response is the reac ...
is a
Gaussian function
In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function (mathematics), function of the base form
f(x) = \exp (-x^2)
and with parametric extension
f(x) = a \exp\left( -\frac \right)
for arbitrary real number, rea ...
(or an approximation to it, since a true Gaussian response would have
infinite impulse response
Infinite impulse response (IIR) is a property applying to many linear time-invariant systems that are distinguished by having an impulse response h(t) that does not become exactly zero past a certain point but continues indefinitely. This is in ...
). Gaussian filters have the properties of having no
overshoot to a step function input while minimizing the rise and fall time. This behavior is closely connected to the fact that the Gaussian filter has the minimum possible
group delay
In signal processing, group delay and phase delay are functions that describe in different ways the delay times experienced by a signal’s various sinusoidal frequency components as they pass through a linear time-invariant (LTI) system (such as ...
. A Gaussian filter will have the best combination of suppression of high frequencies while also minimizing spatial spread, being the critical point of the
uncertainty principle
The uncertainty principle, also known as Heisenberg's indeterminacy principle, is a fundamental concept in quantum mechanics. It states that there is a limit to the precision with which certain pairs of physical properties, such as position a ...
. These properties are important in areas such as
oscilloscopes
An oscilloscope (formerly known as an oscillograph, informally scope or O-scope) is a type of electronic test instrument that graphically displays varying voltages of one or more signals as a function of time. Their main purpose is capturing ...
and digital telecommunication systems.
Mathematically, a Gaussian filter modifies the input signal by
convolution
In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
with a
Gaussian function
In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function (mathematics), function of the base form
f(x) = \exp (-x^2)
and with parametric extension
f(x) = a \exp\left( -\frac \right)
for arbitrary real number, rea ...
; this transformation is also known as the
Weierstrass transform
In mathematics, the Weierstrass transform of a function f : \mathbb\to \mathbb, named after Karl Weierstrass, is a "smoothed" version of f(x) obtained by averaging the values of f, weighted with a Gaussian centered at x.
Specifically, it is the ...
.
Definition
The one-dimensional Gaussian filter has an impulse response given by
:
and the frequency response is given by the
Fourier transform
In mathematics, the Fourier transform (FT) is an integral transform that takes a function as input then outputs another function that describes the extent to which various frequencies are present in the original function. The output of the tr ...
:
with
the ordinary frequency. These equations can also be expressed with the
standard deviation
In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its Expected value, mean. A low standard Deviation (statistics), deviation indicates that the values tend to be close to the mean ( ...
as parameter
:
and the frequency response is given by
:
By writing
as a function of
with the two equations for
and as a function of
with the two equations for
it can be shown that the product of the standard deviation and the standard deviation in the frequency domain is given by
:
,
where the standard deviations are expressed in their physical units, e.g. in the case of time and frequency in seconds and hertz, respectively.
In two dimensions, it is the product of two such Gaussians, one per direction:
:
[R.A. Haddad and A.N. Akansu,]
A Class of Fast Gaussian Binomial Filters for Speech and Image Processing
" IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 39, pp 723–727, March 1991.[ Shapiro, L. G. & Stockman, G. C: "Computer Vision", page 137, 150. Prentence Hall, 2001][Mark S. Nixon and Alberto S. Aguado. ''Feature Extraction and Image Processing''. Academic Press, 2008, p. 88.]
where ''x'' is the distance from the origin in the horizontal axis, ''y'' is the distance from the origin in the vertical axis, and ''σ'' is the
standard deviation
In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its Expected value, mean. A low standard Deviation (statistics), deviation indicates that the values tend to be close to the mean ( ...
of the Gaussian distribution.
Synthesizing Gaussian filter polynomials
The Gaussian
transfer function
In engineering, a transfer function (also known as system function or network function) of a system, sub-system, or component is a function (mathematics), mathematical function that mathematical model, models the system's output for each possible ...
polynomials
In mathematics, a polynomial is a mathematical expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication and exponentiation to nonnegative int ...
may be synthesized using a
Taylor series
In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor ser ...
expansion of the square of Gaussian function of the form
where
is set such that
(equivalent of -3.01 dB) at
.
The value of
may be calculated with this constraint to be
, or 0.34657359 for an approximate -3.010 dB cutoff attenuation. If an attenuation of other than -3.010 dB is desired,
may be recalculated using a different attenuation,
.
To meet all above criteria,
must be of the form obtained below, with no stop band zeros,
To complete the transfer function,
may be approximated with a Taylor Series expansion about 0. The full Taylor series for
is shown below.
The ability of the filter to simulate a true Gaussian function depends on how many terms are taken from the series. The number of terms taken beyond 0 establishes the order N of the filter.
For the frequency axis,
is replace with
.
Since only half the poles are located in the left half plane, selecting only those poles to build the transfer function also serves to square root the equation, as is seen above.
Simple 3rd order example
A 3rd order Gaussian filter with a -3.010 dB cutoff attenuation at
= 1 requires the use of terms k=0 to k=3 in the Taylor series to produce the squared Gaussian function.
Absorbing
into the coefficients, factoring using a
root finding algorithm
In numerical analysis, a root-finding algorithm is an algorithm for finding zeros, also called "roots", of continuous functions. A zero of a function is a number such that . As, generally, the zeros of a function cannot be computed exactly nor e ...
, and building the polynomials using only the left half plane poles yields the transfer function for a third order Gaussian filter with the required -3.010 dB cutoff attenuation
[Dr. Byron Bennett's](_blank)
filter design lecture notes, 1985
Montana State University
EE Department
Bozeman
Bozeman ( ) is a city in and the county seat of Gallatin County, Montana, United States. The 2020 United States census put Bozeman's population at 53,293, making it Montana's fourth-largest city. It is the principal city of the Bozeman, Montan ...
, Montana, US..
A quick sanity check of evaluating
yields a magnitude of -2.986 dB, which represents an error of only ~0.8% from the desired -3.010 dB. This error will decrease as the number of orders increases. In addition, the error at higher frequencies will be more pronounced for all Gaussian filters, bug will also decrease as the order of the filter increases.
Gaussian Transitional Filters
Although Gaussian filters exhibit desirable group delay, as described in the opening description, the steepness of the cutoff attenuation may be less than desired.
To work around this, tables have been developed and published that preserve the desirable Gaussian group delay response and the lower and mid frequencies, but switches to a higher steepness Chebyshev attenuation at the higher frequencies.
Digital implementation
The Gaussian function is for
and would theoretically require an infinite window length. However, since it decays rapidly, it is often reasonable to truncate the filter window and implement the filter directly for narrow windows, in effect by using a simple rectangular window function. In other cases, the truncation may introduce significant errors. Better results can be achieved by instead using a different
window function
In signal processing and statistics, a window function (also known as an apodization function or tapering function) is a mathematical function that is zero-valued outside of some chosen interval. Typically, window functions are symmetric around ...
; see
scale space implementation
In the areas of computer vision, image analysis and signal processing, the notion of scale-space representation is used for processing measurement data at multiple scales, and specifically enhance or suppress image features over different ranges o ...
for details.
Filtering involves
convolution
In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
. The filter function is said to be the kernel of an integral transform. The Gaussian kernel is continuous. Most commonly, the discrete equivalent is the
sampled Gaussian kernel
In the areas of computer vision, image analysis and signal processing, the notion of scale-space representation is used for processing measurement data at multiple scales, and specifically enhance or suppress image features over different ranges o ...
that is produced by sampling points from the continuous Gaussian. An alternate method is to use the
discrete Gaussian kernel
In the areas of computer vision, image analysis and signal processing, the notion of scale-space representation is used for processing measurement data at multiple scales, and specifically enhance or suppress image features over different ranges o ...
[Lindeberg, T., "Scale-space for discrete signals," PAMI(12), No. 3, March 1990, pp. 234–254.](_blank)
/ref> which has superior characteristics for some purposes. Unlike the sampled Gaussian kernel, the discrete Gaussian kernel is the solution to the discrete diffusion equation
The diffusion equation is a parabolic partial differential equation. In physics, it describes the macroscopic behavior of many micro-particles in Brownian motion, resulting from the random movements and collisions of the particles (see Fick's l ...
.
Since the Fourier transform
In mathematics, the Fourier transform (FT) is an integral transform that takes a function as input then outputs another function that describes the extent to which various frequencies are present in the original function. The output of the tr ...
of the Gaussian function yields a Gaussian function, the signal (preferably after being divided into overlapping windowed blocks) can be transformed with a fast Fourier transform
A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). A Fourier transform converts a signal from its original domain (often time or space) to a representation in ...
, multiplied with a Gaussian function and transformed back. This is the standard procedure of applying an arbitrary finite impulse response
In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of ''finite'' duration, because it settles to zero in finite time. This is in contrast to infinite impuls ...
filter, with the only difference being that the Fourier transform of the filter window is explicitly known.
Due to the central limit theorem
In probability theory, the central limit theorem (CLT) states that, under appropriate conditions, the Probability distribution, distribution of a normalized version of the sample mean converges to a Normal distribution#Standard normal distributi ...
(from statistics
Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a s ...
), the Gaussian can be approximated by several runs of a very simple filter such as the moving average
In statistics, a moving average (rolling average or running average or moving mean or rolling mean) is a calculation to analyze data points by creating a series of averages of different selections of the full data set. Variations include: #Simpl ...
. The simple moving average corresponds to convolution
In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
with the constant B-spline
In numerical analysis, a B-spline (short for basis spline) is a type of Spline (mathematics), spline function designed to have minimal Support (mathematics), support (overlap) for a given Degree of a polynomial, degree, smoothness, and set of bre ...
(a rectangular pulse). For example, four iterations of a moving average yield a cubic B-spline as a filter window, which approximates the Gaussian quite well. A moving average is quite cheap to compute, so levels can be cascaded quite easily.
In the discrete case, the filter's standard deviation
In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its Expected value, mean. A low standard Deviation (statistics), deviation indicates that the values tend to be close to the mean ( ...
s (in the time and frequency domains) are related by
:
where the standard deviations are expressed in a number of samples and ''N'' is the total number of samples. The standard deviation of a filter can be interpreted as a measure of its size. The cut-off frequency
In physics and electrical engineering, a cutoff frequency, corner frequency, or break frequency is a boundary in a system's frequency response at which energy flowing through the system begins to be reduced ( attenuated or reflected) rather than ...
of a Gaussian filter might be defined by the standard deviation in the frequency domain:
:
where all quantities are expressed in their physical units. If is measured in samples, the cut-off frequency (in physical units) can be calculated with
:
where is the sample rate.
The response value of the Gaussian filter at this cut-off frequency equals exp(−0.5) ≈ 0.607.
However, it is more common to define the cut-off frequency as the half power point: where the filter response is reduced to 0.5 (−3 dB) in the power spectrum, or 1/ ≈ 0.707 in the amplitude spectrum (see e.g. Butterworth filter
The Butterworth filter is a type of signal processing filter designed to have a frequency response that is as flat as possible in the passband. It is also referred to as a maximally flat magnitude filter. It was first described in 1930 by the B ...
).
For an arbitrary cut-off value 1/''c'' for the response of the filter, the cut-off frequency is given by
:
For ''c'' = 2 the constant before the standard deviation in the frequency domain in the last equation equals approximately 1.1774, which is half the Full Width at Half Maximum (FWHM) (see Gaussian function
In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function (mathematics), function of the base form
f(x) = \exp (-x^2)
and with parametric extension
f(x) = a \exp\left( -\frac \right)
for arbitrary real number, rea ...
). For ''c'' = this constant equals approximately 0.8326. These values are quite close to 1.
A simple moving average corresponds to a uniform probability distribution
In probability theory and statistics, the continuous uniform distributions or rectangular distributions are a family of symmetric probability distributions. Such a distribution describes an experiment where there is an arbitrary outcome that lies ...
and thus its filter width of size has standard deviation . Thus the application of successive moving averages with sizes yield a standard deviation of
:
(Note that standard deviations do not sum up, but variance
In probability theory and statistics, variance is the expected value of the squared deviation from the mean of a random variable. The standard deviation (SD) is obtained as the square root of the variance. Variance is a measure of dispersion ...
s do.)
A gaussian kernel requires values, e.g. for a of 3, it needs a kernel of length 17. A running mean filter of 5 points will have a sigma of . Running it three times will give a of 2.42. It remains to be seen where the advantage is over using a gaussian rather than a poor approximation.
When applied in two dimensions, this formula produces a Gaussian surface that has a maximum at the origin, whose contour
Contour may refer to:
* Contour (linguistics), a phonetic sound
* Pitch contour
* Contour (camera system), a 3D digital camera system
* Contour Airlines
* Contour flying, a form of low level flight
* Contour, the KDE Plasma 4 interface for tab ...
s are concentric circles
In geometry, two or more objects are said to be ''concentric'' when they share the same center. Any pair of (possibly unalike) objects with well-defined centers can be concentric, including circles, spheres, regular polygons, regular polyhe ...
with the origin as center. A two-dimensional convolution
In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
matrix
Matrix (: matrices or matrixes) or MATRIX may refer to:
Science and mathematics
* Matrix (mathematics), a rectangular array of numbers, symbols or expressions
* Matrix (logic), part of a formula in prenex normal form
* Matrix (biology), the m ...
is precomputed from the formula and convolved with two-dimensional data. Each element in the resultant matrix new value is set to a weighted average
The weighted arithmetic mean is similar to an ordinary arithmetic mean (the most common type of average), except that instead of each of the data points contributing equally to the final average, some data points contribute more than others. The ...
of that element's neighborhood. The focal element receives the heaviest weight (having the highest Gaussian value), and neighboring elements receive smaller weights as their distance to the focal element increases. In Image processing, each element in the matrix represents a pixel attribute such as brightness or color intensity, and the overall effect is called Gaussian blur
In image processing, a Gaussian blur (also known as Gaussian smoothing) is the result of blurring an image by a Gaussian function (named after mathematician and scientist Carl Friedrich Gauss).
It is a widely used effect in graphics software, ...
.
The Gaussian filter is non-causal, which means the filter is not zero for all times . This makes the Gaussian filter physically unrealizable. This is usually of no consequence for applications where the filter bandwidth is much larger than the signal. In real-time systems, a delay is incurred because incoming samples need to fill the filter window before the filter can be applied to the signal. While no amount of delay can make a theoretical Gaussian filter causal (because the Gaussian function is non-zero everywhere), the Gaussian function converges to zero so rapidly that a causal approximation can achieve any required tolerance with a modest delay, even to the accuracy of floating point representation.
Applications
* Image Smoothing: The primary application of Gaussian filters is to reduce noise in images. By averaging pixel values with a weighted Gaussian distribution, the filter effectively blurs the image, diminishing high-frequency noise.
* Edge Detection
Edge or EDGE may refer to:
Technology Computing
* Edge computing, a network load-balancing system
* Edge device, an entry point to a computer network
* Adobe Edge, a graphical development application
* Microsoft Edge, a web browser developed b ...
: Gaussian filters are often used as a preprocessing step in edge detection algorithms. By smoothing the image, they help to minimize the impact of noise before applying methods like the Sobel or Canny edge detector
The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images. It was developed by John F. Canny in 1986. Canny also produced a ''computational theory of edge detection'' expla ...
s.
* Image Resizing: In image resizing tasks, Gaussian filters can prevent aliasing artifacts. Smoothing the image before downsampling ensures that the resulting image maintains better quality and visual fidelity.
* Computer Vision
Computer vision tasks include methods for image sensor, acquiring, Image processing, processing, Image analysis, analyzing, and understanding digital images, and extraction of high-dimensional data from the real world in order to produce numerical ...
: The use of Gaussian filters in computer vision is extensive, including applications in object detection, image segmentation, and feature extraction, where reducing noise is crucial for accurate analysis.
* Medical Imaging
Medical imaging is the technique and process of imaging the interior of a body for clinical analysis and medical intervention, as well as visual representation of the function of some organs or tissues (physiology). Medical imaging seeks to revea ...
: In medical imaging techniques such as MRI
Magnetic resonance imaging (MRI) is a medical imaging technique used in radiology to generate pictures of the anatomy and the physiological processes inside the body. MRI scanners use strong magnetic fields, magnetic field gradients, and rad ...
and CT scans, Gaussian filters enhance image quality by reducing noise, thereby aiding in clearer diagnosis and analysis.
* Graphics
Graphics () are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of the data, as in design and manufa ...
and Rendering: In computer graphics, Gaussian filters are used to create effects such as depth of field and motion blur, enhancing the realism of rendered scenes.
* Machine Learning
Machine learning (ML) is a field of study in artificial intelligence concerned with the development and study of Computational statistics, statistical algorithms that can learn from data and generalise to unseen data, and thus perform Task ( ...
: In the field of machine learning, particularly in convolutional neural networks (CNNs), Gaussian filters are employed for preprocessing images to improve the performance of models in tasks like image classification and object recognition. In defect detection, the filter can help emphasize certain defects for the model, thereby enhancing its detection performance.
* GSM
The Global System for Mobile Communications (GSM) is a family of standards to describe the protocols for second-generation (2G) digital cellular networks, as used by mobile devices such as mobile phones and Mobile broadband modem, mobile broadba ...
since it applies GMSK
In digital modulation, minimum-shift keying (MSK) is a type of continuous-phase frequency-shift keying that was developed in the late 1950s by Collins Radio employees Melvin L. Doelz and Earl T. Heald. Similar to OQPSK, MSK is encoded with bit ...
modulation
* The Gaussian filter is also used in GFSK.
* Canny Edge Detector
The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images. It was developed by John F. Canny in 1986. Canny also produced a ''computational theory of edge detection'' expla ...
used in image processing.
See also
* Butterworth filter
The Butterworth filter is a type of signal processing filter designed to have a frequency response that is as flat as possible in the passband. It is also referred to as a maximally flat magnitude filter. It was first described in 1930 by the B ...
* Comb filter
In signal processing, a comb filter is a Filter (signal processing), filter implemented by adding a delayed version of a signal processing, signal to itself, causing constructive and destructive Interference (wave propagation), interference. The ...
* Chebyshev filter
Chebyshev filters are analog filter, analog or digital filter, digital filters that have a steeper roll-off than Butterworth filters, and have either passband ripple (filters), ripple (type I) or stopband ripple (type II). Chebyshev filters have ...
* Discrete Gaussian kernel
In the areas of computer vision, image analysis and signal processing, the notion of scale-space representation is used for processing measurement data at multiple scales, and specifically enhance or suppress image features over different ranges o ...
* Elliptic filter
An elliptic filter (also known as a Cauer filter, named after Wilhelm Cauer, or as a Zolotarev filter, after Yegor Zolotarev) is a filter (signal processing), signal processing filter with equalized ripple (filters), ripple (equiripple) behavior ...
* Gaussian blur
In image processing, a Gaussian blur (also known as Gaussian smoothing) is the result of blurring an image by a Gaussian function (named after mathematician and scientist Carl Friedrich Gauss).
It is a widely used effect in graphics software, ...
* Gaussian pyramid
Pyramid, or pyramid representation, is a type of multi-scale signal representation developed by the computer vision, image processing and signal processing communities, in which a signal or an image is subject to repeated smoothing and subsamp ...
* Oriented energy filters
* Scale space
Scale-space theory is a framework for multi-scale signal representation developed by the computer vision, image processing and signal processing communities with complementary motivations from physics and biological vision. It is a formal the ...
* Scale space implementation
In the areas of computer vision, image analysis and signal processing, the notion of scale-space representation is used for processing measurement data at multiple scales, and specifically enhance or suppress image features over different ranges o ...
References
{{DEFAULTSORT:Gaussian Filter
Linear filters
Gaussian function