Properties of the Fourier transform

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 with numpy.absolute and numpy.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 fft2 and fftshift

  • display 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 function numpy.fft.fftshift to 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#

_images/340fd25006ad0ada0812ba03b760ece4cc3796d075335fe02f22d6d8fcdc5c7b.png _images/df95d0fec15f792a5c0747d7ebbe0287662571951b0818ec634e4825b9506237.png _images/fdb2aef55bc80540362f4c567fcd459ce88946fa48f209bbe2af2e667c63cdc1.png _images/c96630d9311450c15eb0f6b7925b6fd388400103c7e1f1c93d9855736d180e4c.png _images/0e457f06e6129c0412683da32173813e64e1095e847c52425c8c35d8f248e776.png

This exercise highlights some properties of the Fourier transform.

  • The images s1 and s2 show that a “contraction” in the spatial domain (the bands from s1 to s2 get 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 (s3 is a rotation of 90 ° of s2).

  • 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 s4 and s5 has been translated).