# IpDFT-Tuned Estimation Algorithms for PMUs: Overview and Performance Comparison
## 2 Theoretical Background
### Tuned Real-Valued TWLS Algorithm  
The fundamental component of (1) can be rewritten as:  
\[s(t)=a_{1}(t)\cos(2\pi f_{1}t+\phi_{1}(t))=c_{1}(t)\cos(2\pi f_{1}t)-s_{1}(t) \sin(2\pi f_{1}t), \tag{19}\]  
where \(c_{1}(t)=a_{1}(t)\cos\phi_{1}(t)\) and \(s_{1}(t)=a_{1}(t)\sin\phi_{1}(t)\). To implement the real-valued TWLS algorithm [28], the two quadrature components \(c_{1}(t)\) and \(s_{1}(t)\) are approximated by their respective Taylor's series about the reference time \(t_{r}\) truncated to the \(K\)-th order term (\(K\geq 2\)). As a result,  
\[c_{1}(t)\cong c_{1}(t_{r})+c_{1}^{(1)}(t_{r})\Delta t+\frac{c_{1}^{(2)}(t_{r} )}{2!}\Delta t^{2}+\ldots+\frac{c_{1}^{(K)}(t_{r})}{K!}\Delta t^{K} \tag{20}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Step** & Apply the IpDFTc algorithm based on the Hann window to the \(r\)-th data record \(y_{r}(\cdot)\) and \\
**1:** & determine the estimators \(\hat{\
u}_{10,r},\ \hat{a}_{10,r},\ \text{and}\ \hat{\phi}_{10,r}\) by using (7) and (9). \\
**Step** & Compute the residual signal \(\tilde{y}_{r}(\cdot)\) by removing the estimated sinewave from the acquired \\
**2:** & samples \(y_{r}(\cdot)\). \\
**Step** & Apply the IpDFT algorithm based on the Hann window again to the residual signal \(\tilde{y}_{r}(\cdot)\) \\
**3:** & and determine the second harmonic parameters \(\hat{\
u}_{20,r},\ \hat{a}_{20,r},\ \text{and}\ \hat{\phi}_{20,r}\). \\
**Step** & Compute the new sine-wave parameter estimates \(\hat{\
u}_{1,r},\ \hat{a}_{1,r},\ \text{and}\ \hat{\phi}_{1,r}\) by using (11), (15), and \\
**4:** & (16). \\
**Step** & Compute \(f_{1,r}\) and \(RO\hat{CO}F_{1,r}\) by using (17) and (18). \\
**5:** & Return the estimated parameters. \\
**6:** & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Steps of the IpDFTc estimation algorithm for PMUs. and  
\[s_{1}(t)\cong s_{1}(t_{r})+s_{1}^{(1)}(t_{r})\Delta t+\frac{s_{1}^{(2)}(t_{r})}{2!} \Delta t^{2}+\ldots+\frac{s_{1}^{(K)}(t_{r})}{K!}\Delta t^{K} \tag{21}\]  
where \(\Delta t=t-t_{r}\) and \(c_{1}^{(k)}(t_{r})\), \(s_{1}^{(k)}(t_{r})\), \(k=1,\,2,\,\ldots,\,K\), are the \(k\)-th order derivatives of \(c_{1}(t)\) and \(s_{1}(t)\), respectively, evaluated at the time instant \(t_{r}\). The original Taylor-based weighted approach described in [30] assumes that the sinewave frequency coincides with the nominal one, i.e.,\(f_{1}=f_{n}\) in (19). However, possible off-nominal frequency deviations may significantly affect the accuracy of the estimation results. This is why a preliminary IpDFT-based fundamental frequency estimation is recommended in [29]. Let us consider the \(r\)-th data record collected in the observation interval \(\left[\frac{rL-N_{h}}{f_{s}},\frac{rL+N_{h}}{f_{s}}\right]\) centered at the reference time \(t_{r}=\frac{rL}{f_{s}}\). If (20) and (21) are replaced into (19) and the resulting expression is evaluated and equated to each sample of the data record, a linear system of \(M=2N_{h}+1\) equations with \(2K\) unknowns and coefficients \(c_{1}(t_{r})=c_{1,r}^{(0)}\), \(c_{1}^{(k)}(t_{r})=\left(k!\,f_{s}^{k}\right)c_{1,r}^{(k)}\), \(s_{1}(t_{r})=s_{1,r}^{(0)}\), \(s_{1}^{(k)}(t_{r})=\left(k!\,f_{s}^{k}\right)s_{1,r}^{(k)}\), for \(k=1,\,2,\,\ldots,\,K\), can be built. If the unknown variables are gathered into vector \(P_{r}\triangleq\left[c_{1,r}^{(K)}\ldots c_{1,r}^{(1)},\,c_{1,r}^{(0)}-s_{1,r }^{(0)}-s_{1,r}^{(1)}\ldots-s_{1,r}^{(K)}\right]^{T}\) and \(\hat{f}_{10,r}=\hat{v}_{10,r}\frac{f_{s}}{M}\) [with \(\hat{v}_{10,r}\) being given by (7)] is used to estimate \(f_{1}\) in (19), the coefficients of the linear system can be arranged into a matrix \(V_{K,r}\) whose elements are [28]  
\[ \begin{array}{llll}(v_{K,1})_{lq}=(l-N_{h})^{K+1-q}\cos(2\pi\hat{v}_{10,r} (N_{h}-l)),&l=1,\ldots,\,N_{h},&q=1,\ldots,\,K+1\\ (v_{K,2})_{lq}=l^{K+1-q}\cos(2\pi\hat{v}_{10,r}l),&l=1,\ldots,\,N_{h},&q=1, \ldots,\,K+1\\ (v_{K,3})_{lq}=-(l-N_{h})^{q-1}\sin(2\pi\hat{v}_{10,r}(N_{h}-l)),&l=1,\ldots, \,N_{h},&q=1,\ldots,\,K+1\\ (v_{K,4})_{lq}=l^{q-1}\sin(2\pi\hat{v}_{10,r}l),&l=1,\ldots,\,N_{h},&q=1, \ldots,\,K+1\end{array}