---
title: vDSP_create_fftsetup
framework: accelerate
role: symbol
role_heading: Function
path: accelerate/vdsp_create_fftsetup
---

# vDSP_create_fftsetup

Returns a setup structure that contains precalculated data for single-precision FFT functions.

## Declaration

```occ
extern FFTSetupvDSP_create_fftsetup(vDSP_Length __Log2n, FFTRadix __Radix);
```

## Parameters

- `__Log2n`: The base-two logarithm of the maximum number of elements the setup structure transforms. Subsequent calls to FFT functions using the resulting setup may transform this length or less.
- `__Radix`: Specifies radix options. This function only supports radix-2; other radices are deprecated. Use the doc://com.apple.documentation/documentation/Accelerate/discrete-fourier-transforms for radix-3, and radix-5.

## Return Value

Return Value Returns an FFTSetup structure for use with FFT functions. Returns 0 on error.

## Discussion

Discussion Use this function to create a weights array of complex exponential values that the vDSP FFT functions use for forward transforms. Precalculating these values during, for example, your app’s initialization, boosts FFT performance. You can use the same setup structure to perform transformations on vectors that contain up to 2Log2n elements. For 2D transformations, specify Log2n as the greater of the number of rows and the number of columns. Call vDSP_destroy_fftsetup to deallocate the setup structure. tip: To learn how the vDSP library scales and arranges the FFT output, see Understanding data packing for Fourier transforms.

## 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)

### FFT Setup

- [vDSP_create_fftsetupD](accelerate/vdsp_create_fftsetupd.md)
- [vDSP_destroy_fftsetup](accelerate/vdsp_destroy_fftsetup.md)
- [vDSP_destroy_fftsetupD](accelerate/vdsp_destroy_fftsetupd.md)
- [vDSP_DFT_CreateSetup](accelerate/vdsp_dft_createsetup.md)
- [FFTSetup](accelerate/fftsetup.md)
- [FFTSetupD](accelerate/fftsetupd.md)
- [FFTRadix](accelerate/fftradix.md)
