Pre-class Exercise • Recall from Lecture 8, the Fourier transform of the Laplacian operator is ∂2 f ∂2 f ∇ f ( x, y ) = 2 + 2 ∂x ∂y 2 ⇔ − (2π ) 2 (u 2 + v 2 ) F (u , v) • So the equivalent Fourier domain filter for the Laplacian filter is H (u , v) = −(2π ) 2 (u 2 + v 2 ) • Using Matlab, plot the magnitude of H(u,v) as a function of (u,v). M = 100; N = 100; [u,v] = meshgrid(-M/2:M/2, -N/2:N/2); % This is the true Fourier transform of a Laplacian. H1 = ... % Fill in here the equation for H(u,v) figure, imshow(abs(H1), []), impixelinfo figure, surf(abs(H1)), colormap jet; 1 Colorado School of Mines Department of Electrical Engineering and Computer Science Pre-class Exercise (continued) • Now look at the equivalent Fourier domain filter for the digital approximation to the Laplacian; ie 0 1 0 h = 1 − 4 1 0 1 0 Pad h with zeros so that it is the same size as the (u,v) space used previously. Then take the discrete Fourier transform (using Matlab’s fft2) and plot the magnitude of H(u,v). Compare the two plots. They should be very similar at low frequencies, but differ quite a bit at large frequencies. 2 Colorado School of Mines Department of Electrical Engineering and Computer Science A note about units • You may have noticed that the scale of the two plots is quite a bit different. • This is because of the difference between the units of measure for the spatial domain and the frequency domain. • As explained on slide 10 of lecture 8.1, unit increments of u actually correspond to increments in frequency of 1/(M∆x). – If we use ∆x=1, then we should actually use u = 1/M, 2/M, 3/M, … M/M – instead of u = 1,2,3, … M 3 Colorado School of Mines Department of Electrical Engineering and Computer Science