Python – scipy.fft.idctn() method
Last Updated :
01 Oct, 2020
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
from scipy import fft
import numpy as np
array_gfg = np.random.randn( 3 , 3 )
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
from scipy import fft
import numpy as np
array_gfg = np.random.randn( 4 , 2 )
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]]
Share your thoughts in the comments
Please Login to comment...