Thursday, May 7, 2026
HomeLanguagesPython – scipy.fft.idctn() method

Python – scipy.fft.idctn() method

With the help of scipy.fft.idctn() method, we can compute the inverse of multidimensional discrete cosine transform by selecting different types of sequences and return the transformed array by using this method.

Syntax :

scipy.fft.idctn(x, type=2)

Return value: It will return the transformed array.

Example #1: In this example, we can see that by using scipy.fft.idctn() method, we are able to get the inverse of multidimensional discrete cosine transform by selecting different types of sequences by default it’s 2.

Python3




# import scipy and numpy
from scipy import fft
import numpy as np
  
array_gfg = np.random.randn(3, 3)
  
# Using scipy.fft.idctn() method
gfg = fft.idctn(array_gfg)
  
print(gfg)


Output :

[[-0.27264259  0.12356192  0.12133914]
 [ 0.00835797  0.11993761 -0.12110712]
 [ 0.09770593 -0.14543749 -0.01109258]]

Example #2 :

Python3




# import scipy and numpy
from scipy import fft
import numpy as np
  
array_gfg = np.random.randn(4, 2)
  
# Using scipy.fft.idctn() method
gfg = fft.idctn(array_gfg, 4)
  
print(gfg)


Output :

[[ 0.1430296   0.09689253]
 [ 0.00632705  0.24546606]
 [-0.26553743  0.01931002]
 [-0.07106229 -0.02292552]]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6891 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12105 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6962 POSTS0 COMMENTS