# Demystifying DFT-Based Harmonic Phase Estimation, Transformation, and Synthesis
## 2 Robust DFT-Based Phase Estimation of Individual Sinusoids
### ODFT and the Rectangular Window  
An N-point DFT corresponds to a filter bank whose N sub-bands are 'evenly stacked', i.e., their center frequencies correspond to \(\frac{\pi}{N}(2k)\), \(k=0,1,\ldots,N-1\). An alternative option involves 'oddly stacked' sub-bands, i.e., their center frequencies correspond to \(\frac{\pi}{N}(2k+1)\), \(k=0,1,\ldots,N-1\). In this case, the time-frequency transformation results as  
\[X[k]=\sum_{n=0}^{N-1}x[n]w[n]e^{-j\frac{2\pi}{N}n\left(k+\frac{1}{2}\right)},\ k=0,1,\ldots,N-1\, \tag{18}\]  
and is known as Odd-frequency DFT, or just Odd-DFT [22]. We also abbreviate this designation to ODFT. Although it is not too much different from the basic DFT, it has several advantages that make it preferable in certain contexts. For example, assuming that the window is real-valued and symmetric, and if \(x[n]\) is also real-valued, then the conjugate-symmetric property is expressed as \(X[k]=X^{*}[N-1-k]\), \(k=0,1,\ldots,N/2-1\), i.e., only \(N/2\) values of \(X[k]\) are unique, instead of \(N/2+1\), as in the case of the DFT. This subtle difference facilitates, for example, signal modification by avoiding the special cases of the DFT corresponding to \(k=0\) and \(k=N/2\). In particular, the ODFT facilitates signal integration in the frequency domain because none of the sampled frequencies is zero, which avoids the singularity that occurs in the case of the DFT when \(k=0\)[23]. When the sinusoidal signal (5) is multiplied by the rectangular window (7) and the result is ODFT-transformed, then the relevant maximum that exists in the magnitude spectrum and that occurs for \(k=k_{\ell}\), is given by the following:  
\[X[k_{\ell}]\approx\frac{A}{2}e^{i\left(\phi_{\ell-\frac{\pi}{2}+\pi\left( \Delta_{\ell}-\frac{1}{2}\right)\left(1-\frac{1}{N}\right)}\right)}\frac{\sin \pi\left(\Delta_{\ell}-\frac{1}{2}\right)}{\sin\frac{\pi}{N}\left(\Delta_{ \ell}-\frac{1}{2}\right)}. \tag{19}\]  
However, in this case, the fact that the sampled frequencies of the ODFT rotate by \(\pi/N\) relative to those of the DFT, makes that the phase can be estimated from the same local maximum as long as \(\Delta_{\ell}\in[0.0,1.0]\). This means that the illustration of the spectral magnitudes surrounding the local maximum in Figure 4 is also valid in this context, ex  
Figure 7: Cumulative phase estimation error as a function of the fractional frequency \(\Delta_{\ell}\), when the DFT and the sine window are used. In the illustrated cases, \(N=128\), \(\ell=13\), SNR = 30 dB (**left**) and SNR = 10 dB (**right**). cept that it applies to this new \(\Delta_{\ell}\) range. Under this assumption, from (19) we obtain \(\angle X[k_{\ell}]=\phi_{\ell}-\frac{\pi}{2}+\pi\Big{(}\Delta_{\ell}-\frac{1}{2} \Big{)}\Big{(}1-\frac{1}{N}\Big{)}\), which leads to the following:  
\[\phi_{\ell}=\angle X[k_{\ell}]+\frac{\pi}{2}-\pi\Big{(}\Delta_{\ell}-\frac{1}{2 }\Big{)}\left(1-\frac{1}{N}\right)\,. \tag{20}\]  
As in the previous two subsections, we can avoid the dependence on the prior estimation of \(\Delta_{\ell}\) by considering a time reference corresponding to the group delay of the window, which implies adding \(\omega_{\ell}\tau\) to (20), as follows:  
\[\dot{\phi}_{\ell} = \angle X[k_{\ell}]+\frac{\pi}{2}-\pi\bigg{(}\Delta_{\ell}-\frac{1 }{2}\Big{)}\Big{(}1-\frac{1}{N}\Big{)}+\omega_{\ell}\tau \tag{21}\] \[= \angle X[k_{\ell}]+\pi\bigg{(}1-\frac{1}{2N}\bigg{)}+\pi k_{\ell} \bigg{(}1-\frac{1}{N}\bigg{)}\,.\]  
Although this result is different from the one discussed in the previous two subsections, it reveals the same important property that phase estimation depends on the spectral bin index of the local maximum in the magnitude spectrum, instead of the fractional frequency \(\Delta_{\ell}\), which adds robustness to the phase estimation process. Figure 8 shows the cumulative phase estimation error that results from (21) when the test conditions are the same as those that are considered in Sections 2.1 and 2.2.