FFT VI

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

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

2D FFT

For 2D signals, the FFT VI computes the discrete Fourier transform (DFT) of the input matrix. This VI performs a 1D FFT on the rows of the input matrix and then performs a 1D FFT on the columns of the output of the preceding step. The DFT of an M-by-N matrix is defined as:

for u = 0, 1, …, M–1, v=0, 1, …, N–1

where x is the input matrix and Y is the transform result.

The illustration below shows the effect of shift? on the 2D FFT result:

2D input signals FFT without shift FFT with shift

Examples

Refer to the following example files included with LabVIEW.

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