VOOZH about

URL: https://www.geeksforgeeks.org/python/python-scipy-fft-dctn-method/

⇱ Python - scipy.fft.dctn() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python - scipy.fft.dctn() method

Last Updated : 1 Oct, 2020

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

Syntax :

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

Return value: It will return the transformed array.

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

Output :

[[ -4.16635907 -4.02741393 -3.60128725]
 [ -4.53247906 -3.48696887 0.9338914 ]
 [-10.02597376 -5.30097223 6.56879818]]

Example #2:

Output :

[[-22.58866562 4.34759109 6.27133607 -10.09673997 1.42277882]
 [-10.38551445 -1.73284723 4.77719083 -8.1483736 2.31129559]
 [ 5.09865556 7.7860346 -1.99346709 -8.19680308 5.54398566]
 [ 11.03512166 -13.2738255 -6.30390925 5.55873569 -3.67046116]
 [ 11.70752959 -13.28207081 6.20179649 11.0564309 5.17738824]]
Comment
Article Tags:
Article Tags: