Properties of the Fourier transform#
Load the image s1.png and compute its discrete Fourier transform (DFT) with
numpy.fft.fft2.Show the DFT of the image with low frequencies at the center (
numpy.fft.fftshift). The magnitude and angle are obtained withnumpy.absoluteandnumpy.angle.
Repeat the same operations with images s2.png, s3.png, s4.png, and s5.png. Analyse the specificities of the images: what can you say about the DFT?
Correction#
Objectives#
manipulate the functions
fft2andfftshiftdisplay adequately the magnitude of the Fourier transform to see the details
observe the effect of a some properties of the Fourier transform (contraction-dilation, rotation, translation)
Some remarks#
After computing the Fourier transform with
numpy.fft.fft2, use the functionnumpy.fft.fftshiftto shift the zero frequencies at the centre of the image.The Fourier transform being complex, its display is not straightforward: so one need to show its magnitude (
numpy.absolute) and argument (numpy.angle).
Results#
This exercise highlights some properties of the Fourier transform.
The images
s1ands2show that a “contraction” in the spatial domain (the bands froms1tos2get closer and narrower) results in “dilation” in the frequency domain (the points diverge, even if the pattern remains overall the same, whether on the magnitude and the argument).A rotation in the spatial domain results in an identical rotation in the frequency domain (
s3is a rotation of 90 ° ofs2).A spatial shift implies a modification on the argument (but not on the magnitude), hence the name of phase shift (the white square of the images
s4ands5has been translated).