Real-to-complex Discrete Fourier Transform
This method computes the real-to-complex discrete Fourier transform. It is
mathematically equivalent with torch_fft
with differences only in
formats of the input and output.
This method supports 1D, 2D and 3D real-to-complex transforms, indicated
by signal_ndim
. input
must be a tensor with at least
signal_ndim
dimensions with optionally arbitrary number of leading batch
dimensions. If normalized
is set to TRUE
, this normalizes the result
by dividing it with \(\sqrt{\prod_{i=1}^K N_i}\) so that the operator is
unitary, where \(N_i\) is the size of signal dimension \(i\).
The real-to-complex Fourier transform results follow conjugate symmetry:
$$
X[\omega_1, \dots, \omega_d] = X^*[N_1 - \omega_1, \dots, N_d - \omega_d],
$$
where the index arithmetic is computed modulus the size of the corresponding
dimension, \(\ ^*\) is the conjugate operator, and
\(d\) = signal_ndim
. onesided
flag controls whether to avoid
redundancy in the output results. If set to TRUE
(default), the output will
not be full complex result of shape \((*, 2)\), where \(*\) is the shape
of input
, but instead the last dimension will be halfed as of size
\(\lfloor \frac{N_d}{2} \rfloor + 1\).
The inverse of this function is torch_irfft
.