cv.dct - MATLAB File Help
cv.dct

Performs a forward or inverse discrete Cosine transform of 1D or 2D array

dst = cv.dct(src)
dst = cv.dct(src, 'OptionName',optionValue, ...)

Input

Output

Options

The function cv.dct performs a forward or inverse discrete Cosine transform (dct) of a 1D or 2D floating-point array:

The function chooses the mode of operation by looking at the transformation flags and size of the input array:

Note: Currently cv.dct supports even-size arrays (2, 4, 6, etc.). For data analysis and approximation, you can pad the array when necessary. Also, the function performance depends very much, and not monotonically, on the array size (see cv.getOptimalDFTSize). In the current implementation, dct of a vector of size N is calculated via DFT of a vector of size N/2. Thus, the optimal dct size N1 >= N can be calculated as:

function N1 = getOptimalDCTSize(N)
    N1 = 2 * cv.getOptimalDFTSize(fix((N+1)/2));
end

Note: cv.idct is equivalent to cv.dct(..., 'Inverse',true).

See also