DSP Blockset    
DCT

Compute the DCT of the input.

Library

Transforms

Description

The DCT block computes the unitary discrete cosine transform (DCT) of each channel in the M-by-N input matrix, u.

For both sample-based and frame-based inputs, the block assumes that each input column is a frame containing M consecutive samples from an independent channel. The frame size, M, must be a power of two. To work with other frame sizes, use the Zero Pad block to pad or truncate the frame size to a power-of-two length.

The output is an M-by-N matrix whose lth column contains the length-M DCT of the corresponding input column.

where

The output is always sample-based, and the output port rate and data type (real/complex) are the same as those of the input port.

For convenience, length-M 1-D vector inputs and sample-based length-M row vector inputs are processed as single channels (i.e., as M-by-1 column vectors), and the output has the same dimension as the input.

The Sine and cosine computation parameter determines how the block computes the necessary sine and cosine values in the FFT and fast DCT algorithms used to compute the DCT. This parameter has two settings, each with its advantages and disadvantages, as described in the following table.

Sine and Cosine Computation Parameter Setting
Sine and Cosine Computation Method
Effect on Block Performance
Table lookup
The block computes and stores the trigonometric values before the simulation starts, and retrieves them during the simulation. When you generate code from the block, the processor running the generated code stores the trigonometric values computed by the block in a speed-optimized table, and retrieves the values during code execution.
The block usually runs much more quickly, but requires extra memory for storing the precomputed trigonometric values.
Trigonometric fcn
The block computes sine and cosine values during the simulation. When you generate code from the block, the processor running the generated code computes the sine and cosine values while the code runs.
The block usually runs more slowly, but does not need extra data memory. For code generation, the block requires a support library to emulate the trigonometric functions, increasing the size of the generated code.

Dialog Box

Sine and cosine computation
Sets the block to compute sines and cosines by either looking up sine and cosine values in a speed-optimized table (Table lookup), or by making sine and cosine function calls (Trigonometric fcn). See the table above.

Supported Data Types

To learn how to convert to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.

See Also

Complex Cepstrum
DSP Blockset
FFT
DSP Blockset
IDCT
DSP Blockset
Real Cepstrum
DSP Blockset
dct
Signal Processing Toolbox

Also see Transforms for a list of all the blocks in the Transforms library.


  dB Gain Delay Line