Fourier Transform

There are four different nodes for computation of the discrete Fourier transform:
  • SignalProcessing.Compute.Transform.Fourier
  • SignalProcessing.Compute.Transform.FourierInverse
  • SignalProcessing.Compute.Transform.FourierReal
  • SignalProcessing.Compute.Transform.FourierRealInverse

SignalProcessing.Compute.Transform.Fourier

This node computes the complex Discrete Fourier Transform (DFT) of a periodic complex function $\mathrm{f}[n]$ of period $N$ with:

$\mathrm{F}[u] = \sum\limits_{n=0}^{N-1} \mathrm{f}[n] \, e^{-2 \pi i \frac{n\, u}{N} } \quad \quad \forall \, \, u \in [0;N-1] \quad.$
The real and imaginary part of $\mathrm{f}[n]$ are set via the two input slots. The two outputs are the real and imaginary part of $\mathrm{F}[u]$.
If $N$ is a power of two (e.g., 2, 4, 8, 16, 32, 64, etc.) the computation is performed by a Fast Fourier Transfom (FFT) algorithm.

SignalProcessing.Compute.Transform.FourierInverse

This node computes the complex Inverse Discrete Fourier Transform (IDFT):

$\mathrm{f}[n] = \frac{1}{N} \sum\limits_{u=0}^{N-1} \mathrm{F}[u] \, e^{2 \pi i \, \frac{n\, u}{N} } \quad \quad \forall \, \, n \in [0;N-1] \quad.$
The real and imaginary part of $\mathrm{F}[u]$ are set via the two input slots. The two outputs are the real and imaginary part of $\mathrm{f}[n]$.
If $N$ is a power of two (e.g., 2, 4, 8, 16, 32, 64, etc.) the computation is performed by a Fast Fourier Transform (FFT) algorithm.

SignalProcessing.Compute.Transform.FourierReal

This node computes the complex Discrete Fourier Transform (DFT) of a periodic real function $\mathrm{f}[n]$ of period $N$. For a real input $\mathrm{f}[n]$ the real and imaginary part of $F(u)$ can be computed separately

$\operatorname{Re}(\mathrm{F}[u]) = \sum\limits_{n=0}^{N-1} \mathrm{f}[n] \, \cos(2 \pi \frac{n\, u}{N}) \quad$ and $\quad \operatorname{Im}(\mathrm{F}[u]) = -\sum\limits_{n=0}^{N-1} \mathrm{f}[n] \, \sin(2 \pi \frac{n\, u}{N}) \quad.$
The real part of $F[u]$ with $u \in [0, N-1]$ is symmetric and the imaginary part is anti-symmetric. Thus, it holds:
$\operatorname{Re}(\mathrm{F}[u]) = \operatorname{Re}(\mathrm{F}[N-u])\quad$ und $\quad\operatorname{Im}(\mathrm{F}[u]) = -\operatorname{Im}(\mathrm{F}[N-u])$
As a consequence, for a real input signal $f[n]$ only the coefficients $\mathrm{F}[u]$ for $0 \le u \le N/2$ need to be computed and stored. Therefore, the real and imaginary part of $\mathrm{F}[u]$ at the output slots of the node have a length of $N/2 + 1$. This is the main difference to the FourierTransformNode for which the length of the output is $N$.

SignalProcessing.Compute.Transform.FourierRealInverse

This node computes the complex Inverse Discrete Fourier Transform (IDFT) if the real and imaginary part of $\mathrm{F}[u]$ at the input were computed from a real signal and only $N/2 + 1$ coefficients are stored:

In this case the IDFT is given by:

$f[n] = \frac{1}{N} \sum\limits_{u=0}^{N/2} \mathrm{w}[u] \left(\operatorname{Re}(\mathrm{F}[u]) \cos\left(2 \pi \frac{n\, u}{N} \right) - \operatorname{Im}(\mathrm{F}[u]) \sin\left(2 \pi \frac{n\, u}{N} \right) \right) \quad,$
where all summands except for $u=0$ and $u=N/2$ need to be weighted double:
$\mathrm{w}[u] = \begin{cases} 1 & \,\,:\,\, u = 0 \lor u=N/2\\ 2 & \,\,:\,\, u \ne 0 \land u \ne N/2 \end{cases}$
The length of the real output signal is $N$.
The example DFT demonstrates the basic usage of these nodes.