Learn R Programming

torch (version 0.8.1)

torch_fft_fft: Fft

Description

Computes the one dimensional discrete Fourier transform of input.

Usage

torch_fft_fft(self, n = NULL, dim = -1L, norm = NULL)

Arguments

self

(Tensor) the input tensor

n

(int) Signal length. If given, the input will either be zero-padded or trimmed to this length before computing the FFT.

dim

(int, optional) The dimension along which to take the one dimensional FFT.

norm

(str, optional) Normalization mode. For the forward transform, these correspond to:

  • "forward" - normalize by 1/n

  • "backward" - no normalization

  • "ortho" - normalize by 1/sqrt(n) (making the FFT orthonormal) Calling the backward transform (ifft()) with the same normalization mode will apply an overall normalization of 1/n between the two transforms. This is required to make IFFT the exact inverse. Default is "backward" (no normalization).

Examples

Run this code
if (torch_is_installed()) {
t <- torch_arange(start = 0, end = 3)
t
torch_fft_fft(t, norm = "backward")

}

Run the code above in your browser using DataLab