# Demystifying DFT-Based Harmonic Phase Estimation, Transformation, and Synthesis
## 3 An Interpretable Time-Shift Invariant Harmonic Phase Model
### NRD Estimation Example Based on the Sawtooth Wave  
In this subsection, and throughout the rest of this paper, we use a convenient ground-truth signal that consists of the sawtooth waveform. In order to work with realistic NRD  
Figure 12: An inspiring metaphor from nature: NRD can be regarded as being similar to the space-invariant bird formation structure in a flock that is represented by the line connecting the birds in the upper branch of the illustrated flock. estimation conditions, the fundamental frequency (\(F_{0}\)) is time-varying, and two levels of noise contamination are considered. Regarding the time-varying fundamental frequency, we take the average pitch frequency between female and male human speakers, which is around 150 Hz, and subject it to frequency-modulation (FM) as specified in Equation (31). \[F_{0}(t)=150.0+\mathrm{FM}\cos(2\pi\cdot\mathrm{FM}\cdot t) \tag{31}\]  
In our simulations, we consider two FM values: FM = 2.5 Hz, and FM = 0.25 Hz. These cases of maximum frequency deviation around the mean are illustrated in Figure 13.  
The sawtooth waveform is illustrated in Figure 14 for two noise contamination scenarios that we consider in our simulations: when it is mild (SNR = 30 dB), and when it is strong (SNR = 10 dB). In our simulations, the sampling frequency is 22,050 Hz, the duration of the test signals is 1 s, and the number of harmonics is \(L=20\). The time-frequency transformation is performed as discussed in Section 2.4, with \(N=1024\), and 50% overlap between adjacent frames. Using standard Fourier analysis [14], it is easy to show that the starting phases of the sawtooth waveform in (1) are all \(\phi_{\ell}=0,\ \ell=0,1,\ldots,L-1\), which means that the harmonic  
Figure 14: Illustration of the influence of noise on the sawtooth test signal when SNR = 30 dB (**top**), and when SNR = 10 dB (**bottom**). Figure 13: Two FM deviation cases characterizing test signals: FM = 2.5 Hz (solid line) and FM = 0.25 Hz (dashed line). phase structure is simply given by \(\text{NRD}_{\ell}=0,\ \ell=0,1,\ldots,L-1\). On the other hand, the normalized harmonic magnitude ratios that express the harmonic magnitude structure of the sawtooth waveform are simply given by the following:  
\[A_{\ell}/A_{0}=\frac{1}{\ell+1},\ \ell=0,1,\ldots,L-1. \tag{32}\]  
Given that we have access to the ground-truth value of the instantaneous fundamental frequency, as specified by (31), and by adopting the frequency front-end that is assumed in Section 2.4 (i.e., ODFT and sine window), we may easily obtain the ground-truth spectral indices (\(k_{\ell}\)) of all 20 local maxima in the ODFT magnitude spectrum. These indices allow us to estimate the individual harmonic phases as specified by (21) and, from these, we estimate the NRD coefficients for all harmonics. By vertically unwrapping these coefficients, we obtain interpretable representations that are amenable to simple parametric modeling. Figure 15 represents an overlay of the magnitude spectra and unwrapped NRD vectors of our test signal when the maximum frequency deviation around the mean is 0.25 Hz, and the SNR is 30 dB. It can be seen that, as expected, the magnitude spectra are aligned in a very consistent way because the FM modulation is small, and the SNR is high. On the other hand, it can also be seen that the unwrapped NRD vectors are also very closely aligned to the ideal ground-truth model (\(\text{NRD}_{\ell}=0,\ \ell+1=1,2,\ldots,20\)). In Figure 15 and subsequent figures the horizontal axis labels \(\ell+1=1,2,\ldots,20\) as the harmonic index. Figure 16 repeats the overlay representation when the SNR is 10 dB. It can be seen that higher-order harmonics are strongly contaminated by noise, especially when their magnitude approaches the noise floor, which adversely impacts the accuracy of phase estimation. This is clear in Figure 16 because the unwrapped NRD vectors deviate more from the ideal ground-truth model as the harmonic order increases. Still, their average follows the correct model.