# IpDFT-Tuned Estimation Algorithms for PMUs: Overview and Performance Comparison
## 2 Theoretical Background
### IpDFTc Algorithm  
The IpDFTc estimator improves the performance of the basic IpDFTc algorithm as it greatly reduces the effect on the estimated parameters of the spectral leakage due to both the image of the fundamental component and the second-order harmonic [27]. In the IpDFTc algorithm, the estimator of the number of observed signal cycles at the reference time within the \(r\)-th collected record is:  
\[\hat{v}_{1,r}=\hat{v}_{10,r}-\Delta_{c}v_{1,r}, \tag{11}\]  
where \(\hat{v}_{10,r}\) is returned by (8) and the term \(\Delta_{c}v_{1,r}\) is given by [27]:  
\[ \begin{split}\Delta_{c}v_{1,r}=&\Delta_{c}\delta_{1,r}{=}\left(H+(-1)^{i}\hat{\delta}_{10,r}\right)\Bigg{[}\frac{(-1)^{i}2\hat{ v}_{10,r}}{2\hat{v}_{10,r}-\hat{\delta}_{10,r}+(-1)^{i+1}H}\frac{W\big{(}2\hat{v}_{10, r}-\hat{\delta}_{10,r}\big{)}}{W\big{(}\hat{\delta}_{10,r}\big{)}}\cos\big{(}2 \hat{\phi}_{10,r}\big{)}+\right.\\ &\left.\frac{(-1)^{i}\big{(}\hat{v}_{20,r}-\hat{v}_{10,r}\big{)} }{\hat{v}_{20,r}-\hat{v}_{10,r}+\hat{\delta}_{10,r}+(-1)^{i}H}\frac{\hat{a}_{ 20,r}}{\hat{a}_{10,r}}\frac{W\big{(}\hat{v}_{20,r}-\hat{v}_{10,r}+\hat{\delta} _{10,r}\big{)}}{W\big{(}\hat{\delta}_{10,r}\big{)}}\cos(\hat{\phi}_{20,r}-\hat {\phi}_{10,r})\right].\end{split}  \tag{12}\]  
In (12) the values of \(\hat{a}_{10,r}\), \(\hat{\phi}_{10,r}\) result from (9), namely from the preliminary IpDFT, whereas \(\hat{a}_{20,r}\) and \(\hat{\phi}_{20,r}\) are the amplitude and the phase estimators of the possible second-order harmonic at the same reference time \(t_{r}\). Let \(\widetilde{y}_{r}(\cdot)\) be the residual signal obtained from (2) after subtracting the fundamental sinewave reconstructed by using the IpDFT estimated parameters, i.e.,  
\[\widetilde{y}_{r}(m)=y_{r}(m)-\hat{a}_{10,r}\cos\bigg{(}2\pi\frac{\hat{v}_{10,r}}{M}(rL+m)+\hat{\phi}_{10,r}\bigg{)},\qquad m=-N_{h},\ldots,0,\ldots,N_{h}. \tag{13}\]  
If \(\widetilde{Y}_{r,w}(\cdot)\) is the windowed DFT of (13) obtained using the \(H\)-term MSD window [i.e., \(\widetilde{y}_{r,w}(m)=\widetilde{y}_{r}(m)\cdot w(m)\)], the amplitude and phase estimators of the second-order harmonic are obtained by applying the IpDFT algorithm to (13), that is:  
\[\hat{a}_{20,r}=\frac{2\Big{|}\widetilde{Y}_{r,w}(J_{2})\Big{|}}{W\big{(}\hat {\delta}_{20,r}\big{)}},\qquad\qquad\hat{\phi}_{20,r}=angle\Big{\{}\widetilde {Y}_{r,w}(J_{2})\Big{\}}. \tag{14}\]  
In (14), \(J_{2}\) denotes the integer part of the number of second harmonic cycles, while \(\hat{\delta}_{20,r}=\frac{(H-1+i)\hat{a}_{20,r}-H+i}{\hat{a}_{2}+1}\) is the corresponding off-nominal frequency deviation estimator expressed in bins. Note that in \(\alpha_{2,r}=\frac{|\widetilde{Y}_{r,w}(J_{2}+i)|}{|\widetilde{Y}_{r,w}(J_{2} +i-1)|}\) the index \(i\) is equal to \(0\) if \(\Big{|}\widetilde{Y}_{r,w}(J_{2}-1)\Big{|}>\Big{|}\widetilde{Y}_{r,w}(J_{2}+1) \Big{|}\) or it is equal to \(1\) if \(\Big{|}\widetilde{Y}_{r,w}(J_{2}-1)\Big{|}<\Big{|}\widetilde{Y}_{r,w}(J_{2}+1) \Big{|}\). Therefore, the second harmonic frequency, expressed in bins, is given by \(\hat{v}_{20,r}=J_{2}+\hat{\delta}_{20,r}\). In order to compensate for the effect of the spectral leakage caused by both the fundamental image component and the second harmonic, the following expression is applied to estimate the sine-wave amplitude at time \(t_{r}\):  
\[\hat{a}_{1,r}=\hat{a}_{10,r}-\Delta_{c}a_{1,r} \tag{15}\]  
where* \(\hat{a}_{10c,r}=\frac{2|Y_{r,w}(J_{1})|}{W\big{(}\hat{s}_{10,r}-\Delta_{c}\delta_{1,r}\big{)}}\) (with \(\hat{s}_{10,r}\) and \(\Delta_{c}\delta_{1,r}\) given by (8) and (12), respectively) is the amplitude estimator of the fundamental sinewave after compensating for the fundamental frequency estimation bias due to the second harmonic and
* \(\Delta_{c}a_{1,r}=\hat{a}_{10,r}\frac{W\big{(}\hat{x}_{10,r}-\hat{s}_{10,r} \big{)}}{W\big{(}\hat{s}_{10,r}\big{)}}\cos(2\hat{\phi}_{10,r})+\hat{a}_{20,r} \frac{W\big{(}\hat{x}_{20,r}-\hat{s}_{10,r}+\hat{s}_{10,r}\big{)}}{W\big{(} \hat{s}_{10,r}\big{)}}\cos\big{(}\hat{\phi}_{20,r}-\hat{\phi}_{10,r}\big{)}\) is the amplitude correction term [27].