The output is symmetric across a diameter thru the origin of the image; the origin can be either the center of the image or the top left corner of the image. Cutoff frequencies are normalized to the Nyquist frequency, thus implying that 0 corresponds to DC and 1.0 corresponds to the Nyquist frequency.
Note that the number of pixels between DC and Nyquist is given by the image_width/2 in the width direction and image_height/2 in the height direction. This means that if you ask for a non-square image you will get a non-circularly symmetric passband in the output. This occurs because it is assumed that the frequency sampling interval is the same in both directions.
For the ideal filter, the magnitude response is 1.0 in the passband, 1.0 at the cutoff frequency, and zero in the stopband.
For the Butterworth filter (also called a maximally-flat filter), the magnitude response in the passband grades from 1.0 down to 1/sqrt(2) at the cutoff frequence. The response in the stopband falls from 1/sqrt(2) towards zero at a rate that increases with the order of the filter. This filter is described in Oppenheim and Schafer, p.845, Eq. B.1.
For the Gaussian filter (actually a super-Gaussian), the passband response grades from 1.0 down to 1/sqrt(2) at the cutoff frequency. The response in the stopband falls from 1/sqrt(2) towards zero at a rate that increases with the order of the filter. This is an ad-hoc filter that has nice behavior and is easy to understand.
The Chebyshev type I filter is an equiripple filter that places the ripple in the passband. In the passband, the response oscillates between 1.0 and 1/sqrt(1+epsilon^2), where epsilon controls the ripple . At the cutoff frequency, the magnitude response is exactly 1/sqrt(1+epsilon^2). The response in the stopband falls from that level towards zero at a rate that increases with the order of the filter. One way to set the parameters for this filter is to set epsilon to obtain the desired ripple behavior and then set the order to obtain the desired attenuation in the stopband. This filter is described in Oppenheim and Schafer, p.847, Eq. B.4.
The Chebyshev type II filter is an equiripple filter that places the ripple in the stopband. In the stopband, the response oscillates between 0.0 and 1/sqrt(1+(1/epsilon^2)), where epsilon controls the ripple . At the cutoff frequency, the magnitude response is exactly 1/sqrt(1+(1/epsilon^2)). The response in the passband falls from 1.0 towards that level at a rate that depends on the order of the filter. One way to set the parameters for this filter is to set epsilon to obtain the desired ripple behavior and then set the order to obtain the desired behavior in the passband. This filter is described in Oppenheim and Schafer, p.848, Eq. B.10.
Mutually Exclusive Group; you must specify ONE of:
OR
OR
OR
Mutually Exclusive Group; you must specify ONE of:
OR
OR
OR
OR
ifiltdesign -o output.filt -lp -but -order 4 -ucutoff 0.1 -wsize 512 -hsize 512This command will generate a 512 x 512 image of doubles values with a range from 0 to 1 that corresponds to the frequency image that results from a normalized cutoff of 0.1 and a fourth order Butterworth transfer function. The DC value is centered at 256, 256 in the image.
This image can then be multiplied with the frequency domain representation of the image to be filtered, thus performing the filtering operation (in the frequency domain).
The following shows how one might apply the above filter to the "ball" image:
% kfft -i image:ball -o ball.fft -dir 0 -center 1 -scale 1
% kmul -i1 ball.fft -i2 output.filt -o ball.lp.fft
% kfft -i ball.lp.fft -o ball.lp -dir 1 -center 1 -scale 2
% kcmplx2real -i ball.lp -or ball.lpThe lowpass filtered output, ball.lp, can then be displayed directly using putimage.
Alan V. Oppenheim and Ronald W. Schafer, "Discrete-Time Signal Processing", ISBN 0-13-216292-X, Prentice-Hall, 1989.
Edward P. Cunningham,"Digital Filtering: An Introduction", ISBN 0-395-53989-7, Houghton Mifflin, 1992.