0% found this document useful (0 votes)
6 views

Digital Image Processing

Chapter 4 discusses filtering in the frequency domain, focusing on techniques such as highpass filtering for image sharpening and the Laplacian for enhancing image details. It explains how to implement these techniques using transfer functions and provides examples, including the application of high-frequency-emphasis filtering to improve image clarity. The chapter emphasizes the importance of choosing appropriate cutoff frequencies and scaling factors to achieve optimal results in image processing.

Uploaded by

tle.coder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Digital Image Processing

Chapter 4 discusses filtering in the frequency domain, focusing on techniques such as highpass filtering for image sharpening and the Laplacian for enhancing image details. It explains how to implement these techniques using transfer functions and provides examples, including the application of high-frequency-emphasis filtering to improve image clarity. The chapter emphasizes the importance of choosing appropriate cutoff frequencies and scaling factors to achieve optimal results in image processing.

Uploaded by

tle.coder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

‭92‬

‭Chapter 4 Filtering in the Frequency Domain‬

‭ a c‬
b
‭e d f‬
‭FIGURE 4.53‬‭Top row: The image from Fig. 4.40(a) filtered‬‭with IHPF, GHPF, and BHPF‬
‭transfer functions using‬
‭D0 = 60 in all cases (n = 2 for the BHPF). Second row: Same sequence, but using D0 = 160.‬

‭ b c‬
a
‭FIGURE 4.54 The images from the second row of Fig. 4.53 scaled using Eqs. (2-31) and (2-32)‬
‭to show both positive‬
‭and negative values.‬
‭93‬

‭4.9 Image Sharpening‬


‭Using Highpass Filters‬‭289‬

‭ b c‬
a
‭FIGURE 4.55‬‭(a) Smudged thumbprint. (b) Result of‬‭highpass filtering (a). (c) Result of‬
‭thresholding (b). (Original‬
‭image courtesy of the U.S. National Institute of Standards and Technology.)‬

‭ mudging. Enhancement of the ridges is accomplished by the fact that their boundaries are‬
s
‭character-ized by high frequencies, which are unchanged by a highpass filter. On the other‬
‭hand, the filter reduces low frequency components, which correspond to slowly varying‬
‭intensities in the image, such as the background and smudges. Thus, enhancement is achieved‬
‭by reducing the effect of all features except those with high frequencies, which are the features‬
‭of interest in this case.‬
‭Figure 4.55(b) is the result of using a Butterworth highpass filter of order 4 with a cutoff‬
‭frequency of 50. A fourth-order filter provides a sharp (but smooth) transition from low to high‬
‭frequencies, with filtering characteristics between an ideal and a Gaussian filter. The cutoff‬
‭frequency chosen is about 5% of the long dimension of the image. The idea is for D0 to be close‬
‭to the origin so that low frequencies are attenuated but not completely eliminated, except for the‬
‭DC term which is set to 0, so that tonality dif-ferences between the ridges and background are‬
‭not lost completely. Choosing a value for D0 between 5% and 10% of the long dimension of the‬
‭image is a good starting point. Choosing a large value of D0 would highlight fine detail to such‬
‭an extent that the definition of the ridges would be affected. As expected, the highpass filtered‬
‭image has negative values, which are shown as black by the display. A simple approach for‬
‭highlighting sharp features in a highpass-filtered image is to threshold it by set-ting to black (0)‬
‭all negative values and to white (1) the remaining values. Figure 4.55(c) shows the result‬
‭of this operation. Note how the ridges are clear, and how the effect of the smudges has been‬
‭reduced considerably. In fact, ridges that are barely visible in the top, right section of the image‬
‭in Fig. 4.55(a) are nicely enhanced in Fig. 4.55(c). An automated algorithm would find it much‬
‭easier to follow the ridges on this image than it would on the original.‬
‭94‬

‭THE LAPLACIAN IN THE FREQUENCY DOMAIN‬

I‭n Section 3.6, we used the Laplacian for image sharpening in the spatial domain. In‬
‭this section, we revisit the Laplacian and show that it yields equivalent results using‬
‭frequency domain techniques. It can be shown (see Problem 4.52) that the Laplacian‬
‭can be implemented in the frequency domain using the filter transfer function‬

‭2‬ ‭2‬ ‭2‬


‭H(u,v)= - 4‬π ‭(‬‭𝑢‬ ‭‬ + ‭𝑣‬ ‭)‬

‭Chapter 4 Filtering in the Frequency Domain‬

‭or, with respect to the center of the frequency rectangle, using the‬
‭transfer function‬

‭2‬
‭H(u,v)= - 4‬π [(‭𝑢‬ − ‭‭𝑝‬ ‬‭/2‬‭‭‬‬)‭2‬‭‭‬‬ + ‭‬(‭𝑣‬ − ‭‬‭𝑄‭/‬ 2‬‭‬)‭2‬‭]‬
‭2‬ ‭2‬
‭= -4‬π ‭𝐷‬ ‭(u,v)‬

‭where D( , u v) is the distance function defined in Eq. (4-112). Using this transfer‬
f‭unction, the Laplacian of an image, f xy ( , ), is obtained in the familiar manner:‬

‭2‬ −‭1‬
∆ ‭f(x,y)=‬ϑ ‭‬‭[H(u,v) F(u,v)]‬

‭ here F( , u v) is the DFT of f xy ( , ). As in Eq. (3-54), enhancement is implemented‬


w
‭using the equation‬

‭2‬
‭g(x,y)= f(x,y) + c‬∆ ‭f(x,y)‬ ‭(4-126)‬

‭2‬
‭Here, c = −1 because H( , u v) is negative. In Chapter 3, f(x,y) and‬∆ ‭f(x,y)‬‭had‬

‭2‬
‭ omparable values. However, computing‬∆ ‭𝑓(‬ ‭𝑥,‬ ‭𝑦‬) ‭with Eq. (4-125) introduces DFT‬
c
‭scaling factors that can be several orders of magnitude larger than the maximum‬
‭value of f. Thus, the differences between f and its Laplacian must be brought into‬
‭95‬

‭comparable ranges. The easiest way to handle this problem is to normalize the val-‬
‭2‬
‭ es of f(x,y to the range [0,1] before computing its DFT and divide‬∆ ‭𝑓(‬ ‭𝑥,‬ ‭𝑦‬) ‭(,) by‬
u
‭its maximum value, which will bring it to the approximate range [ -1,1 ]. (Remember,‬
‭the Laplacian has negative values.) Equation (4-126) can then be used.‬
‭We can write Eq. (4-126) directly in the frequency domain as‬

−‭1‬
‭g(x,y)=‬ℑ {‭‬‭𝐹(‬ ‭𝑢,‬ ‭𝑣‬)‭‬ − ‭‬‭𝐻(‬ ‭𝑢‬, ‭𝑣‬)‭‬‭𝐹(‬ ‭𝑢‬, ‭𝑣‬)‭‬}
−‭1‬
‭=‬ℑ {‭‬[‭1‬ − ‭𝐻‬(‭𝑢‬, ‭𝑣‬)‭]‬ ‭‬‭𝐹‬(‭𝑢,‬ ‭𝑣‬)}
−‭1‬
‭=ℑ
‬ {[‭1‬ − ‭𝐻(‬ ‭𝑢‬, ‭𝑣‬)]‭𝐹(‬ ‭𝑢‬, ‭𝑣‬)}

‭ lthough this result is elegant, it has the same scaling issues just mentioned, com-‬
A
‭pounded by the fact that the normalizing factor is not as easily computed. For this‬
‭2‬
r‭ eason, Eq. (4-126) is the preferred implementation in the frequency domain, with‬∆ ‭𝑓(‬ ‭𝑥,‬ ‭𝑦‬)
‭computed using Eq. (4-125) and scaled using the approach mentioned in‬
‭the previous paragraph.‬

‭EXAMPLE 4.21 : Image sharpening in the frequency domain using the Laplacian‬‭.‬

‭ igure 4.56(a) is the same as Fig. 3.46(a), and Fig. 4.56(b) shows the result of using Eq.‬
F
‭(4-126), in which‬
‭the Laplacian was computed in the frequency domain using Eq. (4-125). Scaling was done as‬
‭described in connection with Eq. (4-126). We see by comparing Figs. 4.56(b) and 3.46(d) that‬
‭the frequency-domain result is superior. The image in Fig. 4.56(b) is much sharper, and shows‬
‭details that are barely visible in 3.46(d), which was obtained using the Laplacian kernel in Fig.‬
‭3.45(b), with a −8 in the center. The sig- nificant improvement achieved in the frequency domain‬
‭is not unexpected. The spatial Laplacian kernel‬
‭96‬

‭4.9 Image Sharpening UsingHighpass Filters‬

‭ b‬
A
‭FIGURE 4.56‬
‭(a) Original,‬
‭blurry image.‬
‭(b) Image‬
‭enhanced using‬
‭the Laplacian in‬
‭the frequency‬
‭domain.‬
‭Compare with‬
‭Fig. 3.46(d).‬
‭(Original image‬
‭courtesy of‬
‭NASA.)‬

‭ ncompasses a very small neighborhood, while the formulation in Eqs. (4-125) and‬
e
‭(4-126) encompasses‬
‭the entire image.‬

‭UNSHARP MASKING, HIGH-BOOST FILTERING, AND HIGH-‬


‭FREQUENCY-EMPHASIS FILTERING‬

I‭n this section, we discuss frequency domain formulations of the unsharp mask-‬
‭ing and high-boost filtering image sharpening techniques introduced in Section 3.6.‬
‭Using frequency domain methods, the mask defined in Eq. (3-55) is given by‬

‭𝑔‬‭𝑚𝑎𝑠𝑘‬‭(x,y)=‬‭𝑓‬(‭𝑥‬, ‭𝑦‬) ‭-‬‭𝑓‬‭𝐿𝑃‬(‭𝑥,‬ ‭𝑦‬)

‭With‬
−‭1‬
‭𝑓‬‭𝐿𝑃‬(‭𝑥,‬ ‭𝑦‬)‭=‬ℑ [‭𝐻‬‭𝐿𝑃‬(‭𝑢‬, ‭𝑣)‬ ‭‬‭𝑓‬(‭𝑢‬, ‭𝑣‬)‭]‬

‭ here HLP(,) u v is a lowpass filter transfer function, and F( , u v) is the DFT of f(x,y).‬
w
‭Here,‬‭𝑓‬‭𝐿𝑃‬(‭𝑥,‬ ‭𝑦‬)‭‬‭is a smoothed image analogous to‬‭f xy (,) in Eq. (3-55). Then, as in‬
‭97‬

‭Chapter 4 Filtering in the Frequency Domain‬

‭g(x,y)=f(x,y) + k‬‭𝑔‬‭𝑚𝑎𝑠𝑘‬(‭𝑥,‬ ‭𝑦‬)


‭ his expression defines unsharp masking when k = 1 and high-boost filtering when‬
T
‭k > 1. Using the preceding results, we can express Eq. (4-130) entirely in terms of‬
‭frequency domain computations involving a lowpass filter:‬
−‭1‬
‭g(x,y)=‬ℑ [(‭1‬ + ‭𝑘[‬ ‭1‬ − ‭𝐻‭𝐿‬ 𝑃‬(‭𝑢‬, ‭𝑣‬)]‭‬‭𝑓‬(‭𝑢‬, ‭𝑣‬]

‭We can express this result in terms of a highpass filter using Eq. (4-118):‬

‭g(x,y)=‬ℑ
−‭1‬
{[‭1‬ + ‭𝑘‭𝐻‬ ‬ (‭𝑢‬, ‭𝑣‬) ]‭𝑓(‬ ‭𝑢‬, ‭𝑣‬)}
‭𝐿𝑃‬

‭ he expression contained within the square brackets is called a high-frequency-‬


T
‭emphasis filter transfer function. As noted earlier, highpass filters set the dc term‬
‭to zero, thus reducing the average intensity in the filtered image to 0. The high-fre-‬
‭quency-emphasis filter does not have this problem because of the 1 that is added to‬
‭the highpass filter transfer function. Constant k gives control over the proportion of‬
‭high frequencies that influences the final result. A slightly more general formulation‬
‭of high-frequency-emphasis filtering is the expression‬

−‭1‬
‭g(x,y)=‬ℑ {[‭𝑘‭1‬ ‬‭‬ + ‭‬‭𝑘‭2‬ ‭𝐻‬ ‬‭𝐻𝑃‬(‭𝑢‬, ‭𝑣‬)]‭𝑓‬(‭𝑢‬, ‭𝑣‬}
‭ here k1 ≥ 0 offsets the value the transfer function so as not to zero-out the dc term‬
w
‭[see Fig. 4.30(c)], and k2 > 0 controls the contribution of high frequencies.‬

‭EXAMPLE 4.22 : Image enhancement using high-frequency-emphasis filtering.‬

‭ igure 4.57(a) shows a 503 720 × -pixel chest X-ray image with a narrow range of intensity‬
F
‭levels. The objective of this example is to enhance the image using high-frequency-emphasis‬
‭filtering. X-rays can- not be focused in the same manner that optical lenses can, and the‬
‭resulting images generally tend to be slightly blurred. Because the intensities in this particular‬
‭image are biased toward the dark end of the‬
‭98‬

‭4.9 Image Sharpening Using Highpass Filters‬

‭ b‬
A
‭C d‬
‭FIGURE 4.57‬
‭(a) A chest‬
‭X-ray.‬
‭(b) Result of‬
‭filtering with a‬
‭GHPF function.‬
‭(c) Result of‬
‭high-frequency‬
‭-‬
‭emphasis‬
‭filtering‬
‭using the same‬
‭GHPF. (d)‬
‭Result‬
‭of performing‬
‭histogram‬
‭equalization on‬
‭(c).‬
‭(Original image‬
‭courtesy of Dr.‬
‭Thomas R.‬
‭Gest,‬
‭Division of‬
‭Anatomical‬
‭Sciences,‬
‭University of‬
‭Michigan‬
‭Medical‬
‭School.)‬

‭ ray scale, we also take this opportunity to give an example of how spatial domain processing‬
g
‭can be used to complement frequency-domain filtering. Image artifacts, such as ringing, are‬
‭unacceptable in medical image processing, so we use a Gaussian‬
‭highpass filter transfer function. Because the spatial representation of a GHPF function is‬
‭Gaussian also,we know that ringing will not be an issue. The value chosen for D0 should‬
‭provide enough filtering to sharpen boundaries while at the same time not over-sharpening‬
‭minute details (such as noise). We used D0 = 70, approximately 10% of the long image‬
‭dimension, but other similar values would work also.Figure 4.57(b) is the result of highpass‬
‭filtering the original image (scaled as the images in Fig. 4.54). Asexpected, the image is rather‬
‭featureless, but the important boundaries (e.g., the edges of the ribs) areclearly delineated.‬
‭Figure 4.57(c) shows the advantage of high-frequency-emphasis filtering, where we used Eq.‬
‭(4-133) with k1 = 0 5. and k2 = 0 75 . . Although the image is still dark, the gray-level tonality‬
‭has been restored, with the added advantage of sharper features.‬
‭99‬

‭ s we discussed in Section 3.3, an image characterized by intensity levels in a narrow range of‬
A
‭the gray scale is an ideal candidate for histogram equalization. As Fig. 4.57(d) shows, this was‬
‭indeed an appropriate method to further enhance the image. Note the clarity of the bone‬
‭structure and other details that simply are not visible in any of the other three images. The final‬
‭enhanced image is a little noisy, but this is typical of X-ray images when their gray scale is‬
‭expanded. The result obtained using a combination of high-frequency-emphasis and histogram‬
‭equalization is superior to the result that would be obtained by using either method alone.‬

‭HOMOMORPHIC FILTERING‬

‭The illumination-reflectance model introduced in Section 2.3 can be used to develop‬

‭ frequency domain procedure for improving the appearance of an image by simul-‬


a
‭taneous intensity range compression and contrast enhancement. From the discus-‬
‭sion in that section, an image f(x,y ) can be expressed as the product of its illumina-‬
‭tion,i(x,y, and reflectance, r(x,y), components:‬

‭f(x,y)=i(x,y)r(x,y)‬

‭ his equation cannot be used directly to operate on the frequency components of‬
T
‭illumination and reflectance because the Fourier transform of a product is not the‬
‭product of the transforms:‬

ℑ[‭𝑓(‬ ‭𝑥,‬ ‭𝑦‬)]‭‬ ≠ ℑ[‭𝑖‬(‭𝑥,‬ ‭𝑦‬)]ℑ[‭𝑟‬(‭𝑥‬, ‭𝑦]‬

‭However, suppose that we define‬

‭z(x,y)=In f(x,y)‬
‭= In i(x,y) + In r(x,y)‬

‭Then‬
ℑ[‭𝑧‬(‭𝑥,‬ ‭𝑦‬)]‭‬‭‬ ‭=‬ℑ[‭𝐼𝑛‬‭‬‭𝑓‬(‭𝑥,‬ ‭𝑦)‬ ]
‭=‬ℑ‭[‬‭In I(x,y)] +‬ℑ‭[ In r(x,y)]‬

‭Or‬

‭Z(u,v)=‬‭𝐹‬‭𝑖‭(‬ u,v) +‬‭𝐹‬‭𝑟‭(‬ u,v)‬

‭where‬‭𝐹‬‭𝑖(‭

𝑢,‬ ‭𝑣‬)‭‬‭and‬ ‭𝐹‬‭𝑟(‭

𝑢,‬ ‭𝑣‬)‭are the Fourier‬‭transforms of ln(x,y) and ln(x,y)‬
‭respectively.‬
‭100‬

‭We can filter Z(u,v) using a filter transfer function H(u,v) so that‬

‭Chapter 4 Filtering in the Frequency Domain‬

‭S(u,v) = -H(u,v) Z(u,v)‬


‭=H(u,v)‬‭𝐹‬‭𝑖(‭

𝑢,‬ ‭𝑣‬)‭+ H(u,v)‬‭𝐹‬‭𝑟(‭

𝑢,‬ ‭𝑣‬)
‭The filtered image in the spatial domain is then‬

−‭1‬
‭s(x,y) =‬ℑ ‭[ S (u,v)]‬
−‭1‬ −‭1‬
‭=‬ℑ [‭𝐻‬(‭𝑢‬, ‭𝑣‬)‭𝐹‬‭𝑖(‭

𝑢,‬ ‭𝑣‬)‭] +‬ℑ ‭[H(u,v)‬‭𝐹‬‭𝑟(‭

𝑢,‬ ‭𝑣‬)‭]‬
‭By defining‬

‭'‬ −‭1‬
‭𝑖‬(‭𝑥,‬ ‭𝑦‬) ‭=‬ℑ ‭[H(u,v)‬‭𝐹‬‭𝑖(‭

𝑢,‬ ‭𝑣‬)‭]‬
‭And‬
‭'‬ −‭1‬
‭𝑟‬‭(x,y) =‬ℑ ‭[H(u,v)‬‭𝐹‬‭𝑟(‭

𝑢,‬ ‭𝑣‬) ]
‭we can express Eq. (4-140) in the form‬

‭'‬ ‭'‬
‭s(x,y) =‬‭𝑖‬‭(x,y) +‬‭𝑟‬‭(x,y)‬

‭ inally, because z(x,y) was formed by taking the natural logarithm of the input‬
F
‭image, we reverse the process by taking the exponential of the filtered result to form‬
‭the output image:‬

‭𝑠‬(‭𝑥‬,‭𝑦)‬
‭g(x,y) =‬‭𝑒‬
‭𝑖‬‭'‬(‭𝑥‬,‭𝑦)‬ ‭𝑟‬‭'(‬ ‭𝑥,‬‭𝑦‬)
‭ ‬‭𝑒‬
= ‭𝑒‬
‭=‬‭𝑖‬‭0(‭

𝑥,
‬ 𝑦
‭ ‬
) ‭𝑟‬‭0(‭

𝑥,‬ ‭𝑦‬)
‭Where‬
‭𝑖‬‭'‬(‭𝑥‬,‭𝑦)‬
‭𝑖‬‭0‭(‬ x,y) =‬‭𝑒‬
‭And‬
‭𝑟‬‭'‬(‭𝑥,‬‭𝑦‬)
‭𝑟‬‭0(‭

𝑥,‬ ‭𝑦‭)‬ =‬‭𝑒‬

‭ re the illumination and reflectance components of the output (processed) image.‬


a
‭Figure 4.58 is a summary of the filtering approach just derived. This method is‬
‭based on a special case of a class of systems known as homomorphic systems. In this‬
‭particular application, the key to the approach is the separation of the illumination‬
‭101‬

‭ IGURE 4.58‬
F
‭Summary of‬
‭steps‬
‭in‬
‭homomorphic‬
‭filtering.‬

‭ nd reflectance components achieved in the form shown in Eq. (4-138). The homo-‬
a
‭morphic filter transfer function, H(u,v), then can operate on these components sepa-‬
‭rately, as indicated by Eq. (4-139).‬

‭ he illumination component of an image generally is characterized by slow spa-‬


T
‭tial variations, while the reflectance component tends to vary abruptly, particularly‬
‭at the junctions of dissimilar objects. These characteristics lead to associating the low‬
‭frequencies of the Fourier transform of the logarithm of an image with illumination,‬
‭and the high frequencies with reflectance. Although these associations are rough‬
‭approximations, they can be used to advantage in image filtering, as illustrated in‬
‭Example 4.23.‬

‭ good deal of control can be gained over the illumination and reflectance com-‬
A
‭ponents with a homomorphic filter. This control requires specification of a filter‬
‭transfer function H(u,v) that affects the low- and high-frequency components of‬
‭the Fourier transform in different, controllable ways. Figure 4.59 shows a cross sec-‬
‭tion of such a function. If the parameters gL and gH are chosen so that gL < 1 and‬
‭gH ≥ 1, the filter function in Fig. 4.59 will attenuate the contribution made by the‬
‭low frequencies (illumination) and amplify the contribution made by high frequen-‬
‭cies (reflectance). The net result is simultaneous dynamic range compression and‬
‭contrast enhancement.‬
‭The shape of the function in Fig. 4.59 can be approximated using a highpass filter‬
‭transfer function. For example, using a slightly modified form of the GHPF function‬
‭yields the homomorphic function‬

‭2‬ ‭2‬
−‭𝑐‬‭𝐷‬ (‭𝑢‬,‭𝑣)‬ ‭/‬‭𝐷‬‭0‬
‭H(u,v) = (‬γ‭𝐻‭‬ ‬ − ‭‬γ‭𝐿‬) ‭[ 1 -‬‭𝑒‬ ‭]‬ ‭+‬γ‭𝐿‬
‭ here D(u, v) is defined in Eq. (4-112) and constant c controls the sharpness of the‬
w
‭slope of the function as it transitions between‬γ‭𝐿‭a

nd‬γ‭𝐻‬ ‭. This filter transfer function is similar‬‭to‬
‭the high-frequency-emphasis function discussed in the previous section.‬
‭102‬

‭FIGURE‬
‭ .59‬‭Radial‬
4
‭cross‬
‭section of a‬
‭homomorphic‬
‭filter transfer‬
‭function..‬

‭ IGURE 4.60‬
F
‭(a) Full body PET‬
‭scan. (b) Image‬
‭enhanced using‬
‭homomorphic‬
‭filtering. (Original‬
‭image courtesy‬
‭of Dr. Michael E.‬
‭Casey, CTI Pet‬
‭Systems.)‬
‭103‬

‭Chapter 4 Filtering in the Frequency Domain‬

‭EXAMPLE 4.23 : Homomorphic filtering.‬

‭ igure 4.60(a) shows a full body PET (Positron Emission Tomography) scan of size 1162 746 ×‬
F
‭pixels.The image is slightly blurred and many of its low-intensity features are obscured by the‬
‭high intensity of the “hot spots” dominating the dynamic range of the display. (These hot spots‬
‭were caused by a tumor in the brain and one in the lungs.) Figure 4.60(b) was obtained by‬
‭homomorphic filtering Fig. 4.60(a) using the filter transfer function in Eq. (4-147) with‬‭‬γ‭𝐿‬ ‭= 0‬‭4. ,‬
γ‭𝐻‬ ‭= 3 0. , c = 5, and‬‭𝐷‬‭0‬ ‭= 20. A radial‬‭cross sec- tion of this function looks just like Fig. 4.59, but‬
‭ ith a much sharper slope, and the transition between low and high frequencies much closer to‬
w
‭the origin. Note in Fig. 4.60(b) how much sharper the hot spots, the brain, and the skeleton are‬
‭in the processed image, and how much more detail is visible in this image, including, for‬
‭example, some of the organs, the shoulders, and the pelvis region. By reducing the effects of‬
‭the dominant illumination components (the hot spots), it became possible for the dynamic range‬
‭of the display to allow lower intensities to become more visible. Similarly, because the high‬
‭frequencies are enhanced by homomorphic filtering, the reflec- tance components of the image‬
‭(edge information) were sharpened considerably. The enhanced image in Fig. 4.60(b) is a‬
‭significant improvement over the original.‬

‭SELECTIVE FILTERING‬

‭ he filters discussed in the previous two sections operate over the entire frequency‬
T
‭rectangle. There are applications in which it is of interest to process specific bands of‬
‭frequencies or small regions of the frequency rectangle. Filters in the first category‬
‭are called band filters. If frequencies in the band are filtered out, the band filter is‬
‭called a bandreject filter; similarly, if the frequencies are passed, the filter is called‬
‭a bandpass filter. Filters in the second category are called notch filters. These filters‬
‭are further qualified as being notch reject or notch pass filters, depending on whether‬
‭frequencies in the notch areas are rejected or passed.‬

‭BANDREJECT AND BANDPASS FILTERS‬

‭ s you learned in Section 3.7, bandpass and bandreject filter transfer functions in‬
A
‭the frequency domain can be constructed by combining lowpass and highpass filter‬
‭transfer functions, with the latter also being derivable from lowpass functions (see‬
‭Fig. 3.52). In other words, lowpass filter transfer functions are the basis for forming‬
‭highpass, bandreject, and bandpass filter functions. Furthermore, a bandpass filter‬
‭transfer function is obtained from a bandreject function in the same manner that we‬
‭obtained a highpass from a lowpass transfer function:‬

‭𝐻‬‭𝐵𝑃‬(‭𝑢‬, ‭𝑣)‬ ‭= 1-‬‭𝐻‬‭𝐵𝑅‬(‭𝑢‬,. ‭𝑣‬)


‭104‬

‭ igure 4.61(a) shows how to construct an ideal bandreject filter (IBRF) transfer‬
F
‭function. It consists of an ILPF and an IHPF function with different cutoff frequen-‬
‭cies. When dealing with bandpass functions, the parameters of interest are the width,‬
‭W, and the center,‬‭𝐶‬‭0‬ ‭, of the band. An equation‬‭for the IBRF function is easily‬
‭ btained by inspection from Fig, 4.61(a), as the leftmost entry in Table 4.7 shows.‬
o
‭The key requirements of a bandpass transfer function are: (1) the values of the func-‬
‭tion must be in the range [0,1] (2) the value of the function must be zero at a dis-‬
‭tance‬‭𝐶‬‭0‭f‬ rom the origin (center) of the function;‬‭and (3) we must be able to specify‬
‭ value for W. Clearly, the IBRF function just developed satisfies these requirements.‬
a
‭Adding lowpass and highpass transfer functions to form Gaussian and Butter-‬
‭worth bandreject functions presents some difficulties. For example, Fig. 4.61(b)‬
‭shows a bandpass function formed as the sum of lowpass and highpass Gaussian‬
‭functions with different cutoff points. Two problems are immediately obvious: we‬
‭have no direct control over W, and the value of H(u, v) is not 0 at‬‭𝐶‬‭0‭.‬ We could‬

‭ b‬
a
‭c d‬
‭FIGURE 4.61‬
‭Radial cross sections. (a) Ideal bandreject filter transfer function. (b) Bandreject transfer function‬
‭formed‬
‭by the sum of Gaussian lowpass and highpass filter functions. (The minimum is not 0 and does‬
‭not align with‬‭𝐶‬‭0‬‭.)(c) Radial plot of Eq. (4-149).‬‭(The minimum is 0 and is properly aligned with‬
‭𝐶‬‭0‭,‬ but the value at the origin is not 1.) (d)‬‭Radial plot of Eq. (4-150); this Gaussian-shape plot‬
‭meets all the requirements of a bandreject filter transfer function.‬

‭ ABLE 4.7‬
T
‭Bandreject filter transfer functions.‬‭𝐶‬‭0‭i‬ s the‬‭center of the band, W is the width of the band, and‬
‭ ( , u v) is the dis-‬
D
‭tance from the center of the transfer function to a point (u, v) in the frequency rectangle.‬
‭105‬

‭Chapter 4 Filtering in the Frequency Domain‬

‭ ffset the function and scale it so that values fall in the range [0, 1] but finding an‬
o
‭analytical solution for the point where the lowpass and highpass Gaussian functions‬
‭intersect is impossible, and this intersection would be required to solve for the cutoff‬
‭points in terms of‬‭𝐶‬‭0‭.‬ The only alternatives‬‭are trial-and-error or numerical methods.‬
‭ ortunately, instead of adding lowpass and highpass transfer function, an alterna-‬
F
‭tive is to modify the expressions for the Gaussian and Butterworth highpass transfer‬
‭functions so that they will satisfy the three requirements stated earlier. We illustrate‬
‭the procedure for a Gaussian function. In this case, we begin by changing the point‬
‭at which H(u, v) = 0 from D( u, v) = 0 to D( u, v) =‬‭𝐶‬‭0‬‭in Eq. (4-120):‬

‭2‬
⎡ ‭𝐷(‬ ‭𝑢,‬‭𝑣)‬ ‭‬−‭𝐶‭0‬ ‬) ‭‬ ⎤
−⎢ ‭2‬ ⎥
‭𝑊‬
⎣ ⎦
‭H(u,v)= 1-‬‭𝑒‬

‭A plot of this function [Fig. 4.61(c)] shows that, below‬‭𝐶‬‭0‬‭, the function behaves as a‬
‭lowpass Gaussian function, at‬‭𝐶‬‭0‬‭the function‬‭will always be 0, and for values higher‬
‭than‬‭𝐶‬‭0‭t‬ he function behaves as a highpass Gaussian‬‭function. Parameter W is pro-‬
‭ ortional to the standard deviation and thus controls the “width” of the band. The‬
p
‭only problem remaining is that the function is not always 1 at the origin. A simple‬
‭modification of Eq. (4-149) removes this shortcoming:‬

⎡ ‭𝐷‬‭2‬(‭𝑢‬,‭𝑣‬)‭− ‭2‭2
‬ ‭𝐶‬
‬‬ ⎤
− ‭⎢⎢‬ ‭𝐷(‬ ‭𝑢,‬‭𝑣)‬ ‭𝑊‬‭0‬ ⎥

⎢ ⎥
⎣ ⎦
‭H(u,v)= 1-‬‭𝑒‬

‭ ow, the exponent is infinite when D(u, v) , = 0 which makes the exponential term go‬
N
‭to zero and H(u, v) = 1 at the origin, as desired. In this modification of Eq. (4-149),‬
‭the basic Gaussian shape is preserved and the three requirements stated earlier are‬
‭satisfied. Figure 4.61(d) shows a plot of Eq. (4-150). A similar analysis leads to the‬
‭form of a Butterworth bandreject filter transfer function shown in Table 4.7.‬
‭Figure 4.62 shows perspective plots of the filter transfer functions just discussed.‬
‭106‬

‭ t first glance the Gaussian and Butterworth functions appear to be about the same,‬
A
‭but, as before, the behavior of the Butterworth function is between the ideal and‬
‭Gaussian functions. As Fig. 4.63 shows, this is easier to see by viewing the three filter‬

‭A b c‬

‭ IGURE 4.62‬‭Perspective plots of (a) ideal, (b) modified‬‭Gaussian, and (c) modified Butterworth‬
F
‭(of order 1) bandre-ject filter transfer functions from Table 4.7. All transfer functions are of size‬
‭512 512 × elements, with C0 = 128 and W = 60.functions as images. Increasing the order of the‬
‭Butterworth function would bring it closer to the ideal bandreject transfer function.‬

‭NOTCH FILTERS‬

‭ otch filters are the most useful of the selective filters. A notch filter rejects (or‬
N
‭passes) frequencies in a predefined neighborhood of the frequency rectangle. Zero-‬
‭phase-shift filters must be symmetric about the origin (center of the frequency‬
‭rectangle), so a notch filter transfer function with center at(‬‭𝑢‬‭0,‭‬ 𝑣‬‭0)‬ ‭must have a‬
‭corresponding notch at location (-‬‭𝑢‬‭0,‬ − ‭𝑣‬‭0‬)‭‬‭Notch reject filter transfer functions are‬
‭ onstructed as products of highpass filter transfer functions whose centers have‬
c
‭been translated to the centers of the notches. The general form is:‬

‭𝑄‬
‭𝐻‬‭𝑁𝑅‬(‭𝑢‬, ‭𝑣‬)‭=‬ ∏ ‭𝐻‬‭𝐾‬ = (‭𝑢‬, ‭𝑣)‬ ‭𝐻‬−‭𝐾(‭

𝑢‬, ‭𝑣‬)
‭𝑘‬=‭1‬

‭where‬‭𝐻‬‭𝑘(‭

𝑢‬, ‭𝑣‬) ‭and‬‭𝐻‬−‭𝑘(‭

𝑢‬, ‭𝑣‬) ‭are highpass‬‭filter transfer functions whose centers are‬
‭at (‬‭𝑢‬‭𝑘,‬ ‭𝑣‬‭𝑘‬) ‭and (-‬‭𝑢‬‭𝑘,‬ − ‭𝑣‬‭𝑘)‬ ‭respectively.‬‭These centers are specified with respect to‬
‭the center of the frequency rectangle, (M/2,N/2) where, as usual, M and N are the‬
‭107‬

‭ umber of rows and columns in the input image. Thus, the distance computations for‬
n
‭each filter transfer function are given by‬
‭300 Chapter 4 Filtering in the Frequency Domain‬

‭2‬ ‭2‬ ‭1/2‬


‭𝐷‬‭𝑘(‭

𝑢,‬ ‭𝑣‬) = ‭‬[(‭𝑢‬‭‬ − ‭𝑀‭/‬ 2‬‭‬ − ‭‬‭𝑢‬‭𝑘‬) ‭+ (v -‬‭N/2 -‬‭𝑣‬‭𝑘)‬ ]

‭And‬

‭2‬ ‭2‬‭‬‭‬ ‭2‬


‭𝐷‬−‭𝑘‭(‬ u,v)=‬⎡⎢((‭𝑢‬‭‬ − ‭‬‭𝑀‭/‬ 2‬‭‬ + ‭‬‭𝑢‬‭𝑘‬) ‭‬ + ‭(‬ ‭𝑣‬ − ‭𝑁‭/‬ 2‬ + ‭𝑣‬‭𝑘)‬ ) ⎤⎥
⎣ ⎦

‭ or example, the following is a Butterworth notch reject filter transfer function of order n,‬
F
‭containing three notch pairs:‬

‭3‬ ⎡ ⎤⎡
‭1‬ ‭1‬ ⎤
‭𝐻‬‭𝑁𝑅‬(‭𝑢‬, ‭𝑣‬) ‭=‬‭‬ ∏ ⎢ ⎥⎢ ⎥
‬ ‭1⎢‬ ‭1‬+[‭𝐷‬‭0‬‭𝑘‭/‬ ‬‭𝐷‬‭𝑘‬(‭𝑢,‬‭𝑣)‬ ]
‭𝑘=
‭𝑛‬
⎥⎣ ‭1‬+[‭𝐷‬‭0‭𝑘‬ ‬‭/‬‭𝐷‬−‭𝑘(‭‬ 𝑢‬,‭𝑣)‬ ] ⎥⎦
⎢ ‭2‬

⎣ ⎦

‭where‬‭𝐷‬‭𝑘‬ ‭uv and‬‭𝐷‬−‭𝑘(‭



𝑢,‬ ‭𝑣‬) ‭are given by Eqs.‬‭(4-152) and (4-153). The constant‬‭𝐷‬‭0‬‭𝑘‬ ‭is the‬‭same‬
f‭or each pair of notches, but it can be different for different pairs. Other notch reject filter‬
‭functions are constructed in the same manner, depending on the high pass filter function‬
‭chosen. As with the filters discussed earlier, a notch pass filter transfer function is obtained from‬
‭a notch reject function using the expression‬

‭𝐻‬‭𝑁𝑃‬(‭𝑢‬, ‭𝑣)‬ ‭‬ = ‭‬‭1‬ − ‭𝐻‬‭𝑁𝑅‬(‭𝑢‬, ‭𝑣‬)


‭108‬

‭ s the next two examples show, one of the principal applications of notch filter ing is for‬
A
‭selectively modifying local regions of the DFT. Often, this type of pro cessing is done‬
‭interactively, working directly with DFTs obtained without padding. The advantages of working‬
‭interactively with actual DFTs (as opposed to having to “translate” from padded to actual‬
‭frequency values) generally outweigh any wrap around errors that may result from not using‬
‭padding in the filtering process. If nec essary, after an acceptable solution is obtained, a final‬
‭result using padding can be generated by adjusting all filter parameters to compensate for the‬
‭padded DFT size. The following two examples were done without padding. To get an idea of‬
‭how DFT values change as a function of padding, see Problem 4.42.‬

‭ XAMPLE 4.24 : Using notch filtering to remove moiré patterns from digitized printed media‬
E
‭images.‬

‭ igure 4.64(a) is the scanned newspaper image used in Fig. 4.21, showing a prominent moiré‬
F
‭pattern, and Fig. 4.64(b) is its spectrum. The Fourier transform of a pure sine, which is a‬
‭periodic function, is a pair of conjugate symmetric impulses (see Table 4.4). The symmetric‬
‭“impulse-like” bursts in Fig. 4.64(b) are a result of the near periodicity of the moiré pattern. We‬
‭can attenuate these bursts by using notch filtering. Figure 4.64(c) shows the result of multiplying‬
‭the DFT of Fig. 4.64(a) by a Butterworth notch reject transfer function with D0 9 = and n=4 for all‬
‭notch pairs (the centers of the notches are coincide with the centers of the black circular regions‬
‭in the figure). The value of the radius was selected (by visual inspection of the spectrum) to‬
‭encompass the energy bursts completely, and the value of n was selected to produce notches‬
‭with sharp transitions. The locations of the center of the notches were determined‬
‭109‬

‭ b‬
a
‭c d‬
‭FIGURE 4.64‬
‭(a) Sampled‬
‭newspaper image‬
‭showing a moiré‬
‭pattern. (b)‬
‭Spectrum. (c)‬
‭Fourier transform‬
‭multiplied by a‬
‭Butterworth notch‬
‭reject filter‬
‭transfer function.‬
‭(d) Filtered‬
‭image.‬

i‭nteractively from the spectrum. Figure 4.64(d) shows the result obtained with this filter transfer‬
‭func tion, using the filtering procedure outlined in Section 4.7. The improvement is significant,‬
‭considering the low resolution and degree of degradation of the original image.‬

‭EXAMPLE 4.25 : Using notch filtering to remove periodic interference.‬

‭ igure 4.65(a) shows an image of part of the rings surrounding the planet Saturn. This image‬
F
‭was cap tured by Cassini, the first spacecraft to enter the planet’s orbit. The nearly sinusoidal‬
‭110‬

‭ attern visible in the image was caused by an AC signal superimposed on the camera video‬
p
‭signal just prior to digitizing the image. This was an unexpected problem that corrupted some‬
‭images from the mission. Fortunately, this type of interference is fairly easy to correct by‬
‭postprocessing. One approach is to use notch filtering. Figure 4.65(b) shows the DFT spectrum.‬
‭Careful analysis of the vertical axis reveals a series of small bursts of energy near the origin‬
‭which correspond to the nearly sinusoidal interference. A simple approach is to use a narrow‬
‭notch rectangle filter starting with the lowest frequency burst, and extending for the remainder of‬
‭the vertical axis. Figure 4.65(c) shows the transfer function of such a filter (white represents 1‬
‭and black 0). Figure 4.65(d) shows the result of processing the corrupted image with this filter.‬
‭This result is a significant improvement over the original image. To obtain and image of just the‬
‭interference pattern, we isolated the frequencies in the vertical axis using a notch pass transfer‬
‭function, obtained by subtracting the notch reject function from 1 [see Fig. 4.66(a)]. Then, as‬
‭Fig. 4.66(b) shows, the IDFT of the filtered image is the spatial interference pattern.‬

‭ b‬
a
‭c d‬
‭FIGURE 4.65 (a)‬
‭Image of Saturn‬
‭rings showing‬
‭nearly periodic‬
‭interference. (b)‬
‭Spectrum. (The‬
‭bursts of energy‬
‭in the vertical axis‬
‭near the origin‬
‭correspond to the‬
‭interference‬
‭pattern). (c) A‬
‭vertical notch‬
‭reject filter‬
‭transfer function.‬
‭(d) Result of‬
‭filtering. (The thin‬
‭black border in (c)‬
‭is not part of the‬
‭data.) (Original‬
‭image courtesy of‬
‭Dr. Robert A.‬
‭West, NASA/‬
‭JPL.)‬
‭111‬

‭ b‬
A
‭FIGURE 4.66 (a)‬
‭Notch pass filter‬
‭function used to‬
‭isolate the vertical‬
‭axis of the DFT of‬
‭Fig. 4.65(a). (b)‬
‭Spatial pattern‬
‭obtained by‬
‭computing the IDFT‬
‭of (a).‬

‭4.11 THE FAST FOURIER TRANSFORM‬

‭ e have focused attention thus far on theoretical concepts and on examples of fil tering in the‬
W
‭frequency domain. One thing that should be clear by now is that com putational requirements in‬
‭this area of image processing are not trivial. Thus, it is important to develop a basic‬
‭understanding of methods by which Fourier transform computations can be simplified and‬
‭speeded up. This section deals with these issues.‬

‭ EPARABILITY OF THE 2-D DFT‬


S
‭As mentioned in Table 4.3, the 2-D DFT is separable into 1-D transforms. We can write Eq.‬
‭(4-67) as‬

‭𝑚‬−‭1‬ ‭𝑁−
‬ ‭1‬
−‭𝑗‬‭2π
‬ ‭𝑢𝑥‬‭/‬‭𝑀‬ −‭𝑗‭2
‬ ‬π‭𝑣𝑦‬‭/‬‭𝑁‬
‭F(u,v) =‬ ∑ ‭𝑒‬ ∑ ‭𝑓‬(‭𝑥,‬ ‭𝑦)‬ ‭𝑒‬
‭𝑥=
‬ ‭0‬ ‭𝑦−
‬ ‭0‬

‭𝑀‬−‭1‬
−‭𝑗‬‭2π
‬ ‭𝑣𝑦‬‭/‬‭𝑁‬
‭=‬ ∑ ‭𝐹‬(‭𝑥,‬ ‭𝑣‬)‭𝑒‬
‭𝑥‬=‭0‬

‭Where‬
‭𝑁−
‬ ‭1‬
−‭𝑗‭2
‬ ‬π‭𝑣𝑦‬‭/‬‭𝑁‬
‭F(x,v) =‬ ∑ ‭𝑓‬(‭𝑥,‬ ‭𝑦)‬ ‭𝑒‬
‭𝑦=
‬ ‭0‬
‭112‬

‭ or one value of x, and for v= − 012 1 , , , , , …N we see that Fx ( , ) v is the 1-D DFT of one row‬
F
‭of f(x,y). By varying x from 0 to M−1 in Eq. (4-157), we compute a set of 1-D DFTs for all rows of‬
‭f(x,y ). The computations in Eq. (4-156) similarly are 1-D transforms of the columns of F(x,v)‬
‭Thus, we conclude that the 2-D DFT of f (x,y ) can be obtained by computing the 1-D transform‬
‭of each row of f (x,y) and then computing the 1-D transform along each column of the result.‬
‭This is an important simplification because we have to deal only with one variable at a time. A‬
‭similar development applies to computing the 2-D IDFT using the 1-D IDFT. However, as we‬
‭show in the following section, we can compute the IDFT using an algorithm designed to‬
‭compute the forward DFT, so all 2-D Fourier transform computations are reduced to multiple‬
‭passes of a 1-D algorithm designed for computing the 1-D DFT.‬

‭COMPUTING THE IDFT USING A DFT ALGORITHM‬

‭ aking the complex conjugate of both sides of Eq. (4-68) and multiplying the results by MN‬
T
‭yields‬

‭𝑀‬−‭1‬‭𝑁‬−‭1‬
* * −‭𝑗‭2
‬ ‬π(‭𝑢𝑥‬‭/‬‭𝑀‬‭+
‬ ‭‭𝑣
‬ 𝑌‬‭/‬‭𝑁)‬
‭MN‬‭𝑓‬ (‭𝑥,‬ ‭𝑦‬)‭=‬ ∑ ∑ ‭𝑓‬ (‭𝑢,‬ ‭𝑣‬)‭𝑒‬
‭𝑢‬=‭0‬ ‭𝑣=
‬ ‭0‬

‭ ut, we recognize the form of the right side of this result as the DFT of F*(u,v) There fore, Eq.‬
B
‭(4-158) indicates that if we substitute F*(u,v) into an algorithm designed to compute the 2-D‬
*
f‭orward Fourier transform, the result will be MN‬‭𝑓‬ (‭𝑥,‬ ‭𝑦‬)‭). Taking the complex conjugate and‬
‭dividing this result by MN yields f(x,y), which is the inverse of F(u,v) Computing the 2-D inverse‬
‭from a 2-D forward DFT algorithm that is based on successive passes of 1-D transforms (as in‬
‭the previous section) is a frequent source of confusion involving the complex conjugates and‬
‭multiplication by a constant, nei ther of which is done in the 1-D algorithms. The key concept to‬
‭keep in mind is that we simply input F*( u,v) into whatever forward algorithm we have. The result‬
‭will be *( , ). All we have to do with this result to obtain f(x,y) is to take its complex conjugate and‬
‭divide it by the constant MN. Of course, when f xy cally is the case, then f *(x ,y )=f (x ,y ).‬

‭THE FAST FOURIER TRANSFORM (FFT)‬

‭Work in the frequency domain would not be practical if we had to implement Eqs. (4-67) and‬
‭2‬
(‭ 4-68) directly. Brute-force implementation of these equations requires on the order of‬‭𝑀𝑁‬
‭multiplications and additions. For images of moder ate size (say, 2048 2048 × pixels), this‬
‭means on the order of 17 trillion multiplica tions and additions for just one 2-D DFT, excluding‬
‭the exponentials, which could be computed once and stored in a look-up table. Without the‬
‭discovery of the fast Fou rier transform (FFT), which reduces computations to the order of MN‬
‭𝑙𝑜𝑔‬‭2‬ ‭mul tiplications and additions, it is safe‬‭to say that the material presented in this chapter‬
‭ ould be of little practical value. The computational reductions afforded by the FFT are‬
w
‭impressive indeed. For example, computing the 2-D FFT of a 2048 2048 MN × image would‬
‭require on the order of 92 million multiplication and additions, which is a significant reduction‬
‭from the one trillion computations mentioned above. Although the FFT is a topic covered‬
‭113‬

‭ xtensively in the literature on signal pro cessing, this subject matter is of such significance in‬
e
‭our work that this chapter would be incomplete if we did not provide an introduction explaining‬
‭why the FFT works as it does. The algorithm we selected to accomplish this objective is the‬
‭so-called successive-doubling method, which was the original algorithm that led to the birth of‬
‭an entire industry. This particular algorithm assumes that the number of samples is an integer‬
‭power of 2, but this is not a general requirement of other approaches (Brigham [1988]).We know‬
‭from the previous section that 2-D DFTs can be imple mented by successive passes of the 1-D‬
‭transform, so we need to focus only on the FFT of one variable.‬
‭In derivations of the FFT, it is customary to express Eq. (4-44) in the form‬

‭𝑀‬−‭1‬
‭𝑢𝑥‬
‭F(u)=‬ ∑ ‭f(x)‬‭𝑊‬‭𝑀‬
‭𝑥‬=‭0‬
‭for u= 0,1,2 , …M-1 where‬

−‭𝑗‭2
‬ ‬π‭/‬‭𝑀‬
‭𝑊‬‭𝑀‬‭‬ = ‭‬‭𝑒‬
‭and M is assumed to be of the form‬

‭𝑝‬
‭M=‬‭2‬

‭where p is a positive integer. Then it follows that M can be expressed as‬

‭M= 2K‬

‭with K being a positive integer also. Substituting Eq. (4-162) into Eq. (4-159) yields‬

‭2‬‭𝐾‬−‭1‬
‭𝑢𝑥‬
‭F(u) =‬ ∑ ‭𝑓‬(‭𝑥)‬ ‭𝑊‬‭2‬‭𝐾‬
‭𝑥‬=‭0‬
‭𝑘‬−‭1‬ ‭𝐾‬−‭1‬
‭𝑢‬(‭2‬‭𝑥)‬ ‭𝑢‬(‭2‬‭𝑥+
‬ ‭1‬)
‭=‬∑ ‭𝑓‬(‭2‭𝑥
‬ ‬)‭𝑊‬‭2‬‭𝐾‬ ‭‬‭+‬ ∑ ‭𝑓‬(‭2‭𝑥
‬ ‬ + ‭1)‬ ‭𝑊‬‭2‬‭𝐾‬
‭𝑥‬=‭0‬ ‭𝑥‬=‭0‬

‭2‬‭𝑢𝑥‬ ‭𝑢𝑥‬
‭However, it can be shown using Eq. (4-160) that‬‭𝑊‬‭2‬‭𝐾‬ ‭=‬‭𝑊‬‭𝐾‬ ‭, so Eq. (4-163) can be written as‬

‭𝐾‬−‭1‬ ‭𝐾‬−‭1‬
‭𝑢𝑥‬ ‭𝑢𝑥‬ ‭2‬‭𝐾‬
‭F(u) =‬ ∑ ‭𝑓‬(‭2‭𝑥
‬ ‬)‭𝑊‬‭𝐾‬ ‭+‬ ∑ ‭𝑓‬(‭2‭𝑥
‬ ‬ + ‭1)‬ ‭𝑊‬‭𝐾‬ ‭𝑊‬‭𝑢‬
‭𝑥‬=‭0‬ ‭𝑥‬=‭0‬

‭Defining‬

‭𝐾‬−‭1‬
‭𝑢𝑥‬
‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭𝑢‬)‭=‬ ∑ ‭𝑓‬(‭2‭𝑥
‬ ‬)‭𝑊‬‭𝐾‬
‭𝑥‬=‭0‬

‭For u= 0,1,2,3……K-1 and‬


‭114‬

‭𝐾−
‬ ‭1‬
‭𝑢𝑥‬
‭𝐹‬‭𝑜𝑑𝑑‬(‭𝑢‬)‭‬ = ‭‬ ∑ ‭𝑓‬(‭2‭𝑋
‬ ‬ + ‭1)‬ ‭𝑊‬‭𝐾‬
‭𝑥=
‬ ‭0‬

‭for u= − 0,1,2, …K-1 reduces Eq. (4-164) to‬

‭𝑢‬
‭F(u) =‬‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭𝑢‬)‭‬ + ‭‭𝑓
‬ ‬‭𝑜𝑑𝑑‬(‭𝑢‬)‭𝑊‬‭2‬‭𝐾‬

‭𝑢‬+‭𝐾‬ ‭𝑢‬ ‭𝑢‬+‭𝐾‬ ‭𝑢‬


‭Also because‬‭𝑊‬‭𝑀‬ ‭=‬‭𝑊‬‭𝐾‬‭and‬‭𝑊‬‭2‬‭𝐾‬ ‭‬ = ‭‬ − ‭𝑊‬‭2‬‭𝐾‬ ‭, it follows that‬

‭𝑢‬
‭F(u+k) =‬‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭𝑢‬) ‭-‬‭𝐹‬‭𝑜𝑑𝑑‬(‭𝑢‬)‭𝑊‬‭2‬‭𝐾‬

‭ nalysis of Eqs. (4-165) through (4-168) reveals some important (and surprising)‬
A
‭properties of these expressions. An M-point DFT can be computed by dividing the‬
‭original expression into two parts, as indicated in Eqs. (4-167) and (4-168). Comput-‬
‭ing the first half of F(u) requires evaluation of the two (M/2) -point transforms given in Eqs.‬
‭(4-165) and (4-166). The resulting values of‬‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭𝑢‬) ‭and‬‭𝐹‬‭𝑜𝑑𝑑‬(‭𝑢‬) ‭are then‬
‭ ubstituted into Eq. (4-167) to obtain F(u) for u = − 0,1,2,. ... M The other‬
s
‭half then follows directly from Eq. (4-168) without additional transform evaluations.‬
‭It is of interest to examine the computational implications of the preceding pro-‬
‭cedure. Let m(p) and‬α‭(p) represent the number‬‭of complex multiplications and‬
‭additions, respectively, required to implement the method. As before, the number‬
‭𝑃‬
‭ f samples is‬‭2‬ ‭,where p is a positive integer.‬‭Suppose first that p = 1 so that the‬
o
‭number of samples is two. A two-point transform requires the evaluation of F(0) ;‬
‭then F(1 ) follows from Eq. (4-168). To obtain F( ) 0 requires computing‬‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭0)‬ ‭and‬
‭𝐹‬‭𝑜𝑑𝑑‬(‭0)‬ ‭In this case K = 1 and Eqs. (4-165) and‬‭(4-166) are one-point transforms.‬
‭ owever, because the DFT of a single sample point is the sample itself, no multipli-‬
H
‭cations or additions are required to obtain‬‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭0)‬ ‭and‬‭𝐹‬‭𝑜𝑑𝑑‬(‭0)‬ ‭One multiplication‬
‭0‬
‭of‬‭𝐹‬‭𝑜𝑑𝑑‬(‭0)‬ ‭by‬‭𝑊‬‭2‬ ‭and one addition yields‬‭F( ) 0 from Eq. (4-167). Then F(1 ) follows‬
‭from Eq. (4-168) with one more addition (subtraction is considered to be the same‬
‭0‬
‭as addition). Because‬‭𝐹‬‭𝑜𝑑𝑑‬(‭0)‬ ‭𝑊‬‭2‬‭‭h
‬ as been‬‭computed already, the total number of‬
‭ perations required for a two-point transform consists of m(1)=1 multiplication‬
o
‭and‬α(‭1‬) = ‭2‭‬‬ ‭additions.The next allowed value for‬‭p is 2. According to the preceding‬
‭development, a four-point transform can be divided into two parts. The first half of F(u) requires‬
‭evaluation of two, two-point transforms, as given in Eqs. (4-165) and (4-166) for K = 2. A‬
‭two-point transform requires m(1) multiplications and‬α(‭1‬) ‭additions. Therefore, evaluation of‬
‭these two equations requires a total of 2m(1) multiplications and 2‬α ‭(1) additions. Two‬
‭further multiplications and additions are necessary to obtain F(0 ) and F(1 ) from Eq.‬
‭𝑢‬
‭(4-167). Because‬‭𝐹‬‭𝑜𝑑𝑑‬(‭𝑢‬)‭‬‭𝑊‬‭2‬‭𝐾‬ ‭has been computed‬‭already for u = { 0 ,1} two more‬
‭115‬

‭ dditions give F( 2) and F(3 ). The total is then m (2 ) = 2m(1) +2 and‬ α ‭( 1) +4.‬
a
‭When p is equal to 3, two four-point transforms are needed to evaluate‬‭𝐹‬‭𝑒𝑣𝑒𝑛‬(‭𝑢‬)
‭and‬‭𝐹‬‭𝑜𝑑𝑑‬(‭𝑢‬)‭. They require 2m (2 ) multiplications‬‭and 2‬α ‭( 2) additions. Four more‬
‭ ultiplications and eight more additions yield the complete transform. The total‬
m
‭then is then ( )3 224 = + ( ) multiplication and‬ α(‭3‬) ‭= 2‬α(‭2‬) + ‭8‭‬‭a
‬ dditions.‬
‭Continuing this argument for any positive integer p leads to recursive expressions‬
‭for the number of multiplications and additions required to implement the FFT:‬

‭𝑝‬−‭1‬
‭M(p) =2m(p-1) +‬‭2‬ ‭p≥
‬ ‭1‬

‭And‬

‭𝑝‬
α(‭𝑝)‬ ‭‬ = ‭2α
‬ (‭𝑝‬ − ‭1)‬ ‭‬ + ‭‬‭2‬ ‭p≥
‬ ‭1‬

‭ here m(0) = 0 and‬α(‭0‬)‭‬ = ‭‬‭0‬ ‭because the transform‬‭of a single point does not‬
w
‭require any multiplication or additions.The method just developed is called the successive‬
‭doubling FFT algorithm because it is based on computing a two-point transform from two‬
‭one-point trans-forms, a four-point transform from two two-point transforms, and so on, for any‬
‭M equal to an integer power of 2. It is left as an exercise (see Problem 4.63) to show‬
‭that‬

‭1‬
‭m(p) =‬ ‭2‬ ‭𝑀‭𝑙‬ 𝑜𝑔‬‭2‬‭𝑀‬

‭And‬

α(‭𝑛)‬ ‭‬ = ‭𝑀‭𝑙‬ 𝑜𝑔‬‭2‬‭𝑀‬

‭𝑝‬
‭ here M=‬‭2‬
W
‭The computational advantage of the FFT over a direct implementation of the 1-D‬
‭DFT is defined as‬

‭2‬
‭𝑀‬
‭C(M)=‬ ‭𝑀‬‭𝑙𝑜𝑔‬ ‭𝑀‬
‭2‬
‭ ‬
𝑀
‭ ‬‭𝑙𝑜𝑔‬ ‭𝑀‬
=
‭2‬
‭2‬
‭ here‬‭𝑀‬ ‭is the number of operations required‬‭for a “brute force” implementation‬
w
‭of the 1-D DFT. Because it is assumed that M p = 2 , we can write Eq. (4-173) in‬
‭terms of p:‬
‭116‬

‭𝑝‬
‭2‬
‭C(p)=‬ ‭𝑝‬

‭ plot of this function (Fig. 4.67) shows that the computational advantage increases‬
A
‭rapidly as a function of p. For example, when p = 15 (32,768 points), the FFT has‬
‭nearly a 2,200 to 1 advantage over a brute-force implementation of the DFT. Thus,‬
‭we would expect that the FFT can be computed nearly 2,200 times faster than the‬
‭DFT on the same machine. As you learned in Section 4.1, the FFT also offers signifi-‬
‭cant computational advantages over spatial filtering, with the cross-over between‬
‭the two approaches being for relatively small kernels.There are many excellent sources that‬
‭cover details of the FFT so we will not dwell on this topic further (see, for example, Brigham‬
‭[1988]). Most comprehensive signal and image processing software packages contain‬
‭generalized implementa-tions of the FFT that do not require the number of points to be an‬
‭integer power‬

‭ IGURE 4.67‬
F
‭Computational‬
‭advantage of the‬
‭FFT over a direct‬
‭implementation‬
‭of the 1-D DFT.‬
‭The number of‬
‭samples is M p = 2‬
‭The computational‬
‭advantage‬
‭increases rapidly‬
‭as a function of p.‬

‭ f 2 (at the expense of slightly less efficient computation). Free FFT programs also‬
o
‭are readily available, principally over the internet.‬

‭Summary, References, and Further Reading‬

‭ he material in this chapter is a progression from sampling to the Fourier transform, and then to‬
T
‭filtering in the frequency domain. Some of the concepts, such as the sampling theorem, make‬
‭very little sense if not explained in the context of the frequency domain. The same is true of‬
‭effects such as aliasing. Thus, the material developed in the preceding sections is a solid‬
‭foundation for understanding the fundamentals of 2-D digital signal processing. We took special‬
‭117‬

‭ are to develop the material starting with basic principles, so that any reader with a modest‬
c
‭mathemati-cal background would be in a position not only to absorb the material, but also to‬
‭apply it.For complementary reading on the 1-D and 2-D continuous Fourier transforms, see the‬
‭books by Bracewell[1995, 2003]. These two books, together with Castleman [1996], Petrou and‬
‭Petrou [2010], Brigham [1988], and Smith [2003], provide additional background for the material‬
‭in Sections 4.2 through 4.6. Sampling phenomena such as aliasing and moiré patterns are‬
‭topics amply illustrated in books on computer graphics, as exemplified by Hughes and Andries‬
‭[2013]. For additional general background on the material in Sections 4.7 through 4.11 see‬
‭Hall [1979], Jain [1989], Castleman [1996], and Pratt [2014]. For details on the software aspects‬
‭of many of the ex-amples in this chapter, see Gonzalez, Woods, and Eddins [2009].‬

You might also like