# 2-D IDCT

Compute 2-D inverse discrete cosine transform (IDCT)

• Library:
• Computer Vision Toolbox / Transforms

## Description

The 2-D IDCT block calculates the two-dimensional inverse discrete cosine transform of the input signal. The equation for the two-dimensional IDCT of an input signal is:

$f\left(x,y\right)=\frac{2}{\sqrt{MN}}\sum _{m=0}^{M-1}\sum _{n=0}^{N-1}C\left(m\right)C\left(n\right)F\left(m,n\right)\mathrm{cos}\frac{\left(2x+1\right)m\pi }{2M}\mathrm{cos}\frac{\left(2y+1\right)n\pi }{2N},$

where F(m,n) is the discrete cosine transform (DCT) of the signal f(x,y). If $m=n=0$, then $C\left(m\right)=C\left(n\right)=1/\sqrt{2}$. Otherwise $C\left(m\right)=C\left(n\right)=1$.

## Ports

### Input

expand all

Specify input data as a vector or matrix of intensity values. The number of elements in the input data must be a power of two.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fixed point

### Output

expand all

Output data containing the 2-D IDCT of the input, returned as a matrix or vector. The size and data type of the output are the same as those of the input.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fixed point

## Parameters

expand all

Main

Specify how the block computes the sine and cosine terms to find the 2-D IDCT.

• Table lookup — The block computes and stores the trigonometric values before the simulation starts. This option requires more memory than the Trigonometric fcn option.

• Trigonometric fcn — The block computes the sine and cosine values during the simulation.

Data Types

For details on the fixed-point block parameters, see Specify Fixed-Point Attributes for Blocks.

Select this parameter to prevent the fixed-point tools from overriding the data types you specify in this block. For more information, see Lock the Output Data Type Setting (Fixed-Point Designer).

## Block Characteristics

 Data Types double | fixed point | integer | single Multidimensional Signals no Variable-Size Signals no

expand all

## References

[1] Wen-Hsiung Chen, C. Smith, and S. Fralick. “A Fast Computational Algorithm for the Discrete Cosine Transform.” IEEE Transactions on Communications 25, no. 9 (September 1977): 1004–9. https://doi.org/10.1109/TCOM.1977.1093941.

[2] Zhongde Wang. “Fast Algorithms for the Discrete W Transform and for the Discrete Fourier Transform.” IEEE Transactions on Acoustics, Speech, and Signal Processing 32, no. 4 (August 1984): 803–16. https://doi.org/10.1109/TASSP.1984.1164399.

## Extended Capabilities

### Functions

Introduced before R2006a