# Demystifying DFT-Based Harmonic Phase Estimation, Transformation, and Synthesis
## 3 An Interpretable Time-Shift Invariant Harmonic Phase Model
### NRD Estimation Examples Based on the Sawtooth Wave Derivative  
The sawtooth wave is defined by (27) with \(\phi_{\ell}=0,\ \ell=0,1,\ldots,L-1\), i.e.,  
\[x(t)=\sum_{\ell=0}^{L-1}A_{\ell}\sin((\ell+1)\Omega_{0}t)\, \tag{33}\]  
where \(A_{\ell}/A_{0}\) is defined by (32). Its derivative is obtained as follows:  
\[\frac{d}{dt}x(t) = \sum_{\ell=0}^{L-1}A_{\ell}(\ell+1)\frac{2\pi}{T_{0}}\cos((\ell+ 1)\Omega_{0}t) \tag{34}\] \[= \frac{2\pi A_{0}}{T_{0}}\sum_{\ell=0}^{L-1}\sin\Bigl{(}(\ell+1) \Omega_{0}t+\frac{\pi}{2}\Bigr{)}\,\]  
and its negative derivative is as follows:  
\[-\frac{d}{dt}x(t)=\frac{2\pi A_{0}}{T_{0}}\sum_{\ell=0}^{L-1}\sin\Bigl{(}( \ell+1)\Omega_{0}t-\frac{\pi}{2}\Bigr{)}. \tag{35}\]  
The derivative of the sawtooth wave is illustrated in Figure 19 after magnitude normalization and after it has been contaminated by white Gaussian noise at 30 dB and 10 dB SNR. Figure 18: Overlay representation of magnitude spectra (**top**), and unwrapped NRD vectors (**bottom**) of a sawtooth signal that is FM modulated (2.5 Hz deviation around the mean) and whose SNR is 10 dB. In the case of the sawtooth wave derivative, according to (34), it results that \(\phi_{\ell}=\pi/2\), \(\ell=0,1,\ldots,L-1\) and, in the case of the negative of the sawtooth wave derivative, \(\phi_{\ell}=-\pi/2\), \(\ell=0,1,\ldots,L-1\). As a consequence, using (29), in the first case we obtain the following:  
\[\text{NRD}_{\ell}=\frac{\frac{\pi}{2}-(\ell+1)\frac{\pi}{2}}{2\pi}=-\frac{\ell }{4}\;,\;\ell=0,1,\ldots,L-1\;, \tag{36}\]  
and, in the second case, we obtain the following:  
\[\text{NRD}_{\ell}=\frac{-\frac{\pi}{2}+(\ell+1)\frac{\pi}{2}}{2\pi}=\frac{\ell }{4}\;,\;\ell=0,1,\ldots,L-1\;. \tag{37}\]  
We illustrate in Figure 20 the experimental results regarding the sawtooth wave derivative when FM = 2.5 Hz and SNR = 30 dB. It can be confirmed that the unwrapped NRD vectors match quite precisely the ground-truth NRD model according to (36). This model is a simple first-order equation whose value is \(\text{NRD}=-4.75\) when \(\ell=19\). This good match happens despite the fact that FM modulation is substantial, especially for higher-order harmonics. As noted in the previous subsection, this is a consequence of the fact that NRD is intrinsically independent of the fundamental frequency. Figure 19: Illustration of the derivative of the sawtooth test signal when it is affected by noise at SNR = 30 dB (**top**), and at SNR = 10 dB (**bottom**). Figure 20: Overlay representation of magnitude spectra (**top**), and unwrapped NRD vectors (**bottom**) of a sawtooth derivative signal that is FM-modulated (2.5 Hz deviation around the mean) and whose SNR is 30 dB. Similar conclusions are obtained in the practical estimation of the negative of the sawtooth derivative signal that is subject to FM modulation and noise contamination, as in the previous case. The results, when FM = 2.5 Hz and SNR = 30 dB, are displayed in Figure 21.  
It can be confirmed that the estimated unwrapped NRD vectors closely follow the ground-truth NRD model as defined in (37) and reach an NRD of \(\text{NRD}=4.75\) when \(\ell=19\). The simulation results for the sawtooth derivative signal, and its negative, when FM = 2.5 Hz and SNR = 10 dB, are shown in Figure 22 and in Figure 23, respectively. It can be seen that, in both cases, the unwrapped NRD vectors show some dispersion which is mainly caused by the increased noise floor, which affects phase estimation more severely. In any case, even for this poor SNR level, there are no drastic mismatches relative to the ground-truth NRD model that applies to each case. These examples suggest that the unwrapped NRD can also be used to detect the polarity of harmonic signals. \[\frac{d}{dt}x(t) = \sum_{\ell=0}^{L-1}A_{\ell}(\ell+1)\frac{2\pi}{T_{0}}\cos((\ell+ 1)\Omega_{0}t) \tag{34}\]0 Overlay representation of magnitude spectra (**top**), and unwrapped NRD vectors (**bottom**) of the negative of a sawtooth derivative signal that is FM modulated (2.5 Hz deviation around the mean) and whose SNR is 30 dB.