Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

torch_fft_rfft

Rfft


Description

Computes the one dimensional Fourier transform of real-valued input.

Usage

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

Arguments

self

(Tensor) the real input tensor

n

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

dim

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

norm

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 (torch_fft_irfft()) with the same normalization mode will apply an overall normalization of 1/n between the two transforms. This is required to make irfft() the exact inverse. Default is "backward" (no normalization).

Details

The FFT of a real signal is Hermitian-symmetric, X[i] = conj(X[-i]) so the output contains only the positive frequencies below the Nyquist frequency. To compute the full output, use torch_fft_fft().

Examples

if (torch_is_installed()) {
t <- torch_arange(start = 0, end = 3)
torch_fft_rfft(t)

}

torch

Tensors and Neural Networks with 'GPU' Acceleration

v0.3.0
MIT + file LICENSE
Authors
Daniel Falbel [aut, cre, cph], Javier Luraschi [aut], Dmitriy Selivanov [ctb], Athos Damiani [ctb], Christophe Regouby [ctb], Krzysztof Joachimiak [ctb], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.