Function vector_forward_fft (o2scl)¶
-
void o2scl::vector_forward_fft(const std::vector<double> &data, std::vector<std::complex<double>> &fft)¶
A one-dimensional FFTW wrapper for a forward FFT of real data.
This function does not require any copying of the input or output arrays. The FFTW_ESTIMATE flag is used and so little or no optimization of the FFTW algorithm is performed. Given an input vector of size n, the output vector is resized to have size \( n/2+1 \) .
(FFTW is best at handling sizes of the form \( 2^a 3^b 5^c 7^d 11^e 13^f \) where \( e+f \) is either 0 or 1, and the other exponents are arbitrary. Also, it is generally beneficial for the last dimension of a real to complex or complex to real transform to be even.)