Wednesday, October 8, 2025
HomeLanguagesPython – scipy.fft.idct() method

Python – scipy.fft.idct() method

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

Syntax :

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

Return value: It will return the inverse transformed array.

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

Python3




# import scipy
from scipy import fft
  
# Using scipy.fft.idct() method
gfg = fft.idct([0.1, 2.1, 0.3, 4.2])
  
print(gfg)


Output :

[ 0.95238737 -0.80969772  0.7286317  -0.82132135]

Example #2:

Python3




# import scipy
from scipy import fft
  
# Using scipy.fft.idct() method
gfg = fft.idct([0.95238737, -0.80969772, 0.7286317, -0.82132135], 4)
  
print(gfg)


Output :

[0.12635568 0.17287895 0.19562573 0.51175513]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32342 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6712 POSTS0 COMMENTS
Nicole Veronica
11875 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11937 POSTS0 COMMENTS
Shaida Kate Naidoo
6833 POSTS0 COMMENTS
Ted Musemwa
7092 POSTS0 COMMENTS
Thapelo Manthata
6786 POSTS0 COMMENTS
Umr Jansen
6789 POSTS0 COMMENTS