FILT_NOTCH Function
Generates a 2D ideal notch spatial frequency domain filter.
Usage
result = FILT_NOTCH(radius, xloc, yloc)
Input Parameters
radiusThe filter cutoff region radius, in pixels.
xlocThe x-location of the center of the filter cutoff region.
ylocThe y-location of the center of the filter cutoff region.
Returned Value
result—A filter object containing a notch filter in the filter object format. A filter object is an associative array with the following keys:
*'kernel'— A 2D floating-point array of the filter values.
*'cutoff'—The filter cutoff frequency or frequencies. For lowpass and highpass filters, a scalar value. For bandpass and bandstop filters, a two-element array containing the lower cutoff frequency and the upper cutoff frequency.
*'pass'—A string indicating one of the following kinds of filter:
*low—A lowpass filter.
*high—A highpass filter.
*band—A bandpass filter.
*stop—A bandstop filter
*notch—A notch filter.
*'dc_offset'—A floating point scalar value containing the DC offset of the filter.
*'maximum'—A floating point scalar value which is the maximum value of the filter.
*'type'—One of the following strings indicating the type of filter.
*ideal—An ideal filter.
*butterworth—A Butterworth filter.
*'domain'—One of the following strings indicating the filter domain.
*spectral—The filter is in the spectral (spatial frequency) domain.
*spatial—The filter is in the spatial domain.
 
note
FILT_NOTCH produces only spectral domain filters. For information about spatial domain filters, see the IPCREATE_FILTER Function.
*'xloc'—A scalar value specifying the x-location of the filter center. Valid for Notch filters only.
*'yloc'—A scalar value specifying the y-location of the filter center. Valid for Notch filters only.
*'center'—If set to 1, the filter center (DC value) is shifted to the array ('kernel') center; otherwise, the filter is unshifted.
*'order'—A scalar value specifying the filter order. Valid for Butterworth filters only.
Keywords
CenterIf set, shifts the output so that the center of the filter, the DC component, is the same as the center of the array.
DC_OffsetA scalar float containing the DC offset of the filter. (Default: 0.0)
MaximumA scalar float that is the maximum value of the filter. (Default: DC_Offset + 1.0)
XdimThe x-dimension (width) of the filter. (Default: the value of Ydim, if specified; 256 otherwise)
YdimThe y-dimension (height) of the filter. (Default: the value of Xdim, if specified; 256 otherwise)
Discussion
FILT_NOTCH produces a circularly symmetric, spatial frequency domain, ideal notch filter which can be applied to a frequency domain image. Notch filters are useful for removing narrow frequency ranges from images. Notch filtering is commonly used to remove periodic (coherent) noise.
Example
; Read an image.
image = IMAGE_READ(!IP_Data + 'face.tif')
IMAGE_DISPLAY, image
noise = NOISE_PERIODIC(image('width'), image('height'), $
F1 = 1.0, F2 = 3.5, Amp = 10.0, DC_Offset = 127.0)
; Corrupt the image with periodic noise.
noisy_image = image('pixels') + noise
TVSCL, noisy_image
; Remove the noise from the image and display.
notch_filter = FILT_NOTCH(6.0, 42, 12, $
Xdim = image('width'), Ydim = image('height'))
clean_image = FFT(noisy_image, -1) * notch_filter('kernel')
clean_image = ABS(FFT(clean_image, 1))
TVSCL, clean_image
 
Figure 10-7: Original Image
 
Figure 10-8: Corrupted Image
 
Figure 10-9: Filtered Image
See Also