% Construct Figure 2.9b from Digital Signal and Image Processing % Tamal Bose % Plot the 2-D DFT of 3 x 3 mean filter with quadrant swaps w1=[-pi:2*pi/200:pi-(2*pi/200)]; w2=[-pi:2*pi/200:pi-(2*pi/200)]; x = [ones(3)/9]; x_mag_spectrum = abs(fftshift(fft2(x,200,200))); surf(w1, w2, x_mag_spectrum) colormap hsv colorbar xlabel('\omega1'); ylabel('\omega2'); zlabel('Magnitude'); title('Shifted Plot of 3 x 3 Mean Filter Frequency Spectrum');