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


func vDSP_DCT_CreateSetup(_ __Previous: vDSP_DFT_Setup?, _ __Length: vDSP_Length, _ __Type: vDSP_DCT_Type) -> vDSP_DFT_Setup?



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

func vDSP_DCT_Execute(OpaquePointer, UnsafePointer<Float>, UnsafeMutablePointer<Float>)

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