Fourier library: Operations in the Fourier domain
Scaling of Fourier transform in FFTW3

Fourier transformation in the FFTW3 library

The FFTW3 reference http://www.fftw.org/fftw3_doc/The-1d-Discrete-Fourier-Transform-_0028DFT_0029.html#The-1d-Discrete-Fourier-Transform-_0028DFT_0029 tells:

* 4.8.1 The 1d Discrete Fourier Transform (DFT)
*
* The forward (FFTW_FORWARD) discrete Fourier transform (DFT) of a 1d complex
* array X of size n computes an array Y, where:
*
*   Y_k = sum_{j=0}^{n-1} X_j exp(-2i pi j k / n)
* 
* The backward (FFTW_BACKWARD) DFT computes:
*
*   X_k = sum_{j=0}^{n-1} Y_j exp(+2i pi j k / n)
*
* FFTW computes an unnormalized transform, in that there is no coefficient in
* front of the summation in the DFT. In other words, applying the forward and
* then the backward transform will multiply the input by n.
*
* From above, an FFTW_FORWARD transform corresponds to a sign of -1 in the
* exponent of the DFT. Note also that we use the standard in-order output
* orderingthe k-th output corresponds to the frequency k/n (or k/T, where T
* is your total sampling period). For those who like to think in terms of
* positive and negative frequencies, this means that the positive frequencies
* are stored in the first half of the output and the negative frequencies are
* stored in backwards order in the second half of the output. (The frequency
* -k/n is the same as the frequency (n-k)/n.) 
* 

The forward transform is:

\[ Y_k = \sum_{j=0}^{n-1} X_j e^{-i 2 \pi \frac{j k}{n}} \]

The backward transform is:

\[ X_k = \sum_{j=0}^{n-1} Y_j e^{i 2 \pi \frac{j k}{n}} \]

Integral transform scaling

The Fourier transform presented here is scaled to represent the Fourier integral transform pair

\[ \tilde{s}(\omega) = \int\limits_{-\infty}^{+\infty} s(t)\,e^{-i\omega t}\frac{\textrm{d}\omega}{2\pi} = \int\limits_{0}^{N\Delta t} s(t)\,e^{-i\omega t}\frac{\textrm{d}\omega}{2\pi} \]

with $s(t)=0$ for $t<0$ and $t>T=N\Delta t$ and

\[ s(t) = \int\limits_{-\infty}^{+\infty} \tilde{s}(\omega)\,e^{i\omega t}\,\textrm{d}t = \int\limits_{-\pi/(N\Delta t)}^{+\pi/(N\Delta t)} \tilde{s}(\omega)\,e^{i\omega t}\,\textrm{d}t \]

with $\tilde{s}(\omega)=0$ for $|\omega|>\pi/T=\pi/(N\Delta t)$.

The FFTW3 transformation consequently has to be scaled according to

\[ Y_k = \sum_{j=0}^{N-1} X_j e^{-i 2 \pi \frac{j k}{N}} \Delta t \]

and

\[ X_k = \sum_{j=0}^{N-1} Y_j e^{i 2 \pi \frac{j k}{N}} \frac{1}{N\Delta t} \]

Where $X_k=s(t=k\Delta t)$ is the time series with $N$ samples at $\Delta t$ sampling interval. $Y_k=\tilde{s}(\omega=k\Delta \omega)$ are samples of the Fourier integral transform, where $\Delta\omega=2\pi/T$ and $T=N\Delta t$.

The library provides functions which return the appropriate scaling factors such that application of a inverse transformation in sequence with a forward transformation is an identity-operation.

See also
fourier::fft::DRFFTWAFFArrayEngine::scale_series, fourier::fft::DRFFTWAFFArrayEngine::scale_spectrum, fourier::fft::DRFFTWAFF::scale_series, fourier::fft::DRFFTWAFF::scale_spectrum