↑ arvau

Wikipedia / Gaussian filter

In electronics and signal processing, mainly in digital signal processing, a Gaussian filter is a filter whose impulse response is a Gaussian function (or an approximation to it, since a true Gaussian response would have infinite impulse response). 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. 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. These properties are important in areas such as oscilloscopes and digital telecommunication systems.

Mathematically, a Gaussian filter modifies the input signal by convolution with a Gaussian function; this transformation is also known as the Weierstrass transform.

Definition

The one-dimensional Gaussian filter has an impulse response given by

and the frequency response is given by the Fourier transform

the ordinary frequency. These equations can also be expressed with the standard deviation as parameter

and the frequency response is given by

it can be shown that the product of the standard deviation and the standard deviation in the frequency domain is given by

  1. ,

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:

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 of the Gaussian distribution.

Synthesizing Gaussian filter polynomials

The Gaussian transfer function polynomials may be synthesized using a Taylor series..

must be of the form obtained below, with no stop band zeros,

may be approximated with a Taylor Series 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.

.

Since only half the poles are located in the left half plane (a Hurwitz polynomial), selecting only those poles to build the transfer function also serves to square root the equation, as is seen above.

Simple 3rd order example

in the Taylor series to produce the squared Gaussian function.

into the coefficients, factoring using a root finding algorithm cutoff attenuation.

. 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

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; see scale space implementation for details.

Filtering involves convolution. 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 that is produced by sampling points from the continuous Gaussian. An alternate method is to use the discrete Gaussian kernel which has superior characteristics for some purposes. Unlike the sampled Gaussian kernel, the discrete Gaussian kernel is the solution to the discrete diffusion equation.

When applied in two dimensions, a Gaussian filter kernel consists of a Gaussian surface that has a maximum at the origin, whose contourss are concentric circles with the origin as center. A two-dimensional convolution matrix can be precomputed from the formula and convolved with two-dimensional data. Each element in the resultant matrix new value is set to a weighted average 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.

Fast Fourier transform

The convolution theorem allows the fast convolution with an arbitrary discrete filter kernel using the Fast Fourier transform (FFT), and can be applied for Gaussian filtering. Since the Fourier transform of the Gaussian function yields a Gaussian function (of inverse width with respect to the spatial kernel), the signal can be Fourier-transformed, multiplied with a Gaussian function and transformed back. This is the standard procedure of applying an arbitrary finite impulse response filter, with the only difference being that the Fourier transform of the filter window is explicitly known. When the Gaussian kernel size is much smaller than the signal length, the operation can be sped-up by processing overlapping windowed blocks independently.

Special adaptions exist for the fast convolution in case of the symmetric Gaussian filter for certain boundary conditions. The general FFT-filtering may be sped up by employing a discrete cosine transform or similar.

Repeated box filtering

Due to the central limit theorem (from statistics), the Gaussian can be approximated by several runs of a very simple filter such as the moving average. The simple moving average corresponds to convolution with the constant B-spline (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 deviations (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 cutoff frequency of a Gaussian filter might be defined by the standard deviation in the frequency domain:

is measured in samples, the cutoff frequency (in physical units) can be calculated with

.

However, it is more common to define the cutoff frequency as the half-power point in the amplitude spectrum (see e.g. Butterworth filter for the response of the filter, the cutoff frequency is given by

, which is half the Full Width at Half Maximum (FWHM) (see Gaussian function.

A simple moving average corresponds to a uniform probability distribution yield a standard deviation of

(Note that standard deviations do not sum up, but variances do.)

. In practice, a sufficiently good approximation to a Gaussian convolution is achieved with three to five passes.

Recursive filters

There exist several recursive infinite-impulse-response (IIR) filters that approximate a Gaussian filter. Such filters step through the discrete signal in one or few passes, and compute the filter response from a linear combination of the current sample and the filter output of previous samples. This is computationally efficient, because only a small number of arithmetic operations are performed for each sample. However, when parallel processing is available, these methods will exhibit large latency because all samples have to be computed sequentially.

. This makes the ideal 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.

A popular recursive filter is the Deriche-filter. This filter consists of two parallel passes on the original data, one "causal" pass from left to right, and an anti-causal pass from right to left. The results of these two passes are added to obtain the result.

Another popular choice is the Young/val Vliet-filter. That filter consists of two subsequent passes in opposite directions. The first pass operates on the input data, while the second (backward) pass operates on the produced intermediate data. Therefore, the Young/van Vliet-filter can operate in-place.

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: 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 detectors.

  • 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: 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: In medical imaging techniques such as MRI and CT scans, Gaussian filters enhance image quality by reducing noise, thereby aiding in clearer diagnosis and analysis.

  • Graphics 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: 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 since it applies GMSK modulation

  • The Gaussian filter is also used in GFSK.

  • Canny Edge Detector used in image processing.

See also

References