2D DCT VI
- Updated2025-07-30
- 2 minute(s) read
Computes the Discrete Cosine Transform (DCT) of the input sequence X. Wire data to the X input to determine the polymorphic instance to use or manually select the instance.

Inputs/Outputs
X
—
X is the real input sequence.
DCT {X}
—
DCT {X} is the DCT of X.
error
—
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster. |
2D DCT
The two-dimensional Discrete Cosine Transform DCT {X} of a matrix X is defined by the following equation:
where M and N are the number of rows and columns, respectively, of the input matrix X,
x(m,n) is the element of X with row number m and column number n, y(u,v) is the element of DCT {X} with row number u and column number v.This VI performs a two-dimensional DCT using the following two steps:
- Perform a one-dimensional DCT row-by-row on the input matrix X. The output is Y'.
- Perform a one-dimensional DCT column-by-column on Y'. The output is DCT {X}.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Signal Processing\Transforms\Image Compression with DCT.vi
X
—
DCT {X}
—
error
—