Signal Processing Toolbox
firgauss

Design a FIR Gaussian digital filter

Syntax

• ```b = firgauss(k,n)
[b,n] = firgauss(k,`'minorder'`,v)
```

Description

Gaussian filters are important in many signal processing, image processing, and communication applications. These filters are characterized by narrow bandwidths, sharp cutoffs, and low overshoots. A key feature of Gaussian filters is that the Fourier transform of a Gaussian is also a Gaussian, so the filter has the same response shape in both the time and frequency domains.

```b = firgauss(k,n) ``` returns an FIR filter whose impulse response approximates an ideal zero-mean Gaussian. Filters with this type of impulse response act as lowpass filters. The implementation of this filter is a cascade of `k` boxcar (uniform-coefficient) filters of integer length `n`. Increasing the number of cascades, `k`, or the length of each boxcar, `n`, produces a closer approximation to an ideal Gaussian. The filter is returned in vector `b`.

A 1-D Gaussian or Normal density function is defined as

where , is the standard deviation, and µ is the mean.

A measure of how well a lowpass filter rejects frequencies outside its passband is the ratio of the highest sidelobe level (HSSL) to the DC response . For `firgauss`, the HSSL is approximately -13.3 dB * `k`, where `k` is the number of cascaded filters, so for a cascade of four boxcars, the HSSL is -53 dB.

```[b,n] = firgauss(k,'minorder',v) ``` returns a Gaussian filter with variance, `v`. The variance is the sum of the variances of the convolutions of the individual boxcar filters. The required `'minorder'` flag causes `firgauss` to use the minimum length, `n`, to achieve the overall variance. When `k` >= `4`, `firgauss` uses an optimization to determine the minimum length for each of the boxcar filters. This optimization produces an approximation to the ideal Gaussian impulse response that is minimal in the root mean square (rms) sense.

Examples

Example 1

Create an FIR Gaussian filter that is a cascade of 4 boxcar filters, each of length 32 and display the result in `fvtool`:

• ```k=4;
n=32;
b=firgauss(k,n);
fvtool(b);

```

Example 2

Create another FIR Gaussian filter that is a cascade of eight filters, each of length 32 and view both this filter and the filter from Example 1 in `fvtool` and display the impulse responses:

• ```k1=4;
n=32;
b1=firgauss(k1,n);
fvtool(b1,1)
k2=8;
b2=firgauss(k2,n);
fvtool(b2,1);

```

Algorithm

The implementation of `firgauss` uses the Central Limit Theorem (CLT). This theorem states that under general conditions, if X is the sum of N independent random variables with mean µ and variance , increasing N causes the distribution of X to tend to a normal (Gaussian) with the same mean and variance. In terms of convolutions, the CLT states that the convolution of a large number of positive functions is apporximately a normal (Gaussian) function. `firgauss` convolves boxcar filters, which are positive functions with uniform coefficients.

`dfilt`, `dfilt.cascade`, `gausswin`, `gauspuls`, `gmonopuls`