Last Modified: June 25, 2019

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

A Boolean that specifies whether to reset the internal state of the node.

True | Resets the internal state of the node. |

False | Does not reset the internal state of the node. |

This input is available only if you wire a double-precision, floating-point number or a complex double-precision, floating-point number to **x**.

**Default: **False

Input signal.

This input accepts the following data types:

- Double-precision, floating-point number
- Complex double-precision, floating-point number
- 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

Length of the FFT you want to perform.

This input changes to **m** if you wire a 2D array of double-precision, floating-point numbers or a 2D array of complex double-precision, floating-point numbers to **x**.

Node Behavior When **x** is a 1D Array of Numbers

When you wire a 1D array of double-precision, floating-point numbers or a 1D array of complex double-precision, floating-point numbers to **x**, 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**.

Node Behavior When **x** is a Single Data Point

When you wire a double-precision, floating-point number or a complex double-precision, floating-point number to **x**, if **FFT size** is greater than **sample length**, this node collects data according to **sample length** but adds zeros to the end of the data set to match the size of **FFT size**. If **FFT size** is less than **sample length**, this node ignores **sample length** and uses only the first *n* elements in the data set to perform the FFT, where *n* is **FFT size**. If **FFT size** is less than or equal to 0, this node uses **sample length** as the **FFT size**.

**Default: **-1

Number of rows of the 2D FFT. This node truncates or zero-pads **x** to an **m** × **n** array before performing the FFT.

This input is available only if you wire a 2D array of double-precision, floating-point numbers or a 2D array of complex double-precision, floating-point numbers to **x**.

**Default: **-1

Length of each set of data. The node performs computation for each set of data.

**sample length** must be greater than zero.

This input is available only if you wire a double-precision, floating-point number or a complex double-precision, floating-point number to **x**.

**Default: **100

Number of columns of the 2D FFT. This node truncates or zero-pads **x** to an **m** × **n** array before performing the FFT.

This input is available only if you wire a 2D array of double-precision, floating-point numbers or a 2D array of complex double-precision, floating-point numbers to **x**.

**Default: **-1

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}. |

This input is available only if you wire one of the following data types to **x**:

- 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

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 |

Y_{0} |
DC component | Y_{0} |
DC component |

Y_{1} |
Δf |
Y_{1} |
Δf |

Y_{2} |
2Δf |
Y_{2} |
2Δf |

Y_{3} |
3Δf |
Y_{3} |
3Δf |

$\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ |

Y_{k-2} |
(k - 2)Δf |
Y_{k-2} |
(k - 2)Δf |

Y_{k-1} |
(k - 1)Δf |
Y_{k-1} |
(k - 1)Δf |

Y_{k} |
Nyquist Frequency | Y_{k} |
kΔf |

Y_{k+1} |
-(k - 1)Δf |
Y_{k+1} |
-kΔf |

Y_{k+2} |
-(k - 2)Δf |
Y_{k+2} |
-(k - 1)Δf |

$\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ |

Y_{n-3} |
-3Δf |
Y_{n-3} |
-3Δf |

Y_{n-2} |
-2Δf |
Y_{n-2} |
-2Δf |

Y_{n-1} |
-Δf |
Y_{n-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 |

Y_{0} |
-(Nyquist Frequency) | Y_{0} |
-kΔf |

Y_{1} |
-(k - 1)Δf |
Y_{1} |
-(k - 1)Δf |

Y_{2} |
-(k - 2)Δf |
Y_{2} |
-(k - 2)Δf |

Y_{3} |
-(k - 3)Δf |
Y_{3} |
-(k - 3)Δf |

$\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ |

Y_{k-2} |
-2Δf |
Y_{k-2} |
-2Δf |

Y_{k-1} |
-Δf |
Y_{k-1} |
-Δf |

Y_{k} |
DC component | Y_{k} |
DC component |

Y_{k+1} |
Δf |
Y_{k+1} |
Δf |

Y_{k+2} |
2Δf |
Y_{k+2} |
2Δf |

$\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ | $\begin{array}{c}\cdot \\ \cdot \\ \cdot \end{array}$ |

Y_{n-3} |
(k - 3)Δf |
Y_{n-3} |
(k - 2)Δf |

Y_{n-2} |
(k - 2)Δf |
Y_{n-2} |
(k - 1)Δf |

Y_{n-1} |
(k - 1)Δf |
Y_{n-1} |
kΔf |

How This Input Affects 2D FFT

**Default: **False

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

FFT of the input signal.

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

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

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}=\underset{n=0}{\overset{N-1}{\sum}}{x}_{n}{e}^{-j2\pi kn/N}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\mathrm{for}\text{\hspace{0.17em}}n=0,\text{\hspace{0.17em}}1,\text{\hspace{0.17em}}2,\text{\hspace{0.17em}}\mathrm{...},\text{\hspace{0.17em}}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:

$\mathrm{\Delta}f=\frac{{f}_{s}}{N}$

where *f*_{s} is the sampling frequency.

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)=\underset{m=0}{\overset{M-1}{\sum}}\underset{n=0}{\overset{N-1}{\sum}}x(m,n){e}^{-j2\pi mu/M}{e}^{-j2\pi nv/N}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\mathrm{for}\text{\hspace{0.17em}}\text{\hspace{0.17em}}u=0,\text{\hspace{0.17em}}1,\text{\hspace{0.17em}}\mathrm{...},\text{\hspace{0.17em}}M-1,\text{\hspace{0.17em}}v=0,\text{\hspace{0.17em}}1,\text{\hspace{0.17em}}\mathrm{...},\text{\hspace{0.17em}}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

Web Server: Not supported in VIs that run in a web application