Creates a data structure for use with vDSP_DCT_Execute to perform a single-precision, discrete cosine transform.


vDSP_DFT_Setup vDSP_DCT_CreateSetup(vDSP_DFT_Setup __Previous, vDSP_Length __Length, vDSP_DCT_Type __Type);



Either NULL, or an existing structure of type vDSP_DFT_Setup – i.e. a previous result from any setup function in the single-precision DFT/DCT family: vDSP_DFT_zop_CreateSetup, vDSP_DFT_zrop_CreateSetup, vDSP_DFT_CreateSetup (deprecated), or vDSP_DCT_CreateSetup. Pass NULL to create an initial setup object.


Number of real elements to be transformed. The supported values are Length = f * 2**n, where f is 1, 3, 5, or 15 and n is at least 4.


Which DCT variant to perform. At present, the supported DCT types are II and III (which are mutual inverses, up to scaling) and IV (which is its own inverse). These are specified with symbol names vDSP_DCT_II, vDSP_DCT_III, and vDSP_DCT_IV.

Return Value

Returns a vDSP_DFT_Setup object, or NULL if the function fails, either from lack of memory or because Length or Type does not satisfy the requirements given above.


The returned setup object may be used only with vDSP_DCT_Execute using an input vector of length Length.

Do not call this function while any DFT or DCT routine sharing the Previous setup data might be executing.

See Also

Discrete Cosine Transforms


Calculates the discrete single-precision cosine transform for a vector.