Function

vDSP_create_fftsetup(_:_:)

Builds a data structure that contains precalculated data for use by single-precision FFT functions.

Declaration

func vDSP_create_fftsetup(_ __Log2n: vDSP_Length, _ __Radix: FFTRadix) -> FFTSetup?

Parameters

__Log2n

The base-two logarithm of the maximum number of elements to be transformed. (Subsequent calls to FFT functions using the resulting setup may transform this length or less.)

__Radix

Specifies radix options. Radix 2, radix 3, and radix 5 functions are supported.

Return Value

Returns an FFTSetup structure for use with one-dimensional FFT functions. Returns 0 on error.

Discussion

This function returns a filled-in FFTSetup data structure for use by FFT functions that operate on single-precision vectors. Once prepared, the setup structure can be used repeatedly by FFT functions (which read the data in the structure and do not alter it) for any (power of two) length up to that specified when you created the structure.

If an application performs FFTs with diverse lengths, the calls with different lengths can share a single setup structure (created for the longest length), and this saves space over having multiple structures.

Parameter Log2n is a base-two exponent and specifies that the largest transform length that can processed using the resulting setup structure is 2**Log2n (or 3*2**Log2n or 5*2**Log2n if the appropriate flags are passed, as discussed below). That is, the Log2n parameter must equal or exceed the value passed to any subsequent FFT routine using the setup structure returned by this routine.

Parameter Radix specifies radix options. Its value may be the bitwise OR of any combination of kFFTRadix2, kFFTRadix3, or kFFTRadix5. The resulting setup structure may be used with any of the routines for which the respective flag was used. (The radix-3 and radix-5 FFT routines have "fft3" and "fft5" in their names. The radix-2 FFT routines have plain "fft" in their names.)

If zero is returned, the routine failed to allocate storage.

The setup structure is deallocated by calling vDSP_destroy_fftsetup.

Use vDSP_create_fftsetup during initialization. It is relatively slow compared to the routines that actually perform FFTs. Never use it in a part of an application that needs to be high performance.

See Also

1D Fast Fourier Transforms (Support Functions)

func vDSP_create_fftsetupD(vDSP_Length, FFTRadix) -> FFTSetupD?

Builds a data structure that contains precalculated data for use by double-precision FFT functions.

func vDSP_destroy_fftsetup(FFTSetup?)

Frees an existing single-precision FFT data structure.

func vDSP_destroy_fftsetupD(FFTSetupD?)

Frees an existing double-precision FFT data structure.