# An Effective Frequency Drift and Phase Offset Estimation Based on Two-Way Message Exchange for WSNs Time Synchronization

Authors: Yijun Wang; Jie Wang; Qi Luo; Dakun Liu
Journal: Mobile Information Systems
 (2022)

---

## Abstract

Time synchronization is one of the key technologies of wireless sensor networks. At present, most studies assume that the transmission delay is a fixed value, and there is no effective processing of historical clock data. Therefore, this paper proposes a clock frequency drift and phase offset estimation scheme which is considering variable transmission delay and historical clock data. This paper has clarified the effectiveness of the Gaussian delay model in the calculation of time synchronization error. On this basis, this paper calculated the maximum likelihood estimations of frequency drift and phase offset and the corresponding Cramer-Rao lower bound. Meanwhile, the transmission delay is optimized by comparing the chi-square distance between measured and standard data. Also, this paper conducts autonomous training on historical data to provide services for improving the accuracy of fitting estimation. Simulation results validate the performance of the proposed scheme.


---

## Body

## 1. Introduction

As the key technology of the Internet of Things and 5G, wireless sensor networks (WSNs) have significant advantages in data collection, signal transmission, and information processing [1]. In WSNs designing, many factors need to be considered, such as hardware constraints, network tolerance in the event of node failure, dynamic network topology, and network energy consumption. Meanwhile, time synchronization technology is the top priority for majority of the WSNs applications. On one hand, the efficient time synchronization is conducive to adapting to dynamic topology changes and reducing energy consumption. On the other hand, it can improve performance indicators and ensure system reliability for applications such as data fusion, energy management, positioning, and target tracking [2].Therefore, many researchers have studied the time synchronization in WSNs. An energy-efficient coefficient exchange synchronization protocol was proposed in [3]. The protocol achieves high synchronization accuracy without requiring packet-level time-stamping but with a significant reduction on communication overhead to achieve low power consumption. Reference [4] proposed an asymmetric high-precision time synchronization scheme. The study proposed time synchronization scheme can avoid time synchronization errors resulting from the single-precision floating-point arithmetic of the resource-constrained sensor nodes and achieve microsecond-level time synchronization accuracy in multihop WSNs. Reference [5] introduced an effective energy-saving method to jointly estimate the phase offset and frequency skew. The study proposed time synchronization method only requires two data samples and obtains a suitable estimator by using linear programming. In [6], a beaconless energy-efficient time synchronization protocol has been proposed based on reverse one-way message dissemination. These studies improve the time synchronization mechanism from the perspective of network protocols and focus on the exchange method and quantity of synchronization packets. Nevertheless, there is no specific analysis and implementation for the estimation methods of phase offset and frequency drift. In [7], based on the reverse asymmetric time synchronization framework, the study has introduced the idea of compensating for the processing delays at packet-relaying gateways to address the cumulative end-to-end synchronization error as an energy-efficient way of multihop extension of WSN time synchronization schemes. In [8], a fusion method of time synchronization with periodical data transmission and acknowledgment is proposed for WSNs. The maximum likelihood estimators (MLE) of clock skew and fixed delay and the simplified MLE of clock skew under the Gaussian random delay are derived. Novel clock skew and offset estimators were designed assuming different delay environments to achieve energy-efficient network-wide synchronization for WSNs [9]. It also derived the Cramer-Rao lower bounds (CRLB) and the maximum likelihood estimators under different delay models and assumptions. This type of research improves network synchronization accuracy from the perspective of phase offset and frequency drift estimation. However, the study treats the transmission delay as a fixed value. The maximum likelihood estimators of the clock skew and the corresponding CRLB were derived assuming Gaussian delays in [10]. The method clarifies a time delay model for certain estimation, but it does not do any processing on the empirical data after the estimation is completed, which is a defect of the modern wireless sensor network synchronization technology.This paper presents a frequency drift and phase offset estimation scheme based on two-way message exchange. The contributions of this paper are listed as follows. First, we prove the effectiveness of the Gaussian delay model in the calculation of time synchronization error through simulation. Thus, we calculate the maximum likelihood estimations of frequency drift and phase offset and the corresponding CRLB. Second, the transmission delay is optimized by comparing the chi-square distance between measured and standard data. Third, we conduct autonomous training on historical clock data to provide services for improving the accuracy of fitting estimation.


## 2. System Model

Assuming that the local clock of nodez is tz and t is the ideal reference time, the time model can be defined as(1)tz=αdriftt+βoffset,where αdrift is the frequency drift, and βoffset is the phase offset [11]. Frequency drift and phase offset are two important parameters that affect the accuracy of pairwise node synchronization errors. The frequency drift is mainly affected by the crystal oscillator of the node microcontroller, and the phase offset is mainly determined by various delays and frequency changes. The central limit theorem asserts the probability density function of the sum of a large number of independent and identically distributed random variable approaches that of Gaussian random variables. If the delay is considered as the addition of numerous independent random processes, this model will be appropriate [9]. In this paper, we use the simulation environment proposed by Elson et al. [12] to prove that the local time difference between the two nodes conforms to the Gaussian distribution. The best parameter result of simulation fitting by our simulation is μ = 0.048, σ = 11.2 μs, and it is very close to the conclusion drawn in [12]. As shown in Figure 1, we estimate the frequency drift and phase offset by the two-way timing message exchange model based on the sender-receiver synchronization mechanism.Figure 1
Two-way timing message exchange model.The two nodes are defined as the master nodeM and slave node S. In the i-th round of packet exchange, node S sends a synchronization packet to node M at T1,iS which needs to synchronize with node M. After node M receives the packet, it records the current time T2,iM and returns a message to node S at T3,iM. Then, node S receives the replied message and records arrival time at T4,iS. According to (1) and two-way timing message exchange model from Figure 1, T2,iM and T3,iM can be expressed as(2)T2,iM=αdriftiT1,iS+φdelaySM+εSM+βinitiali+T1,iS+εSM,(3)T3,iM=αdriftiT4,iS−φdelayMS−εMS+βinitiali+T4,iS−εMS,where φdelaySM and φdelayMS denote the transmission delay in the bidirectional synchronization packet transmission, εSMand εMSdenote uncertain delay caused by random noise during bidirectional synchronization packet transmission, αdriftiis the frequency drift of the i-th round packets exchange, and βinitialiis the initial phase offset. Therefore, it can be seen that the time delay, nondeterministic random noise, and initial phase offset in the transmission process determine the local time of each node at each moment. Meanwhile, on the basis of two-way timing message exchange theory, the time synchronization deviation Δi between node S and node M can be calculated by(4)Δi=T2,iM−T1,iS−T4,iS−T3,iM2.Then, substituting (2) and (3) into (4), Δi can be calculated by(5)Δi=12αdriftiT1,iS+φdelaySM+εSM+βinitiali+εSM−εMS−βinitiali−αdriftiT4,iS−φdelayMS−εMS=12αdriftiT1,iS+T4,iS+βinitiali+12αdriftiφdelaySM−φdelayMS+121+αdriftiεSM−εMS.Let(6)TiS=T1,iS+T4,iS∕2,βoffseti=βinitiali+12αdriftiφdelaySM−φdelayMS+121+αdriftiεSM−εMS.Then, Δi can be rewritten by (7)(7)Δi=αdriftiTiS+βoffseti.The following sections will estimateαdrift and βoffset after N rounds of data exchange, so as to achieve the purpose of improving the accuracy of time synchronization.


## 3. Frequency Drift and Phase Deviation Estimation

### 3.1. Frequency Drift Estimation

In time synchronization, each node oscillator has its unique clock frequency, which will cause clock difference among nodes as time goes. In this section, we consider that the frequency drift is only affected by a single factor of the crystal change. Therefore, the goal of this part is to estimate frequency driftαdriftand the corresponding CRLB on the observation of T1,iS,T2,iM,T3,iM,T4,iS,iϵ1,N based on Gaussian delay model.From (4) and (5), we can get the following equation:(8)T2,iM−T1,iS−T4,iS−T3,iM−2βinitiali=αdriftiT1,iS+T4,iS+1+αdriftiεSM−εMS+αdriftiφdelaySM−φdelayMS.Let(9)Ti=T2,iM−T1,iS−T4,iS−T3,iM−2βinitiali,Ei=εSM−εMS,Φi=φdelaySM−φdelayMS.Then, (8) can be expressed as(10)Ti=αdriftiTiS+1+αdriftiEi+αdriftiΦi.In (10), initial phase offset βoffseti in Ti is the phase offset of the previous round information exchange. We will give the estimation method of this item in the next section, which is considered to be a known condition here. The effect of transmission delay Φi will be discussed in Section 4, which is also considered to be a known term. Assuming that N times of information exchange is a period, and Ei is distributed as Gaussian random variables as shown in Section 2. Thus, the likelihood function with respect to frequency drift αdrift and the variance σ2 is given by(11)Lαdrift,σ2=12πσ2n/2exp−12σ2∑i=1NTi−αdriftΦi+TiS1+αdrift2.Maximizing a likelihood function is equivalent to maximize its natural logarithm. Therefore, we derivateαdrift with respect to L as(12)∂lnLαdrift,σ2∂αdrift=∑i=1NTi−αdriftΦi+TiSTi+Φi+TiSσ21+αdrift3.Thus, estimated frequency drift can be calculated as(13)α^drift=∑i=1NTiTi+Φi+TiS∑i=1NΦi+TiSTi+Φi+TiS.Next, we calculate the CRLB to evaluate the estimated effect of frequency drift. The second-order derivative of the log-likelihood function with respect toαdrift is(14)∂2lnLαdrift,σ2∂αdrift2=−∑i=1NTi+Φi+TiS1+αdriftΦi+TiS+3Ti−3αdriftΦi+TiSσ21+αdrift4.The expectations of (14) can be expressed as(15)−E∂2lnLαdrift,σ2∂αdrift2=Nσ2+∑i=1NΦi+TiS2σ21+αdrift2.Then, the CRLB ofα^drift can be obtained as follows:(16)varα^drift≥−E∂2lnLαdrift,σ2∂αdrift2−1=σ21+αdrift2Nσ2+∑i=1NΦi+TiS2.


### 3.2. Phase Offset Estimation

The phase offset is not only related to the initial phase offset but also related to the frequency drift. Adding (2) and (3) to get the expression of initial phase offset, it can be shown as(17)βinitiali=T2,iM+T3,iM−1+αdriftiT1,iS+T4,iS2.Substituting (20) into the expression of phase offset, we can obtain(18)T2,iM+T3,iM=2βoffseti+1+αdriftiT1,iS+T4,iS−αdriftiφdelaySM−φdelayMS−1+αdriftiεSM−εMS,where TiM=T2,iM+T3,iM, and the equation (21) can be rewritten as(19)TiM=2βoffseti+1+αdriftiTiS−αdriftiΦi−1+αdriftEi.Thus, the likelihood function with respect to phase offsetβoffset and the variance σ2 for Gaussian delay model is given by(20)Lβoffset,σ2=12πσ2n2×exp−12σ2∑i=1N2βoffset−TiM+1+α^driftTiS−α^driftΦi1+α^drift2.Then, the derivative ofβoffset corresponding to L can be expressed as(21)∂lnLβoffset,σ2∂βoffset=−4∑i=1N2βoffset−TiM+1+α^driftTiS−α^driftΦiσ21+α^drift2.Therefore, the phase offset is estimated by(22)β^offset=∑i=1Nα^driftΦi−TiS+TiM−TiS2.We also calculate the CRLB to evaluate the estimated effect of phase offset. The second-order derivative of the log-likelihood function with respect toβoffset is(23)∂2lnLβoffset,σ2∂βoffset2=−8Nσ21+α^drift2.The expectations of (23) can be expressed as(24)−E∂2lnLβoffset,σ2∂βoffset2=8Nσ21+α^drift2.Then the CRLB ofβ^offset can be obtained as follows:(25)varβ^offset≥−E∂2lnLβoffset,σ2∂βoffset2−1=σ21+α^drift28N.


## 3.1. Frequency Drift Estimation

In time synchronization, each node oscillator has its unique clock frequency, which will cause clock difference among nodes as time goes. In this section, we consider that the frequency drift is only affected by a single factor of the crystal change. Therefore, the goal of this part is to estimate frequency driftαdriftand the corresponding CRLB on the observation of T1,iS,T2,iM,T3,iM,T4,iS,iϵ1,N based on Gaussian delay model.From (4) and (5), we can get the following equation:(8)T2,iM−T1,iS−T4,iS−T3,iM−2βinitiali=αdriftiT1,iS+T4,iS+1+αdriftiεSM−εMS+αdriftiφdelaySM−φdelayMS.Let(9)Ti=T2,iM−T1,iS−T4,iS−T3,iM−2βinitiali,Ei=εSM−εMS,Φi=φdelaySM−φdelayMS.Then, (8) can be expressed as(10)Ti=αdriftiTiS+1+αdriftiEi+αdriftiΦi.In (10), initial phase offset βoffseti in Ti is the phase offset of the previous round information exchange. We will give the estimation method of this item in the next section, which is considered to be a known condition here. The effect of transmission delay Φi will be discussed in Section 4, which is also considered to be a known term. Assuming that N times of information exchange is a period, and Ei is distributed as Gaussian random variables as shown in Section 2. Thus, the likelihood function with respect to frequency drift αdrift and the variance σ2 is given by(11)Lαdrift,σ2=12πσ2n/2exp−12σ2∑i=1NTi−αdriftΦi+TiS1+αdrift2.Maximizing a likelihood function is equivalent to maximize its natural logarithm. Therefore, we derivateαdrift with respect to L as(12)∂lnLαdrift,σ2∂αdrift=∑i=1NTi−αdriftΦi+TiSTi+Φi+TiSσ21+αdrift3.Thus, estimated frequency drift can be calculated as(13)α^drift=∑i=1NTiTi+Φi+TiS∑i=1NΦi+TiSTi+Φi+TiS.Next, we calculate the CRLB to evaluate the estimated effect of frequency drift. The second-order derivative of the log-likelihood function with respect toαdrift is(14)∂2lnLαdrift,σ2∂αdrift2=−∑i=1NTi+Φi+TiS1+αdriftΦi+TiS+3Ti−3αdriftΦi+TiSσ21+αdrift4.The expectations of (14) can be expressed as(15)−E∂2lnLαdrift,σ2∂αdrift2=Nσ2+∑i=1NΦi+TiS2σ21+αdrift2.Then, the CRLB ofα^drift can be obtained as follows:(16)varα^drift≥−E∂2lnLαdrift,σ2∂αdrift2−1=σ21+αdrift2Nσ2+∑i=1NΦi+TiS2.


## 3.2. Phase Offset Estimation

The phase offset is not only related to the initial phase offset but also related to the frequency drift. Adding (2) and (3) to get the expression of initial phase offset, it can be shown as(17)βinitiali=T2,iM+T3,iM−1+αdriftiT1,iS+T4,iS2.Substituting (20) into the expression of phase offset, we can obtain(18)T2,iM+T3,iM=2βoffseti+1+αdriftiT1,iS+T4,iS−αdriftiφdelaySM−φdelayMS−1+αdriftiεSM−εMS,where TiM=T2,iM+T3,iM, and the equation (21) can be rewritten as(19)TiM=2βoffseti+1+αdriftiTiS−αdriftiΦi−1+αdriftEi.Thus, the likelihood function with respect to phase offsetβoffset and the variance σ2 for Gaussian delay model is given by(20)Lβoffset,σ2=12πσ2n2×exp−12σ2∑i=1N2βoffset−TiM+1+α^driftTiS−α^driftΦi1+α^drift2.Then, the derivative ofβoffset corresponding to L can be expressed as(21)∂lnLβoffset,σ2∂βoffset=−4∑i=1N2βoffset−TiM+1+α^driftTiS−α^driftΦiσ21+α^drift2.Therefore, the phase offset is estimated by(22)β^offset=∑i=1Nα^driftΦi−TiS+TiM−TiS2.We also calculate the CRLB to evaluate the estimated effect of phase offset. The second-order derivative of the log-likelihood function with respect toβoffset is(23)∂2lnLβoffset,σ2∂βoffset2=−8Nσ21+α^drift2.The expectations of (23) can be expressed as(24)−E∂2lnLβoffset,σ2∂βoffset2=8Nσ21+α^drift2.Then the CRLB ofβ^offset can be obtained as follows:(25)varβ^offset≥−E∂2lnLβoffset,σ2∂βoffset2−1=σ21+α^drift28N.


## 4. Transmission Delay Optimization and Clock Data Update

After the estimation of frequency drift and phase offset, this section focuses on the uncertain transmission delay optimization in time synchronization estimation. Meanwhile, most synchronization algorithms do not deal with the local time-stamp historical data, which makes the synchronization algorithm to lack the ability of adaptive evaluation, so this section also uses autonomous training methods to update the clock data.


### 4.1. Transmission Delay Optimization

The various delays present in message delivery in WSNs include the following components: (1)Send Time—the time it takes to prepare the message and pass it to lower layers (non-deterministic). (2) Access Time—delay incurred by waiting for access to the transmit channel up to the point when transmission begins (non-deterministic). (3) Transmission Time—the time it takes for the sender to transmit the message. This time is in the order of tens of milliseconds depending on the length of the message and the speed of the radio (deterministic). (4) Propagation Time—the time it takes for the message to transmit from sender to receiver once it has left the sender (negligible, as it is below 1μs for 300 meters ). (5) Reception Time—the time it takes for the receiver to receive the message (deterministic). (6) Receive Time—time to construct and send the received message to the application layer at the receiver. The delay components can also be divided into two categories: fixed portion and variable portion. The transmission delay is often recognized as fixed [13]. But due to the mobility of the node or channel fading changes, the transmission delay often varies greatly. Therefore, the optimization of the transmission delay is an important measure to ensure the estimation accuracy. Assuming that ΦN=φ1,φ2,⋯,φi,⋯,φN denotes the set of transmission delay after N rounds of data exchange. We use the vector transformation as shown below to normalize the transmission delay(26)φi˜=φi∑i=1Nφi2.Then,ΦN can be rewritten as ΦN=φ1,φ2,⋯,φi,⋯,φN. Assuming that standard transmission delay is φs, we compare the chi-square distance of transmission delay between ΦN and φs by(27)Di=φ˜i−φs2φ˜i+φs.where Di denotes the difference between the observation data ΦN and the standard data. Let Dth represent the difference threshold, and then, the transmission delay can be determined by(28)φ˜i=argminφ˜iφ˜i−φs2φ˜i+φs,ifDi≤Dth,argmaxφ˜iφ˜i−φs2φ˜i+φs,ifDi>Dth.


### 4.2. Clock Data Update

In order to make the local time-stamp data empirical value gradually approach the ideal value, we perform data update scheme. It mainly conducts autonomous training on historical data to provide services for improving the accuracy of fitting estimation. LetTIM=T1M,T2M,⋯,TiM,⋯,TNM, TIS=T1S,T2S,⋯,TiS,⋯,TNS, for the purpose of ensuring the accuracy of the data during the fitting process, the two sets need to satisfy(29)minTIM−TISU2≤ε,where U is the matrix of cumulative empirical coefficients, and ε is the specified threshold that meets the requirements of the fitted data. And we also have(30)TIM−TISU2=∑TIM−TISU21∕2.In (30), the U continuously adjusts its sparse structure according to the accumulated historical data, so that the data at the slave are more accurate during the update process. Therefore, TISU can approximately reach a relatively optimal by adjusting the U. In the actual calculation process, it is impossible to find the relative optimal value of TISU at a time, so the process is to update only one column of TISU at a time. The update and reconstruction subitem of the k-th column is shown in the following formula:(31)TIM−TISU22=TIM−∑z=1KtzSuz22=TIM−∑z≠kKtzSuz−tkSuk22=Wk−tkSuk22.By decomposing the multiplicationTISU into the sum of z matrixes with rank 1, the maximum value of z is K, assuming that the other K-1 columns are fixed, represented by Wk, and the k-th column is unknown. After completing this step, the singular value decomposition can be used to reach the minimum distribution of the k-th column.


## 4.1. Transmission Delay Optimization

The various delays present in message delivery in WSNs include the following components: (1)Send Time—the time it takes to prepare the message and pass it to lower layers (non-deterministic). (2) Access Time—delay incurred by waiting for access to the transmit channel up to the point when transmission begins (non-deterministic). (3) Transmission Time—the time it takes for the sender to transmit the message. This time is in the order of tens of milliseconds depending on the length of the message and the speed of the radio (deterministic). (4) Propagation Time—the time it takes for the message to transmit from sender to receiver once it has left the sender (negligible, as it is below 1μs for 300 meters ). (5) Reception Time—the time it takes for the receiver to receive the message (deterministic). (6) Receive Time—time to construct and send the received message to the application layer at the receiver. The delay components can also be divided into two categories: fixed portion and variable portion. The transmission delay is often recognized as fixed [13]. But due to the mobility of the node or channel fading changes, the transmission delay often varies greatly. Therefore, the optimization of the transmission delay is an important measure to ensure the estimation accuracy. Assuming that ΦN=φ1,φ2,⋯,φi,⋯,φN denotes the set of transmission delay after N rounds of data exchange. We use the vector transformation as shown below to normalize the transmission delay(26)φi˜=φi∑i=1Nφi2.Then,ΦN can be rewritten as ΦN=φ1,φ2,⋯,φi,⋯,φN. Assuming that standard transmission delay is φs, we compare the chi-square distance of transmission delay between ΦN and φs by(27)Di=φ˜i−φs2φ˜i+φs.where Di denotes the difference between the observation data ΦN and the standard data. Let Dth represent the difference threshold, and then, the transmission delay can be determined by(28)φ˜i=argminφ˜iφ˜i−φs2φ˜i+φs,ifDi≤Dth,argmaxφ˜iφ˜i−φs2φ˜i+φs,ifDi>Dth.


## 4.2. Clock Data Update

In order to make the local time-stamp data empirical value gradually approach the ideal value, we perform data update scheme. It mainly conducts autonomous training on historical data to provide services for improving the accuracy of fitting estimation. LetTIM=T1M,T2M,⋯,TiM,⋯,TNM, TIS=T1S,T2S,⋯,TiS,⋯,TNS, for the purpose of ensuring the accuracy of the data during the fitting process, the two sets need to satisfy(29)minTIM−TISU2≤ε,where U is the matrix of cumulative empirical coefficients, and ε is the specified threshold that meets the requirements of the fitted data. And we also have(30)TIM−TISU2=∑TIM−TISU21∕2.In (30), the U continuously adjusts its sparse structure according to the accumulated historical data, so that the data at the slave are more accurate during the update process. Therefore, TISU can approximately reach a relatively optimal by adjusting the U. In the actual calculation process, it is impossible to find the relative optimal value of TISU at a time, so the process is to update only one column of TISU at a time. The update and reconstruction subitem of the k-th column is shown in the following formula:(31)TIM−TISU22=TIM−∑z=1KtzSuz22=TIM−∑z≠kKtzSuz−tkSuk22=Wk−tkSuk22.By decomposing the multiplicationTISU into the sum of z matrixes with rank 1, the maximum value of z is K, assuming that the other K-1 columns are fixed, represented by Wk, and the k-th column is unknown. After completing this step, the singular value decomposition can be used to reach the minimum distribution of the k-th column.


## 5. Numerical Results

The simulations are carried out to evaluate the frequency drift and phase offset on the basis of the Gaussian delay model. We first compare the mean square error (MSE) of frequency drift and phase offset and corresponding CRLB. Then, we apply the estimation method, transmission delay optimization strategy, and clock data update scheme proposed in this paper to the time synchronization algorithm in [14] and compare the synchronization error with the enhanced precision time synchronization (E-PTS) algorithm [15] and the enhanced flooding time synchronization protocol (E-FTSP) algorithm [16]. The simulation parameters are shown in Table 1.Table 1
Simulation parameters.
ParametersValuesThe mean of frequency drift0.048The standard deviation of phase offset11.221μsMaximum data packet size127 byteCommunication radius20 mMaximum number of observation50Figure2 shows the simulation result of MSE and the corresponding CRLB of frequency drift with different transmission delays. It can be seen that the curve of MLE with optimized transmission delay performs close to the CRLB, and its variance goes to zero as the number of observations increases. Therefore, the performance of frequency drift estimation is effective. Also, the CRLB can predict this value well also. Note that the estimation with delay optimization works better than fixed transmission delay.Figure 2
MSE and CRLB comparison of frequency drift.Figure3 compares the performance of the proposed phase offset estimation method considering the optimized transmission delay with the fixed transmission delay. It can be seen that the MLE of optimized transmission delay outperforms the fixed delay due to the help of delay data screening and identification. We can also conclude that the MLE of phase offset with optimized transmission delay performs close to the CRLB, and its variance goes to zero as the number of observations increases. Therefore, the performance of phase offset estimation is effective.Figure 3
MSE and CRLB comparison of phase offset.The proposed algorithm uses a Gaussian delay model to estimate frequency drift and phase deviation. By optimizing the transmission delay and realizing the clock data update, the cumulative time synchronization error is minimized. In Figure4, with the increase in the number of observations, the average synchronization error of the proposed algorithm is between 10 and 20 μs, and the average synchronization error of the E-PTS algorithm and E-FTSP algorithm is between 42-60 μs and 48–78 μs, respectively. Therefore, the proposed algorithm in this paper has better time synchronization accuracy when paired nodes carry out time synchronization.Figure 4
Comparison of time synchronization error.


## 6. Conclusion

In this paper, we have proposed a clock frequency drift and phase offset estimation scheme for WSNs’ time synchronization. Based on the Gaussian delay model, this scheme calculates the maximum likelihood estimations of frequency drift and phase offset and the corresponding CRLB. At the same time, this paper also optimizes the transmission delay and updates historical clock data. Simulation results show that the scheme proposed in this paper improves the estimation accuracy and reduces the time synchronization error.



---

*Source: 3004218-2022-09-06.xml*