Computes the fast Fourier transform (FFT) of the input sequence X. Wire data to the X input to determine the polymorphic instance to use or manually select the instance.


icon

Inputs/Outputs

  • c1dcdb.png X

    X is the complex valued input sequence.

  • cbool.png shift?

    shift? specifies whether the DC component is at the center of FFT {X}. The default is FALSE.

  • ci32.png FFT size

    FFT size is the length of the FFT you want to perform.

    If FFT size is greater than the number of elements in X, this VI adds zeros to the end of X to match the size of FFT size. If FFT size is less than the number of elements in X, this VI uses only the first n elements in X to perform the FFT, where n is FFT size. If FFT size is less than or equal to 0, this VI uses the length of X as the FFT size.

  • i1dcdb.png FFT {X}

    FFT {X} is the FFT of X.

  • ii32.png error

    error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

  • 1D FFT

    For 1D signals, the FFT VI computes the discrete Fourier transform (DFT) of the input sequence with a fast Fourier transform algorithm. The 1D DFT is defined as:

    for n = 0, 1, 2, …, N–1

    where x is the input sequence, N is the number of elements of x, and Y is the transform result.

    The frequency resolution, or the frequency spacing between the components of Y, is:

    where fs is the sampling frequency.

    The following table illustrates the pattern of the elements of FFT {X} for various FFT size and shift values, where Y is FFT {X} and n is the FFT size:

    n is even (k = n/2)n is odd (k = (n-1)/2)
    Shift Array Element Corresponding Frequency Array Element Corresponding Frequency

    FALSE

    (default)

    Y0 DC component Y0 DC component

    FALSE

    (default)

    Y1 Δf Y1 Δf

    FALSE

    (default)

    Y2 f Y2 f

    FALSE

    (default)

    Y3 f Y3 f

    FALSE

    (default)

    Yk–2 (k–2)Δf Yk–2 (k–2)Δf

    FALSE

    (default)

    Yk–1 (k–1)Δf Yk–1 (k–1)Δf

    FALSE

    (default)

    Yk Nyquist Frequency Yk kΔf

    FALSE

    (default)

    Yk+1 –(k–1)Δf Yk+1 kΔf

    FALSE

    (default)

    Yk+2 –(k–2)Δf Yk+2 –(k–1)Δf

    FALSE

    (default)

    Yn–3 –3Δf Yn–3 –3Δf

    FALSE

    (default)

    Yn–2 –2Δf Yn–2 –2Δf

    FALSE

    (default)

    Yn–1 –Δf Yn–1 –Δf
    n is even (k = n/2)n is odd (k = (n-1)/2)
    Shift Array Element Corresponding Frequency Array Element Corresponding Frequency
    TRUE Y0 –(Nyquist Frequency) Y0 kΔf
    TRUE Y1 –(k–1)Δf Y1 –(k–1)Δf
    TRUE Y2 –(k–2)Δf Y2 –(k–2)Δf
    TRUE Y3 –(k–3)Δf Y3 –(k–3)Δf
    TRUE Yk–2 –2Δf Yk–2 –2Δf
    TRUE Yk–1 –Δf Yk–1 –Δf
    TRUE Yk DC component Yk DC component
    TRUE Yk+1 Δf Yk+1 Δf
    TRUE Yk+2 f Yk+2 f
    TRUE Yn–3 (k–3)Δf Yn–3 (k–2)Δf
    TRUE Yn–2 (k–2)Δf Yn–2 (k–1)Δf
    TRUE Yn–1 (k–1)Δf Yn–1 kΔf

    Related Information

    Output Units for FFT-Based Vis

    Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Signal Processing\Transforms\FFT and Power Spectrum Units.vi