A) Keeping The Central Values of The Centralized DFT
A) Keeping The Central Values of The Centralized DFT
Compute the inverse (ifft2, real) and display it using subplot, imagesc, log10 and abs.
Why do we have to use the absolute value when displaying the DFT?
Display the centralized DFT by applying fftshift. It has index (0,0) in the middle of the image.
Where, in the centralized DFT, do you find the low frequency values and where do you find the high
frequency values?
[x,y]=meshgrid(-127:128,-127:128);
z=sqrt(x.^2+y.^2);
Perform pixel-wise multiplication of filMask1 and the centralized DFT image, and display the result,
say “filDFT1”.
Perform the inverse process of fftshift (using ifftshift) on “filDFT1” to take indices back to their
original locations, and then apply ifft2 to get the image in spatial domain.
Describe the resultant image by inspecting the operations that you have performed. Justify your
answer by changing the radius of the mask to 5, 10, 50, 100.
Here, you should justify your answer by changing one or both radii, but the first radius should be less
than the second.
Discuss the advantages of filtering in the frequency domain as compared to doing it in the spatial
domain.
Solution
History
Tracing the exact origins of the Fourier transform is tricky. Some related
procedures go as far back as Babylonian times, but it was the hot topics of
calculating asteroid orbits and solving the heat (flow) equation that led to
several breakthroughs in the early 1800s. Whom exactly among Clairaut,
Lagrange, Euler, Gauss, and D’Alembert we should thank is not exactly
clear, but Gauss was the first to describe the fast Fourier transform (an
algorithm for computing the DFT, popularized by Cooley and Tukey in
1965). Joseph Fourier, after whom the transform is named, first claimed
that arbitrary periodic5 functions can be expressed as a sum of
trigonometric functions.
Implementation
The DFT functionality in SciPy lives in the scipy.fftpack module. Among
other things, it provides the following DFT-related functionality:
fft, fft2, fftn
ifft, ifft2, ifftn
Discrete Fourier Transform (DFT) May 10, 2021
dct, idct, dst, idst
fftshift, ifftshift
fftfreq
rfft
np.hanning, np.hamming, np.bartlett, np.blackman, np.kaiser
SciPy wraps the Fortran FFTPACK library—it is not the fastest out there,
but unlike packages such as FFTW, it has a permissive free software
license