Python | Numpy np.fft2() method

With the help of np.fft2() method, we can get the 2-D Fourier Transform by using np.fft2() method.

Syntax : np.fft2(Array)
Return : Return a 2-D series of fourier transformation.

Example #1 :
In this example we can see that by using np.fft2() method, we are able to get the 2-D series of fourier transformation by using this method.

filter_none

edit
close

play_arrow

link
brightness_4
code

# import numpy
import numpy as np
  
a = np.array([[5, 4, 6, 3, 7], [-1, -3, -4, -7, 0]])
# using np.fft2() method
gfg = np.fft.fft2(a)
  
print(gfg)

chevron_right


Output :

[[10. + 0.j 8.09016994 + 2.17962758j -3.09016994 + 9.23305061j
-3.09016994 – 9.23305061j 8.09016994 – 2.17962758j]
[40. + 0.j -5.85410197 + 0.j 0.85410197 + 0.j
0.85410197 + 0.j -5.85410197 + 0.j]]



Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# import numpy
import numpy as np
  
a = np.array([[-5.5, 4.4, -6.6, 3.3, -7.7], [1.1, -3.3, 4.4, -7.7, 0]])
# using np.fft2() method
gfg = np.fft.fft2(a)
  
print(gfg)

chevron_right


Output :

[[-17.6 + 0.j -1.1 – 9.6624249j -1.1 – 3.08018588j
-1.1 + 3.08018588j -1.1 + 9.6624249j]
[ -6.6 + 0.j -6.6 – 1.7149948j -6.6 – 29.97513624j
-6.6 + 29.97513624j -6.6 + 1.7149948j]]

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.