Magnitude Squared DFT of Gaussian data

This building block considers the DFT of Gaussian data followed by the computation of the magnitude-squared of the bins. Like the previous example, this belongs to a general class of chi-squared feature extractors fitting within the “Gaussian" row of Table 3.1. The energy statistic in all of these problems is the total energy. In the case of DFT magnitude-squared, the ES is contained implicitly (Parseval's theorem). Let $N$ be even and

$\displaystyle z_k = \left\vert\sum_{i=1}^{N} x_i \; e^{-j 2 \pi (k-1) (i-1)/N}\right\vert^2,
\;\;\; 1\leq k \leq N/2+1.$

The DFT bins are independent under $H_0$, but not identically distributed. DFT bins 0 and $N/2$ are real-valued so $z_k$ have the Chi-squared distribution with 1 degree of freedom scaled by $N$, which we denote by $p_0(z)$:

$\displaystyle p_0(z) = \frac{1}{N\sqrt{2\pi}}\; (z/N)^{-1/2} \; \exp\left\{
-\frac{z}{2N}\right\}.
$

DFT bins 1 through $N/2-1$ are complex so $z_k$ have the Chi-squared distribution with 2 degrees of freedom scaled by $N/2$, which we denote by $p_1(z)$:

$\displaystyle p_1(z) = \frac{1}{N}\; \exp\left\{-\frac{z}{N}\right\}.
$

The complete PDF $p({\bf z}\vert H_0)$ is

$\displaystyle \log p({\bf z}\vert H_0) = \log p_0(z_0) + \sum_{k=1}^{N/2}
\log p_1(z_k) + \log p_0(z_{N/2}).$ (4.1)

The J-function, $\log J = \log p({\bf x}\vert H_0) - \log p({\bf z}\vert H_0)$ can be simplified for even $N$ to

$\displaystyle \log J = \frac{\log z_1 + \log z_{N/2+1}}{2}
+ \frac{N}{2} \log N - \frac{N-2}{2} \log(2\pi) ,$

which interestingly is data independent except with respect to the zero and Nyquist frequency bins. For more information, refer to the software module software/module_dftmsq.m.

Re-synthesis of ${\bf x}$ from ${\bf z}$ using UMS (Section 3.3) is accomplished first by taking the square-root of each bin. We then multiply the zero and Nyquist bins ($z_1$ and $z_{N/2+1}$ for even $N$) by 1 or -1, each with probability 1/2. The remaining bins are multiplied by a phase term $e^{j\phi_k}$, where $\phi_k$ are independent RV uniformly distributed on the interval $[0,\;2\pi]$. Finally, the length-$N$ DFT vector is created by appending the conjugate of the complex bins, then taking the inverse DFT to obtain ${\bf x}$. For more information, refer to the software module software/module_dftmsq_synth.m.