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]
Mathematically, a Gaussian filter modifies the input signal by convolution with a Gaussian function; this transformation is also known as the Weierstrass transform.
The one-dimensional Gaussian filter has an impulse response given by
g(x)=\sqrt{
a | |
\pi |
\hatg(f)=
-\pi2f2/a | |
e |
f
g(x)=
1 | |
\sqrt{2\pi |
-x2/(2\sigma2) | |
\sigma}e |
\hatg(f)=
| |||||||
e |
a
\sigma
g(x)
\sigmaf
\hatg(f)
\sigma\sigma | ||||
|
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:
g(x,y)=
1 | |
2\pi\sigma2 |
-(x2+y2)/(2\sigma2) | |
e |
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.
The Gaussian transfer function polynomials may be synthesized using a Taylor series expansion of the square of Gaussian function of the form
-a\omega2 | |
\epsilon |
a
-a\omega2 | |
\epsilon |
=\sqrt{1/2}
\omega=1
a
a=-log(\sqrt{1/2})
a
a=log(10(|dB|/20))
To meet all above criteria,
F(\omega)
F(\omega)=
-a\omega2 | |
\epsilon |
-a\omega2 | |
\sqrt{(\epsilon |
| ||||||||
) |
To complete the transfer function,
2a\omega2 | |
\epsilon |
2a\omega2 | |
\epsilon |
2a\omega2 | |
\epsilon |
=
infty | |
\sum | |
k=0 |
(2a)k\omega2k | |
k! |
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.
FN(\omega)=\sqrt{
1 | ||||||||||||
|
For the frequency axis,
\omega
j\omega
FN(j\omega)=\sqrt{
1 | ||||||||||||
|
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.
A 3rd order Gaussian filter with a -3.010 dB cutoff attenuation at
\omega
2) | |
F | |
3((j\omega) |
=
1 | |
1.33333a3(j\omega)6+2a2(j\omega4)+2a(j\omega)2+1 |
=
1 | |
-1.33333a3\omega6+2a2\omega4-2a\omega2+1 |
Absorbing
a
F3(j\omega)=
1 | |
0.2355931(j\omega)3+1.0078328(j\omega)2+1.6458471(j\omega)+1 |
A quick sanity check of evaluating
|F3(j)|
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 ant the lower and mid frequencies, and then switch to a higher steepness Chebyshev attenuation at the higher frequencies.
The Gaussian function is for
x\in(-infty,infty)
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
\sigmat ⋅ \sigma
|
fc=\sigmaf=
1 | |
2\pi\sigmat |
\sigmat
fc=
Fs | |
2\pi\sigmat |
Fs
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).For an arbitrary cut-off value 1/c for the response of the filter, the cut-off frequency is given by
fc=\sqrt{2ln(c)} ⋅ \sigmaf
A simple moving average corresponds to a uniform probability distribution and thus its filter width of size
n
\sqrt{(n2-1)/12}
m
{n}1,...,{n}m
\sigma=\sqrt{
| |||||||
12 |
A gaussian kernel requires
6\sigmat-1
{\sigmat}
{\sqrt{2}}
{\sigmat}
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.