Compute 2D discrete cosine transform (DCT)
Computer Vision Toolbox / Transforms
The 2D DCT block calculates the twodimensional discrete cosine transform of an image. Suppose f(x,y) is the input image of dimension MbyN, the equation for the 2D DCT is
$$F(m,n)=\frac{2}{\sqrt{MN}}C(m)C(n){\displaystyle \sum _{x=0}^{M1}{\displaystyle \sum _{y=0}^{N1}f(x,y)}}\mathrm{cos}\frac{(2x+1)m\pi}{2M}\mathrm{cos}\frac{(2y+1)n\pi}{2N}$$
where $$C(m),C(n)=1/\sqrt{2}$$ for $$m,n=0$$ and $$C(m),C(n)=1$$ otherwise.
The number of rows and columns of the input image must be power of 2. You can also use this block to compute 1D DCT of a vector.
Data Types 

Multidimensional Signals 

VariableSize Signals 

[1] Chen, W.H, C.H. Smith, and S.C. Fralick, “A fast computational algorithm for the discrete cosine transform,” IEEE Trans. Communications, 25 (1977): 10041009.
[2] Wang, Z. “Fast algorithms for the discrete W transform and for the discrete Fourier transform,” IEEE Trans. Acoust., Speech, Signal Processing, 32 (August 1984): 803816.