torch_fft_rfft {torch} | R Documentation |
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:
|
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)
}