Admin Production ni-theme
Current Publication

DCT

LabWindows/CVI

DCT

Advanced Analysis Library Only

AnalysisLibErrType DCT (double inputArray[], ssize_t numberOfElements, ssize_t numberOfElementsInDCT, double outputArray[]);

Purpose

Computes the one-dimensional Discrete Cosine Transform (DCT) of the input sequence inputArray, which is defined as follows:

and

where numberOfElements is the length of inputArray
is the n-th element of inputArray
is the k-th element of outputArray
The function applies the fast DCT algorithm instead of calculating the DCT directly. The fast DCT algorithm is implemented using the Fast Fourier Transform (FFT) technique.

Parameters

Input
Name Type Description
inputArray double [] The input sequence.
numberOfElements ssize_t The number of elements in inputArray.
numberOfElementsInDCT ssize_t The length of the DCT to be performed. If numberOfElementsInDCT is greater than numberOfElements, the function pads inputArray with zeros to make numberOfElements equal numberOfElementsInDCT. If numberOfElementsInDCT is less than numberOfElements, inputArray is truncated. Only the leading numberOfElementsInDCT elements in inputArray are used to perform the DCT. If numberOfElementsInDCT is less than or equal to zero, the function uses numberOfElements as numberOfElementsInDCT.
Output
Name Type Description
outputArray double [] The DCT of inputArray.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later