BANDPASS_FILTER
Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also
The BANDPASS_FILTER function applies a bandpass filter to a one-channel image.
A bandpass filter is useful when the general location of the noise in the frequency domain is known. The bandpass filter allows frequencies within the chosen range through and attenuates frequencies outside of the given range.
The following diagrams give a visual interpretation of the transfer functions:

This routine is written in the IDL language. Its source code can be found in the file bandpass_filter.pro in the lib subdirectory of the IDL distribution.
Syntax
Result = BANDPASS_FILTER( ImageData, LowFreq, HighFreq [, /IDEAL] [, BUTTERWORTH=value] [, /GAUSSIAN] )
Return Value
Returns a filtered image array of the same dimensions and type as ImageData.
Arguments
ImageData
A two-dimensional array containing the pixel values of the input image.
LowFreq
The lower limit of the pass-through frequency band. This value should be between 0 and 1 (inclusive), and must be less than HighFreq.
HighFreq
The upper limit of the pass-through frequency band. This value should be between 0 and 1 (inclusive), and must be greater than LowFreq.
Keywords
IDEAL
Set this keyword to use an ideal bandpass filter. In ideal bandpass filters, frequencies within the given range are passed through without attenuation and frequencies outside of the given range are completely removed. This behavior makes ideal bandpass filters very sharp.
In the previous diagram, the centered Fast Fourier Transform (FFT) is filtered by the following function, where DL is the lower bound of the frequency band, DH is the upper bound of the frequency band, and D(u,v) is the distance between a point (u,v) in the frequency domain and the center of the frequency rectangle:

BUTTERWORTH
Set this keyword to the dimension of the Butterworth filter to apply to the frequency domain. With a Butterworth bandpass filter, frequencies at the center of the frequency band are unattenuated and frequencies at the edge of the band are attenuated by a fraction of the maximum value. The Butterworth filter does not have sharp discontinuities between frequencies that are passed and filtered.
Note
A low Butterworth dimension is close to Gaussian, and a high Butterworth dimension is close to Ideal.
In the previous diagram, the centered FFT is filtered by the following function, where D0 is the center of the frequency band, W is the width of the frequency band, D(u,v) is the distance between a point (u,v) in the frequency domain and the center of the frequency rectangle, and n is the dimension of the Butterworth filter:

Note
As n → ∞, the Butterworth filter approaches the Ideal filter.
GAUSSIAN
Set this keyword to use a Gaussian bandpass filter. In this type of filter, the transition between unfiltered and filtered frequencies is very smooth.
In the previous diagram, the centered FFT is filtered by the following function, where D0 is the center of the frequency band, W is the width of the frequency band, and D(u,v) is the distance between a point (u,v) in the frequency domain and the center of the frequency rectangle:

Examples
In the following example, we add some sinusoidal noise to an image and filter it with BANDPASS_FILTER, using the BUTTERWORTH keyword.

Figure 4-1: Filtered Image using BANDPASS_FILTER, /BUTTERWORTH
Version History
See Also
"Overview of Image Processing" (Image Processing in IDL), MEAN_FILTER, ESTIMATOR_FILTER, BANDREJECT_FILTER, WIENER_FILTER, LEAST_SQUARES_FILTER