Rate this Page

torch.fft#

Created On: Aug 06, 2020 | Last Updated On: Jun 13, 2025

Discrete Fourier transforms and related functions.

Fast Fourier Transforms#

fft

Computes the one dimensional discrete Fourier transform ofinput.

ifft

Computes the one dimensional inverse discrete Fourier transform ofinput.

fft2

Computes the 2 dimensional discrete Fourier transform ofinput.

ifft2

Computes the 2 dimensional inverse discrete Fourier transform ofinput.

fftn

Computes the N dimensional discrete Fourier transform ofinput.

ifftn

Computes the N dimensional inverse discrete Fourier transform ofinput.

rfft

Computes the one dimensional Fourier transform of real-valuedinput.

irfft

Computes the inverse ofrfft().

rfft2

Computes the 2-dimensional discrete Fourier transform of realinput.

irfft2

Computes the inverse ofrfft2().

rfftn

Computes the N-dimensional discrete Fourier transform of realinput.

irfftn

Computes the inverse ofrfftn().

hfft

Computes the one dimensional discrete Fourier transform of a Hermitian symmetricinput signal.

ihfft

Computes the inverse ofhfft().

hfft2

Computes the 2-dimensional discrete Fourier transform of a Hermitian symmetricinput signal.

ihfft2

Computes the 2-dimensional inverse discrete Fourier transform of realinput.

hfftn

Computes the n-dimensional discrete Fourier transform of a Hermitian symmetricinput signal.

ihfftn

Computes the N-dimensional inverse discrete Fourier transform of realinput.

Helper Functions#

fftfreq

Computes the discrete Fourier Transform sample frequencies for a signal of sizen.

rfftfreq

Computes the sample frequencies forrfft() with a signal of sizen.

fftshift

Reorders n-dimensional FFT data, as provided byfftn(), to have negative frequency terms first.

ifftshift

Inverse offftshift().