Gaussian filter

Last updated
Shape of the impulse response of a typical Gaussian filter Gaussian Filter.svg
Shape of the impulse response of a typical 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 [1] and digital telecommunication systems. [2]

Contents

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

with the ordinary frequency. These equations can also be expressed with the standard deviation 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:

[3] [4] [5]

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 expansion of the square of Gaussian function of the form where is set such that (equivalent of -3.01dB) at . [6] 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. [6]

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, 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 [7] [8] ..

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. [6]

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. [9] 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. [9]

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; 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 [10] which has superior characteristics for some purposes. Unlike the sampled Gaussian kernel, the discrete Gaussian kernel is the solution to the discrete diffusion equation.

Since the Fourier transform 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, 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.

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 cut-off frequency 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/2 ≈ 0.707 in the amplitude spectrum (see e.g. Butterworth filter). For an arbitrary cut-off value 1/c for the response of the filter, the cut-off frequency is given by

[11]

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). For c = 2 this constant equals approximately 0.8326. These values are quite close to 1.

A simple moving average corresponds to a uniform probability distribution 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 variances 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 contours are concentric circles with the origin as center. A two-dimensional convolution matrix 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 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.

The Gaussian filter is non-causal, which means the filter window is symmetric about the origin in the time domain. 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

See also

Related Research Articles

In engineering, a transfer function of a system, sub-system, or component is a mathematical function that models the system's output for each possible input. It is widely used in electronic engineering tools like circuit simulators and control systems. In simple cases, this function can be represented as a two-dimensional graph of an independent scalar input versus the dependent scalar output. Transfer functions for components are used to design and analyze systems assembled from components, particularly using the block diagram technique, in electronics and control theory.

<span class="mw-page-title-main">Uncertainty principle</span> Foundational principle in quantum physics

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 and momentum, can be simultaneously known. In other words, the more accurately one property is measured, the less accurately the other property can be known.

The propagation constant of a sinusoidal electromagnetic wave is a measure of the change undergone by the amplitude and phase of the wave as it propagates in a given direction. The quantity being measured can be the voltage, the current in a circuit, or a field vector such as electric field strength or flux density. The propagation constant itself measures the dimensionless change in magnitude or phase per unit length. In the context of two-port networks and their cascades, propagation constant measures the change undergone by the source quantity as it propagates from one port to the next.

In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form and with parametric extension for arbitrary real constants a, b and non-zero c. It is named after the mathematician Carl Friedrich Gauss. The graph of a Gaussian is a characteristic symmetric "bell curve" shape. 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".

Chebyshev filters are analog or digital filters that have a steeper roll-off than Butterworth filters, and have either passband ripple or stopband ripple. Chebyshev filters have the property that they minimize the error between the idealized and the actual filter characteristic over the operating frequency range of the filter, but they achieve this with ripples in the passband. This type of filter is named after Pafnuty Chebyshev because its mathematical characteristics are derived from Chebyshev polynomials. Type I Chebyshev filters are usually referred to as "Chebyshev filters", while type II filters are usually called "inverse Chebyshev filters". Because of the passband ripple inherent in Chebyshev filters, filters with a smoother response in the passband but a more irregular response in the stopband are preferred for certain applications.

<span class="mw-page-title-main">Wave packet</span> Short "burst" or "envelope" of restricted wave action that travels as a unit

In physics, a wave packet is a short burst of localized wave action that travels as a unit, outlined by an envelope. A wave packet can be analyzed into, or can be synthesized from, a potentially-infinite set of component sinusoidal waves of different wavenumbers, with phases and amplitudes such that they interfere constructively only over a small region of space, and destructively elsewhere. Any signal of a limited width in time or space requires many frequency components around a center frequency within a bandwidth inversely proportional to that width; even a gaussian function is considered a wave packet because its Fourier transform is a "packet" of waves of frequencies clustered around a central frequency. Each component wave function, and hence the wave packet, are solutions of a wave equation. Depending on the wave equation, the wave packet's profile may remain constant or it may change while propagating.

<span class="mw-page-title-main">Drude model</span> Model of electrical conduction

The Drude model of electrical conduction was proposed in 1900 by Paul Drude to explain the transport properties of electrons in materials. Basically, Ohm's law was well established and stated that the current J and voltage V driving the current are related to the resistance R of the material. The inverse of the resistance is known as the conductance. When we consider a metal of unit length and unit cross sectional area, the conductance is known as the conductivity, which is the inverse of resistivity. The Drude model attempts to explain the resistivity of a conductor in terms of the scattering of electrons by the relatively immobile ions in the metal that act like obstructions to the flow of electrons.

<span class="mw-page-title-main">Reproducing kernel Hilbert space</span> In functional analysis, a Hilbert space

In functional analysis, a reproducing kernel Hilbert space (RKHS) is a Hilbert space of functions in which point evaluation is a continuous linear functional. Roughly speaking, this means that if two functions and in the RKHS are close in norm, i.e., is small, then and are also pointwise close, i.e., is small for all . The converse does not need to be true. Informally, this can be shown by looking at the supremum norm: the sequence of functions converges pointwise, but does not converge uniformly i.e. does not converge with respect to the supremum norm.

Plasma oscillations, also known as Langmuir waves, are rapid oscillations of the electron density in conducting media such as plasmas or metals in the ultraviolet region. The oscillations can be described as an instability in the dielectric function of a free electron gas. The frequency depends only weakly on the wavelength of the oscillation. The quasiparticle resulting from the quantization of these oscillations is the plasmon.

In statistics, econometrics, and signal processing, an autoregressive (AR) model is a representation of a type of random process; as such, it can be used to describe certain time-varying processes in nature, economics, behavior, etc. The autoregressive model specifies that the output variable depends linearly on its own previous values and on a stochastic term ; thus the model is in the form of a stochastic difference equation which should not be confused with a differential equation. Together with the moving-average (MA) model, it is a special case and key component of the more general autoregressive–moving-average (ARMA) and autoregressive integrated moving average (ARIMA) models of time series, which have a more complicated stochastic structure; it is also a special case of the vector autoregressive model (VAR), which consists of a system of more than one interlocking stochastic difference equation in more than one evolving random variable.

In mathematics, the stationary phase approximation is a basic principle of asymptotic analysis, applying to functions given by integration against a rapidly-varying complex exponential.

<span class="mw-page-title-main">Gaussian blur</span> Type of image blur produced by a Gaussian function

In image processing, a Gaussian blur is the result of blurring an image by a Gaussian function.

An elliptic filter is a signal processing filter with equalized ripple (equiripple) behavior in both the passband and the stopband. The amount of ripple in each band is independently adjustable, and no other filter of equal order can have a faster transition in gain between the passband and the stopband, for the given values of ripple. Alternatively, one may give up the ability to adjust independently the passband and stopband ripple, and instead design a filter which is maximally insensitive to component variations.

In probability theory, calculation of the sum of normally distributed random variables is an instance of the arithmetic of random variables.

<span class="mw-page-title-main">Gabor transform</span>

The Gabor transform, named after Dennis Gabor, is a special case of the short-time Fourier transform. It is used to determine the sinusoidal frequency and phase content of local sections of a signal as it changes over time. The function to be transformed is first multiplied by a Gaussian function, which can be regarded as a window function, and the resulting function is then transformed with a Fourier transform to derive the time-frequency analysis. The window function means that the signal near the time being analyzed will have higher weight. The Gabor transform of a signal x(t) is defined by this formula:

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 of scale. A special type of scale-space representation is provided by the Gaussian scale space, where the image data in N dimensions is subjected to smoothing by Gaussian convolution. Most of the theory for Gaussian scale space deals with continuous images, whereas one when implementing this theory will have to face the fact that most measurement data are discrete. Hence, the theoretical problem arises concerning how to discretize the continuous theory while either preserving or well approximating the desirable theoretical properties that lead to the choice of the Gaussian kernel. This article describes basic approaches for this that have been developed in the literature, see also for an in-depth treatment regarding the topic of approximating the Gaussian smoothing operation and the Gaussian derivative computations in scale-space theory.

<span class="mw-page-title-main">Skew normal distribution</span> Probability distribution

In probability theory and statistics, the skew normal distribution is a continuous probability distribution that generalises the normal distribution to allow for non-zero skewness.

<span class="mw-page-title-main">Superradiant phase transition</span> Process in quantum optics

In quantum optics, a superradiant phase transition is a phase transition that occurs in a collection of fluorescent emitters, between a state containing few electromagnetic excitations and a superradiant state with many electromagnetic excitations trapped inside the emitters. The superradiant state is made thermodynamically favorable by having strong, coherent interactions between the emitters.

The Frenkel–Kontorova (FK) model is a fundamental model of low-dimensional nonlinear physics.

<span class="mw-page-title-main">Brendel–Bormann oscillator model</span>

The Brendel–Bormann oscillator model is a mathematical formula for the frequency dependence of the complex-valued relative permittivity, sometimes referred to as the dielectric function. The model has been used to fit to the complex refractive index of materials with absorption lineshapes exhibiting non-Lorentzian broadening, such as metals and amorphous insulators, across broad spectral ranges, typically near-ultraviolet, visible, and infrared frequencies. The dispersion relation bears the names of R. Brendel and D. Bormann, who derived the model in 1992, despite first being applied to optical constants in the literature by Andrei M. Efimov and E. G. Makarova in 1983. Around that time, several other researchers also independently discovered the model. The Brendel-Bormann oscillator model is aphysical because it does not satisfy the Kramers–Kronig relations. The model is non-causal, due to a singularity at zero frequency, and non-Hermitian. These drawbacks inspired J. Orosco and C. F. M. Coimbra to develop a similar, causal oscillator model.

References

  1. Orwiler, Bob (1969). Oscilloscope Vertical Amplifiers (PDF) (1 ed.). Beaverton, Oregon: Tektronix Circuit Concepts. Archived (PDF) from the original on 14 October 2011. Retrieved 17 November 2022.
  2. Andrews, James R (1999). "Low-Pass Risetime Filters for Time Domain Applications" (PDF). kh6htv.com. Picosecond Pulse Labs. Archived (PDF) from the original on 21 July 2016. Retrieved 17 November 2022.
  3. 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.
  4. Shapiro, L. G. & Stockman, G. C: "Computer Vision", page 137, 150. Prentence Hall, 2001
  5. Mark S. Nixon and Alberto S. Aguado. Feature Extraction and Image Processing. Academic Press, 2008, p. 88.
  6. 1 2 3 Zverev, Anatol I. (1967). Handbook of Filter Synthesis. New York, Chichester, Brisbane, Toronto, Singapore: John Wiley & Sons, Inc. pp. 70, 71. ISBN   0 471 98680 1.{{cite book}}: CS1 maint: date and year (link)
  7. Dr. Byron Bennett's filter design lecture notes, 1985, Montana State University, EE Department, Bozeman, Montana, US
  8. Sedra, Adel S.; Brackett, Peter O. (1978). Filter Theory and Design: Active and Passive. Beaverton, Oegon, US: Matrix Publishers, Inc. pp. 45–73. ISBN   978-0916460143.{{cite book}}: CS1 maint: date and year (link)
  9. 1 2 Williams, Arthur Bernard; Taylor, Fred J. (1995). Electronic Filter Design Handbook (3rd ed.). US: McGraw-Hill, Inc. pp. 2.56, 2.65, 11.62. ISBN   0-07-070441-4.
  10. Lindeberg, T., "Scale-space for discrete signals," PAMI(12), No. 3, March 1990, pp. 234–254.
  11. Stefano Bottacchi, Noise and Signal Interference in Optical Fiber Transmission Systems, p. 242, John Wiley & Sons, 2008 ISBN   047051681X