---
title: "vDSP_DFT_Interleaved_CreateSetupD(_:_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vdsp_dft_interleaved_createsetupd(_:_:_:_:)"
---

# vDSP_DFT_Interleaved_CreateSetupD(_:_:_:_:)

Returns a setup structure that contains precalculated data for forward and inverse, double-precision interleaved discrete Fourier transform (DFT) functions.

## Declaration

```swift
func vDSP_DFT_Interleaved_CreateSetupD(_ Previous: vDSP_DFT_Interleaved_SetupD?, _ Length: vDSP_Length, _ Direction: vDSP_DFT_Direction, _ RealtoComplex: vDSP_DFT_RealtoComplex) -> vDSP_DFT_Interleaved_SetupD?
```

## Parameters

- `Previous`: An existing doc://com.apple.accelerate/documentation/Accelerate/vDSP_DFT_Interleaved_SetupD structure that shares memory and direction with the setup structure that this function returns. Pass nil to create an object with newly initialized and allocated memory. To ensure correct operation, if you specify a previous setup structure it must share the same direction as the Direction parameter.
- `Length`: For complex-to-complex transforms, the number of complex elements. For real-to-complex transforms, the number of real elements divided by 2.
- `Direction`: A flag that specifies the transform direction. Pass doc://com.apple.accelerate/documentation/Accelerate/vDSP_DFT_Direction/FORWARD to transform from the time domain to the frequency domain. Pass doc://com.apple.accelerate/documentation/Accelerate/vDSP_DFT_Direction/INVERSE to transform from the frequency domain to the time domain.
- `RealtoComplex`: A flag that specifies the transform type. To transform from complex to complex, pass doc://com.apple.accelerate/documentation/Accelerate/vDSP_DFT_RealtoComplex/interleaved_ComplextoComplex. To transform from real to complex, pass doc://com.apple.accelerate/documentation/Accelerate/vDSP_DFT_RealtoComplex/interleaved_RealtoComplex.

## Return Value

Return Value Returns a vDSP_DFT_Interleaved_SetupD object, or nil if the function fails, either from insufficient memory or because Length doesn’t satisfy the above requirements.

## Discussion

Discussion important: To prevent potential memory leaks, if the Previous parameter is not nil, the return value and the Previous value must be different variables. Discussion The interleaved DFT operations that the Accelerate framework provides work over collections with specific counts. The maximum number of complex elements that these operations support is 4096, and other supported counts are the result of the formula f * 2ⁿ for certain values of f and n. In the case of real-to-complex, n is the number of real elements divided by two, and for complex-to-complex n is the number of complex elements. The following tables show the complete list of supported lengths for different values of f and n: Supported lengths for f = 1  |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |  Supported lengths for f = 3  |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |  Supported lengths for f = 5  |  |   |  |   |  |   |  |   |  |   |  |   |  |  Supported lengths for f = 9  |  |   |  |   |  |   |  |   |  |   |  |   |  |  Supported lengths for f = 15  |  |   |  |   |  |   |  |   |  |   |  |   |  |

## See Also

### Related Documentation

- [Understanding data packing for Fourier transforms](accelerate/understanding-data-packing-for-fourier-transforms.md)
- [Reducing spectral leakage with windowing](accelerate/reducing-spectral-leakage-with-windowing.md)

### Interleaved discrete Fourier transform functions

- [Performing Fourier transforms on interleaved-complex data](accelerate/performing-fourier-transforms-on-interleaved-complex-data.md)
- [vDSP_DFT_Interleaved_CreateSetup(_:_:_:_:)](accelerate/vdsp_dft_interleaved_createsetup(_:_:_:_:).md)
- [vDSP_DFT_Interleaved_Execute(_:_:_:)](accelerate/vdsp_dft_interleaved_execute(_:_:_:).md)
- [vDSP_DFT_Interleaved_ExecuteD(_:_:_:)](accelerate/vdsp_dft_interleaved_executed(_:_:_:).md)
- [vDSP_DFT_Interleaved_DestroySetup(_:)](accelerate/vdsp_dft_interleaved_destroysetup(_:).md)
- [vDSP_DFT_Interleaved_DestroySetupD(_:)](accelerate/vdsp_dft_interleaved_destroysetupd(_:).md)
