DCT VI

Owning Palette: Transforms VIs

Requires: Full Development System

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.

Details  Example

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

1D DCT

X is a real vector.
DCT size is the length of the DCT you want to perform. If DCT size is greater than the number of elements in X, this VI adds zeros to the end of X to match the size of DCT size. If DCT size is less than the number of elements in X, this VI uses only the leading DCT size elements in X to perform the DCT. If DCT size is less than or equal to zero, this VI uses the length of X as the DCT size.
DCT {X} is the DCT of X.
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

X is the real input sequence.
DCT {X} is the DCT of X.
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.

DCT Details

1D DCT

The one-dimensional Discrete Cosine Transform DCT {X} of a sequence X is defined by the following equations:

and

where N is the length of X,

xn is the nth element of X,

yk is the kth element of DCT {X}.

This VI applies a fast DCT algorithm instead of calculating the Discrete Cosine Transform directly. LabVIEW implements this fast DCT algorithm using an FFT technique.

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:

  1. Perform a one-dimensional DCT row-by-row on the input matrix X. The output is Y'.
  2. Perform a one-dimensional DCT column-by-column on Y'. The output is DCT {X}.

Example

Refer to the Image Compression with DCT VI in the labview\examples\Signal Processing\Transforms directory for an example of using the DCT VI.

 Open example  Find related examples