Fast Fourier Transforms

No overview available.

Topics

First Steps

Finding the Component Frequencies in a Composite Sine Wave

Use 1D fast Fourier transform to compute the frequency components of a signal.

Halftone Descreening with 2D Fast Fourier Transform

Reduce or remove periodic artifacts from images.

Objects that Simplify Fast Fourier Transforms

class vDSP.FFT

A 1D single- and double-precision fast Fourier transform.

class vDSP.FFT2D

A 2D single- and double-precision fast Fourier transform.

enum vDSP.FourierTransformDirection

Fast Fourier transform directions.

enum vDSP.Radix

Fast Fourier transform radices.

1D Fast Fourier Transforms (Support Functions)

func vDSP_create_fftsetup(vDSP_Length, FFTRadix) -> FFTSetup?

Builds a data structure that contains precalculated data for use by single-precision FFT 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.

1D Fast Fourier Transforms (In-Place Real)

The set of in-place real fast Fourier transform routines includes:

Table 1

In-place real fast Fourier transform routines

Single-precision

Double-precision

Does not use temporary buffer

vDSP_fft_zrip

vDSP_fft_zripD(_:_:_:_:_:)

Uses temporary buffer

vDSP_fft_zript(_:_:_:_:_:_:)

vDSP_fft_zriptD(_:_:_:_:_:_:)

Multiple signals; does not use temporary buffer

vDSP_fftm_zrip(_:_:_:_:_:_:_:)

vDSP_fftm_zripD(_:_:_:_:_:_:_:)

Multiple signals; uses temporary buffer

vDSP_fftm_zript(_:_:_:_:_:_:_:_:)

vDSP_fftm_zriptD(_:_:_:_:_:_:_:_:)

The temporary buffer versions can use a temporary buffer passed as a parameter for improved performance.

Call the vDSP_create_fftsetup function before you call the single precision routines to obtain an FFTSetup object that must remain available when you call the transform routine.

Call the vDSP_create_fftsetupD(_:_:) function before you call the double precision routines to obtain an FFTSetupD object that must remain available when you call the transform routine.

Use the DFT routines instead of these wherever possible. (For example, instead of calling vDSP_fft_zrip with a setup created with vDSP_create_fftsetup, call vDSP_DFT_Execute(_:_:_:_:_:) with a setup created with vDSP_DFT_zrop_CreateSetup(_:_:_:).)

func vDSP_fft_zrip(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an in-place single-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zripD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an in-place double-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zript(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, FFTDirection)

Computes an in-place single-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse). Usesa temporary buffer to improve performance.

func vDSP_fft_zriptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, FFTDirection)

Computes an in-place double-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

1D Fast Fourier Transforms (Out-of-Place Real)

The set of out-of-place real fast Fourier transform routines includes:

Table 2

Out-of-place real fast Fourier transform routines

The temporary buffer versions can use a temporary buffer passed as a parameter for improved performance.

Call the vDSP_create_fftsetup function before you call the single precision routines to obtain an FFTSetup object that must remain available when you call the transform routine.

Call the vDSP_create_fftsetupD(_:_:) function before you call the double precision routines to obtain an FFTSetupD object that must remain available when you call the transform routine.

Use the DFT routines instead of these wherever possible. (For example, instead of calling vDSP_fft_zrop with a setup created with vDSP_create_fftsetup, call vDSP_DFT_Execute(_:_:_:_:_:) with a setup created with vDSP_DFT_zrop_CreateSetup(_:_:_:).)

func vDSP_fft_zrop(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zropD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zropt(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zroptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision real discrete Fourier transform, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

1D Fast Fourier Transforms (In-Place Complex)

The set of in-place complex discrete Fourier transform routines includes:

Table 3

In-place complex fast Fourier transform routines

Single-precision

Double-precision

Does not use temporary buffer

vDSP_fft_zip(_:_:_:_:_:)

vDSP_fft_zipD(_:_:_:_:_:)

Uses temporary buffer

vDSP_fft_zipt(_:_:_:_:_:_:)

vDSP_fft_ziptD(_:_:_:_:_:_:)

Multiple signals; does not use temporary memory

vDSP_fftm_zip(_:_:_:_:_:_:_:)

vDSP_fftm_zipD(_:_:_:_:_:_:_:)

Multiple signals; uses temporary memory

vDSP_fftm_zipt(_:_:_:_:_:_:_:_:)

vDSP_fftm_ziptD(_:_:_:_:_:_:_:_:)

The temporary buffer versions can use a temporary buffer passed as a parameter for improved performance.

Call the vDSP_create_fftsetup function before you call the single precision routines to obtain an FFTSetup object that must remain available when you call the transform routine.

Call the vDSP_create_fftsetupD(_:_:) function before you call the double precision routines to obtain an FFTSetupD object that must remain available when you call the transform routine.

Use the DFT routines instead of these wherever possible. (For example, instead of calling vDSP_fft_zip with a setup created with vDSP_create_fftsetup, call vDSP_DFT_Execute(_:_:_:_:_:) with a setup created with vDSP_DFT_zop_CreateSetup(_:_:_:).)

func vDSP_fft_zip(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an in-place single-precision complex discrete Fourier transform of the input/output vector signal, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse). Does not use temporary memory.

func vDSP_fft_zipD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an in-place double-precision complex discrete Fourier transform of the input/output vector signal, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse). Does not use temporary memory.

func vDSP_fft_zipt(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, FFTDirection)

Performs the same operation as the vDSP_fft_zip(_:_:_:_:_:) function but uses a temporary buffer to hold intermediate results for improved performance. Computes an in-place single-precision complex discrete Fourier transform of the input/output vector signal, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_ziptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, FFTDirection)

Performs the same operation as the vDSP_fft_zipD(_:_:_:_:_:) function but uses A temporary buffer for improved performance. Computes an in-place double-precision complex discrete Fourier transform of the input/output vector signal, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fftm_ziptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Performs the same operation as vDSP_fft_ziptD(_:_:_:_:_:_:), but on multiple signals with a single call. Performs the same operation as the vDSP_fftm_zipD(_:_:_:_:_:_:_:) function but uses a temporary buffer for improved performance.

1D Fast Fourier Transforms (Out-of-Place Complex)

The set of out-of-place complex discrete Fourier transform routines includes:

Table 4

Out-of-place complex fast Fourier transform routines

The temporary buffer versions can use a temporary buffer passed as a parameter for improved performance.

Call the vDSP_create_fftsetup function before you call the single precision routines to obtain an FFTSetup object that must remain available when you call the transform routine.

Call the vDSP_create_fftsetupD(_:_:) function before you call the double precision routines to obtain an FFTSetupD object that must remain available when you call the transform routine.

Use the DFT routines instead of these wherever possible. (For example, instead of calling vDSP_fft_zip with a setup created with vDSP_create_fftsetup, call vDSP_DFT_Execute(_:_:_:_:_:) with a setup created with vDSP_DFT_zop_CreateSetup(_:_:_:).)

func vDSP_fft_zop(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision complex discrete Fourier transform of the input vector, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zopD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision complex discrete Fourier transform of the input vector, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zopt(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision complex discrete Fourier transform of the input vector, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft_zoptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision complex discrete Fourier transform of the input vector, either from the time domain to the frequency domain (forward) or from the frequency domain to the time domain (inverse).

func vDSP_fft3_zop(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place radix-3 complex Fourier transform, either forward or inverse. The number of input and output values processed equals 3 times the power of 2 specified by parameter Log2N; single precision.

Deprecated
func vDSP_fft3_zopD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place radix-3 complex Fourier transform, either forward or inverse. The number of input and output values processed equals 3 times the power of 2 specified by parameter Log2N; double precision.

Deprecated
func vDSP_fft5_zop(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place radix-5 complex Fourier transform, either forward or inverse. The number of input and output values processed equals 5 times the power of 2 specified by parameter Log2N; single precision.

Deprecated
func vDSP_fft5_zopD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Length, FFTDirection)

Computes an out-of-place radix-5 complex Fourier transform, either forward or inverse. The number of input and output values processed equals 5 times the power of 2 specified by parameter Log2N; double precision.

Deprecated

2D Fast Fourier Transforms (In-Place Complex)

func vDSP_fft2d_zip(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place single-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zipD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place double-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zipt(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place single-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

func vDSP_fft2d_ziptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place double-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

2D Fast Fourier Transforms (Out-of-Place Complex)

func vDSP_fft2d_zop(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zopD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zopt(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

func vDSP_fft2d_zoptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision complex discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

2D Fast Fourier Transforms (In-Place Real)

func vDSP_fft2d_zrip(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place single-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zripD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place double-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zript(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place single-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

func vDSP_fft2d_zriptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an in-place double-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

2D Fast Fourier Transforms (Out-of-Place Real)

func vDSP_fft2d_zrop(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zropD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse).

func vDSP_fft2d_zropt(FFTSetup, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place single-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

func vDSP_fft2d_zroptD(FFTSetupD, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Stride, vDSP_Stride, UnsafePointer<DSPDoubleSplitComplex>, vDSP_Length, vDSP_Length, FFTDirection)

Computes an out-of-place double-precision real discrete FFT, either from the spatial domain to the frequency domain (forward) or from the frequency domain to the spatial domain (inverse). A buffer is used for intermediate results.

Data Types

typealias FFTSetup

An opaque type that contains setup information for a given FFT transform.

typealias FFTSetupD

An opaque type that contains setup information for a given double-precision FFT transform.

Constants

typealias FFTDirection

Specifies whether to perform a forward or inverse FFT.

typealias FFTRadix

The size of the FFT decomposition.

FFTWindow

Specifies the windowing mode for data values in an FFT or reverse FFT.