This node converts the complex output of a discrete Fourier transform (DFT) with a real and imaginary part to a magnitude and phase representation. The real $\mathrm{r}[n]$ and imaginary $\mathrm{i}[n]$ part of the DFT are set via the two input slots. The format of the magnitude signal $\mathrm{m}[n]$ can be selected via the format input slot:

  • Format = 0: (standard)
    $\mathrm{m}[n] = \sqrt{\mathrm{r}[n]^2 + \mathrm{i}[n]^2} $
  • Format = 1: (dB)
    $\mathrm{m}[n] = 20 \log \left(\sqrt{\mathrm{r}[n]^2 + \mathrm{i}[n]^2}\right) $
  • Format = 2: (normalized)
    $\mathrm{m}[n] = \sqrt{\mathrm{r}[n]^2 + \mathrm{i}[n]^2} / N $
    where $N$ is the length of input signals $\mathrm{r}[n]$ and $\mathrm{i}[n]$.

The phase signal $\mathrm{p}[n]$ is computed by:

$\mathrm{p}[n] = \begin{cases} \operatorname{atan2}(\mathrm{i}[n], \mathrm{r}[n]) & : |\mathrm{r}[n]| \ge t \, \lor \, |\mathrm{i}[n]| \ge t \\ 0 & : |\mathrm{r}[n]| < t \, \land \, |\mathrm{i}[n]| < t\\ \end{cases}$
The threshold $t$ can be set via the phase threshold input slot. If the absolute values of the real and imaginary part are below this threshold, the phase is set to zero.