 Research
 Open Access
 Published:
Two accurate phasedifference estimators for dualchannel sinewave model
EURASIP Journal on Advances in Signal Processing volume 2013, Article number: 122 (2013)
Abstract
Two algorithms for estimating the phasedifference between two real sinusoids with common frequency in the presence of white noise are proposed. The first estimator utilizes the maximum likelihood criterion to find the phase of each channel output in a separable manner, and the phaseshift estimate is then given by their difference. The algorithm extension to unknown frequency and/or noise powers is also studied. On the other hand, the development of the second method is based on the linear prediction approach with a properly chosen sampling frequency. Furthermore, variance expressions for the two estimators are derived. Computer simulations are included to corroborate the theoretical calculations and to contrast the performance of the proposed schemes with several existing phasedifference estimators as well as CramérRao lower bound.
1 Introduction
Finding the phasedifference between two noisy sinusoids with common frequency has applications such as particle size and velocity estimation in laser anemometry [1], impedance measurements [2], and electric power calibration [3]. In this work, we consider the following dualchannel discretetime sinewave model:
where
The A _{ i }>0 and ϕ _{ i }∈ [0,2π) denote the sinusoidal amplitude and initial phase at the ith channel, respectively, while ω=Ω T∈ [0,π) is the common frequency with Ω and T being the frequency of the continuoustime counterpart and sampling period. The additive noises v _{1}(n) and v _{2}(n) are uncorrelated white Gaussian processes with variances {\sigma}_{1}^{2} and {\sigma}_{2}^{2}. The task is to estimate the phaseshift, denoted by θ=ϕ _{1}−ϕ _{2}, from x _{1}(n) and x _{2}(n).
Handel [4] has proposed the nonlinear least squares approach for (1) and (2), where there is an additional DC offset term at each channel output, which corresponds to the estimation of seven unknown parameters. Alternatively, the seven unknowns can also be solved by the ellipsefitting [5] technique. When Ω in (2) is known, we have proposed the unbiased quadratic delay estimator (UQDE) and discretetime Fourier transformbased method in [6] for accurately estimating θ. The derivation of both algorithms is based on utilizing the inphase and quadraturephase components of {s _{ i }(n)}, but they can give optimum estimation performance only when π/(2Ω T)=π/(2ω) is a positive integer. Using the idea of [6], the modified simple algorithm (MSAL) [3] has recently been developed for phasedifference estimation even if π/(2ω) is not an integer.
The main contribution of this work is to develop and analyze two accurate phaseshift estimation approaches for the signal model of (1) and (2). In Section 2, the maximum likelihood (ML) estimator for θ is presented. It is proved that its variance is equal to the CramérRao lower bound (CRLB) in the presence of white Gaussian noises. We also extend the ML algorithm to the scenarios of unknown frequency and/or noise powers. By properly choosing T such that ω=π/2, a linear prediction (LP)based phasedifference estimator is derived and its performance is investigated in Section 3. Section 4 contains numerical examples for corroborating our theoretical development and comparing the performance of the ML and LP algorithms with the UQDE and MSAL, as well as CRLB. Finally, conclusions are drawn in Section 5.
2 Maximum likelihood estimator
First, we consider that Ω and the ratio of noise powers, denoted by r={\sigma}_{1}^{2}/{\sigma}_{2}^{2}, are known a priori. By letting α _{ i }=A _{ i } cos(ϕ _{ i }) and β _{ i }=A _{ i } sin(ϕ _{ i }) [7], s _{ i }(n) can be written as
The logarithm of the probability density function of {x _{ i }(n)} parameterized by α _{ i } and β _{ i } is
Eliminating the terms in (4), which are irrelevant to α _{ i } and β _{ i }, their ML estimates are given by the minimum of the following function, denoted by Λ _{ i }(α _{ i },β _{ i }):
Taking the partial derivatives of (5) with respect to α _{ i } and β _{ i }, and setting the resultant expressions to zero lead to
and
where {\widehat{\alpha}}_{i} and {\widehat{\beta}}_{i} are the ML estimates of α _{ i } and β _{ i }, respectively. Solving (6) and (7), we obtain:
[b]
and
According to [7], the ML estimate of ϕ _{ i } is
As a result, the ML estimate of θ is:
Note that this estimation procedure corresponds to a simplified form for the ML formulation of the sevenparameter model [4] with unknown frequency and additional DC offsets.
In Appendix 1, we have derived the variance of \widehat{\theta}, denoted by \text{var}(\widehat{\theta}), which has the form of:
where C={\sum}_{n=1}^{N}\stackrel{2}{sin}(\mathrm{n\omega})\xb7{\sum}_{n=1}^{N}\stackrel{2}{cos}(\mathrm{n\omega})({\sum}_{n=1}^{N} sin(n ω)cos(n ω))^{2}, {C}_{i}=\stackrel{2}{cos}({\varphi}_{i}){\sum}_{n=1}^{N}\stackrel{2}{sin}(\mathrm{n\omega})+\stackrel{2}{sin}({\varphi}_{i}) {\sum}_{n=1}^{N}\stackrel{2}{cos}(\mathrm{n\omega})+2sin({\varphi}_{i})cos({\varphi}_{i}){\sum}_{n=1}^{N}sin(\mathrm{n\omega})cos(\mathrm{n\omega}), i=1,2, which is identical to the CRLB (see Appendix 2).
When N→∞, we simply obtain C=(N/2)^{2} and C _{1}=C _{2}=N/2. As a result, the asymptotic variance is:
where {\text{SNR}}_{i}={A}_{i}^{2}/(2{\sigma}_{i}^{2}), i=1,2, is the signaltonoise ratio at the ith channel.
Analogous to (5), when the frequency is unknown, ML estimation is achieved by minimizing
or in matrix form:
where
Expressing κ _{ i } in terms of Ω as (Ξ ^{T} Ξ)^{−1} Ξ ^{T} x _{ i }, which corresponds to (8) and (9), the ML frequency estimate is given by
where
Once \widehat{\omega} is obtained by solving (19), the phasedifference is estimated as in (8) to (11).
The proposed methodology can also be generalized to the scenario when both r and Ω are not known a priori, and we have to estimate the noise powers and frequency in an iterative manner as follows:

Step 1. Set r=1.

Step 2. Compute \widehat{\omega} using (19).

Step 3. Use \omega =\widehat{\omega} to estimate the noise powers as {\sigma}_{i}^{2}={\mathbf{x}}_{i}^{T}\left({\mathbf{I}}_{N}\mathbf{\Xi}{({\mathbf{\Xi}}^{T}\mathbf{\Xi})}^{1}{\mathbf{\Xi}}^{T}\right){\mathbf{x}}_{i}/N, i=1,2, where I _{ N } is the N×N identity matrix.

Step 4. Repeat steps 2 and 3 until a stopping criterion is reached.

Step 5. Compute the phasedifference estimate \widehat{\theta} based on (8) to (11).
3 Linear prediction estimator
The basic idea is to approximate x _{2}(n+1) using a linear combination of x _{1}(n) and x _{1}(n+1), and then minimize the least squares cost function for the resultant LP error vector. To facilitate the development of the LP approach, the sampling interval is properly chosen such that the discretetime frequency is ω=π/2. In doing so, x _{1}(n)and x _{1}(n+1) are
and
On the other hand, x _{2}(n+1) can be written as
From(21)to(23), we construct the LP error vector for n=1,⋯,N−1:
where μ= [x _{2}(2) ⋯ x _{2}(N)]^{T}, ν _{1}= [x _{1}(1) ⋯ x _{1}(N−1)]^{T}, ν _{2}= [x _{1}(2) ⋯ x _{1}(N)]^{T}, and \stackrel{~}{\mathbf{c}} is the variable for the LP coefficient vector c=[c _{1} c _{2}]^{T}=[sin(θ)A _{2}/A _{1} cos(θ)A _{2}/A _{1}]^{T}. The optimum estimate of c= [c _{1} c _{2}]^{T}, denoted by \widehat{\mathbf{c}}=\phantom{\rule{1em}{0ex}}{\left[{\u0109}_{1}\phantom{\rule{1em}{0ex}}{\u0109}_{2}\right]}^{T}, is obtained via weighted least squares:
where X _{1}=[ν _{1} ν _{2}], and the weighting matrix W is computed according to the GaussMarkov theorem [8]:
where E denotes the expectation operator, A=[Toeplitz([−c _{1} 0 _{1×(N−2)}]^{T},[−c _{1} −c _{2} 0 _{1×(N−3)}])] with 0 _{ M×N } being the M×N zero matrix. Moreover, Toeplitz (u,v ^{T})stands for the Toeplitz matrix with u and v ^{T} being the first column and first row, respectively.
It is observed from (25) that a scaled version of W can be used. As a result, we simplify the weighting matrix as W=(r A A ^{T}+I _{ N−1})^{−1} so that only the ratio r={\sigma}_{1}^{2}/{\sigma}_{2}^{2} is required. As W is a function of the unknown c, we propose the following iterative procedure to solve for \widehat{\theta}:

Step 1. Set W=I _{ N−1}.

Step 2. Compute \widehat{\mathbf{c}} using (25).

Step 3. Use \mathbf{c}=\widehat{\mathbf{c}} to construct W.

Step 4. Repeat steps 2 and 3 until a stopping criterion is reached.

Step 5. Compute the phasedifference estimate as \widehat{\theta}={tan}^{1}({\u0109}_{1}/{\u0109}_{2}).
For small error conditions such that \widehat{\mathbf{c}} is sufficiently close to c, we follow Appendix 1 (see [9] for the firstorder perturbation analysis) to compute the variance of the phasedifference estimate. The firstorder estimation error \mathrm{\Delta \theta}=\widehat{\theta}\theta is
where the covariance matrix for \widehat{\mathbf{c}}, denoted by \text{cov}(\widehat{\mathbf{c}}), is approximated as
with S _{1} being the signal component in X _{1}. As a result, from (27) to (28), the variance is
where
When N→∞, (29) is equivalent to (13). That is, the performance of the LP estimator is optimum in the asymptotic sense. Note that when r is not known a priori, we can use the procedure in Section 2 to perform the noise level estimation.
4 Simulation results
Extensive computer simulations are carried out to evaluate the mean square error (MSE) performance of the two proposed phasedifference estimators by comparing with the UQDE and MSAL as well as CRLB. The validity of the theoretical calculations of (12), (13), and (29) is also investigated. For the LP method, we use the number of iterations, which is selected to be 15, as the stopping criterion. The amplitude and phase parameters are assigned as α _{1}=3, α _{2}=1, ϕ _{1}=2, and ϕ _{2}=1. The noises {v _{1}(n)} and {v _{2}(n)} are uncorrelated zeromean white Gaussian processes with variances {\sigma}_{1}^{2} and {\sigma}_{2}^{2}, respectively. Unless stated otherwise, N=10, {\sigma}_{1}^{2}=0.5{\sigma}_{2}^{2}, and the frequency as well as power ratio are assumed known. All the results provided are averages of 500 independent runs.
In the first test, the sampling frequency is properly chosen such that ω=π/2. Figure 1 shows the MSEs of the four estimators versus {\sigma}_{1}^{2}. It is seen that the performance of all estimators is very close to the CRLB when {\sigma}_{1}^{2} is sufficiently small. Moreover, the analytical variances of the ML and LP methods are verified. We observe that the former is an optimum estimator, while the difference between (29) and CRLB is very small. This experiment is repeated with N=100, and the results are shown in Figure 2. The findings are similar to those of Figure 1 except now (29) is equal to the CRLB, confirming the asymptotic optimality of the LP algorithm. We repeat the test with {\sigma}_{1}^{2}=0.1{\sigma}_{2}^{2}, and Figure 3 shows their MSE performance. Again, the findings are similar to those of Figure 1, but the MSEs of the four methods are close to CRLB for smaller noise conditions, namely, when {\sigma}_{1}^{2}<0.1.
In the second test, ω=0.3 is employed. Note that the LP estimator and UQDE are not designed to work for this frequency. The MSEs of the ML method and MSAL are plotted in Figure 4. We see that the ML algorithm gives optimum performance for sufficiently small noise conditions and outperforms the MSAL particularly when{\sigma}_{1}^{2}<0.1, indicating the latter is a biased estimator. Note that when the proposed conditions [3] of the MSAL are satisfied, the bias will be eliminated.
In the third test, we compare the performance of the ML method and MSAL for ω∈ [0.1,0.9]π at{\text{SNR}}_{i}=({\alpha}_{1}^{2}+{\alpha}_{2}^{2})/(2{\sigma}_{i}^{2})=0.01,\phantom{\rule{1em}{0ex}}i=1,2, and the results are shown in Figure 5. We again see the optimality of the ML scheme for different frequencies, while the performance of the MSAL can be close to CRLB only when Ω is around 0.5 π. Nevertheless, the MSE of the MSAL can approach the CRLB for all admissible frequencies when proper conditions are satisfied.
In the final test, we consider the scenario when ω=0.3 and r=0.5 are unknown. Figure 6 shows the MSE performance of the ML method versus{\sigma}_{1}^{2}. Note that the known frequency information is required in the remaining three schemes, and thus their results are not included. It is seen that the results are similar to those of Figure 4, although larger estimation error occurs at smaller{\sigma}_{1}^{2}. Moreover, we observe that the CRLB with unknown Ω and r is only a little bit larger than (12). Nevertheless, it is worth pointing out that the proposed algorithms are more computationally demanding than the UQDE and MSAL. As we can see, the ML estimator requires a onedimensional search in (19). Moreover, both the ML and LP solutions need matrix operations, the corresponding is around N×N. As a result, the complexity of the proposed methods increases with N.
5 Conclusion
Two algorithms for accurate phasedifference estimation between two discretetime realvalued sinusoids with common frequency have been developed and analyzed. The first estimator first computes the ML solution for phase at each channel output, and the phaseshift is given by the difference between the two ML estimates. We have also extended the method to work for scenarios when the frequency and/or noise powers are unknown. When the discretetime frequency is properly chosen as π/2, one channel output can be represented as a linear combination of another channel output, where the corresponding LP coefficients have simple relationship with the phasedifference parameter. The second estimator utilizes this LP relationship and applies the weighted least squares for phasedifference estimation. The variance expressions for the two methods are derived and confirmed by computer simulations. It is shown that the ML and LP estimators perform comparably with conventional methods when the frequency is equal to π/2. For other frequencies, even if they are unknown, the ML algorithm can still achieve optimum performance when the noise is sufficiently small. Nevertheless, the proposed algorithms are more computationally demanding, particularly for a larger data length.
Appendices
Appendix 1
Based on θ= tan−1(β _{1}/α _{1})−tan−1(β _{2}/α _{2}), we utilize the firstorder perturbation analysis [9] to obtain
The variance is computed by squaring both sides of (31) and taking the expected value. Since{\widehat{\mathit{\kappa}}}_{1}=\left[{\widehat{\alpha}}_{1}\phantom{\rule{1em}{0ex}}{\widehat{\beta}}_{1}\right] and{\widehat{\mathit{\kappa}}}_{2}=\left[{\widehat{\alpha}}_{2}\phantom{\rule{1em}{0ex}}{\widehat{\beta}}_{2}\right] are uncorrelated, we have
where cov(l _{1},l _{2})denotes the covariance of l _{1} and l _{2}.
To determine the covariance matrices for{\widehat{\kappa}}_{i}, denoted by{\mathbf{C}}_{{\widehat{\kappa}}_{i}}, i=1,2, we express (1) as the matrix form of x _{ i }=Ξ κ _{ i }+v _{ i } which is linear in κ _{ i }, i=1,2, and v _{ i }=[v _{ i }(1), v _{ i }(2), ⋯, v _{ i }(N)]is the noise vector with zero mean and covariance{\sigma}_{i}^{2}{\mathbf{I}}_{N}. According to the GaussMarkov theorem [8],{\mathbf{C}}_{{\widehat{\kappa}}_{i}} is simply
Substituting the corresponding entries of (33) into (32) yields (12).
Appendix 2
We first compute the Fisher information matrix for κ=[α _{1} β _{1} α _{2} β _{2}]^{T}, denoted by F. As the parameters are linear in (1), the (i,j) entry of F in the presence of white Gaussian noise is
where\mathbf{s}={\left[{\mathbf{s}}_{1}^{T},\phantom{\rule{1em}{0ex}}{\mathbf{s}}_{2}^{T}\right]}^{T} with s _{1}=[s _{1}(1) ⋯ s _{1}(N)]^{T}, s _{2}=[s _{2}(1) ⋯ s _{2}(N)]^{T}, and s i′ stands for the partial derivative of s with respect to the ith parameter of κ, i=1,⋯,4. The C is the noise covariance of {\left[{\mathbf{x}}_{1}^{T},{\mathbf{x}}_{2}^{T}\right]}^{T} which has the form of
Using (34) and (35), we obtain:
where
The inverse of (36) can be shown as
Let g(κ)=θ= tan−1(β _{1}/α _{1})−tan−1(β _{2}/α _{2}). With the use of the transformation formula [8], the CRLB for the phasedifference, denoted by CRLB(θ) is
where
Substituting (40) into (39) yields (12).
References
Handel P, HostMadsen A: Estimation of velocity and size of particles from two channel laser anemometry measurements. Measurement 1997, 21(3):113123. 10.1016/S02632241(97)000584
Ramos PM, da Silva MF, Serra AC: Low frequency impedance measurement using sinefitting. Measurement 2004, 35(1):8996. 10.1016/j.measurement.2003.08.008
Vucijak NM, Saranovac LV: A simple algorithm for the estimation of phase difference between two sinusoidal voltages. IEEE Trans. Instrum. Meas 2010, 59(12):31523158.
Handel P: Parameter estimation employing a dualchannel sinewave model under a Gaussian assumption. IEEE Trans. Instrum. Meas 2008, 57(8):16611669.
Ramos PM, Janeiro FM, Tlemcani M, Serra AC: Recent developments on impedance measurements with DSPbased ellipsefitting algorithms. IEEE Trans. Instrum. Meas 2009, 58(5):16801689.
So HC: A comparative study of two discretetime phase delay estimators. IEEE Trans. Instrum. Meas 2005, 54(6):25012504. 10.1109/TIM.2005.859143
Kenefic RJ, Nuttall AH: Maximum likelihood estimation of the parameters of tone using real discrete data. IEEE J. Oceanic. Eng 1987, 12(1):279280. 10.1109/JOE.1987.1145230
Kay SM: Fundamentals of Statistical Signal Processing  Estimation Theory. Englewood Cliffs: PrenticeHall; 1993.
Papoulis A: Probability, Random Variables, and Stochastic Processes. New York: McGrawHill; 1991.
Author information
Authors and Affiliations
Corresponding author
Additional information
Competing interests
Both authors declare that they have no competing interests.
Authors’ original submitted files for images
Below are the links to the authors’ original submitted files for images.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
About this article
Cite this article
So, H.C., Zhou, Z. Two accurate phasedifference estimators for dualchannel sinewave model. EURASIP J. Adv. Signal Process. 2013, 122 (2013). https://doi.org/10.1186/168761802013122
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/168761802013122
Keywords
 Phasedifference; Maximum likelihood estimation; Linear prediction; Time delay estimation; Sinewave model