Table Of Contents

FFT (G Dataflow)

Last Modified: January 9, 2017

Computes the fast Fourier transform (FFT) of a sequence.

connector_pane_image
datatype_icon

x

A real vector.

This input accepts the following data types:

  • 1D array of double-precision, floating-point numbers
  • 1D array of complex double-precision, floating-point numbers
  • 2D array of double-precision, floating-point numbers
  • 2D array of complex double-precision, floating-point numbers
datatype_icon

FFT size

The length of the FFT you want to perform. If FFT size is greater than the number of elements in x, this node 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 node 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 node uses the length of x as the FFT size.

datatype_icon

shift?

A Boolean that determines whether the DC component is at the center of the FFT of the input sequence.

True The DC component is at the center of the FFT{x}.
False The DC component is not at the center of the FFT{x}.

How This Input Affects 1D FFT

The following table illustrates the pattern of the elements of FFT{x} with various length of the FFT, when shift? is False. Y is FFT{x} and n is the length of the FFT:

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

The following table illustrates the pattern of the elements of FFT{x} with various length of the FFT, when shift? is True. Y is FFT{x} and n is the length of the FFT:

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

How This Input Affects 2D FFT

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

2D input signals FFT without shift FFT with shift

Default: False

datatype_icon

error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

datatype_icon

FFT{x}

FFT of the input signal.

This output can be a 1D or 2D array of complex double-precision, floating-point numbers.

datatype_icon

error out

Error information. The node produces this output according to standard error behavior.

Algorithm Definition for 1D FFT

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

Y k = n = 0 N 1 x n e j 2 π k n / N 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:

Δ f = f s N

where fs is the sampling frequency.

Algorithm Definition for 2D FFT

For 2D signals, this node computes the discrete Fourier transform (DFT) of the input matrix. This node 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:

Y ( u , v ) = m = 0 M 1 n = 0 N 1 x ( m , n ) e j 2 π m u / M e j 2 π n v / N for u = 0 , 1 , ... , M 1 , v = 0 , 1 , ... , N 1

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

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported


Recently Viewed Topics