Comparing Digital Phase-Locked Loop and Kalman Filter for Clock Tracking in Ultrawideband Location System

Impulse radio ultrawideband (IR-UWB) [1] is considered to be promising for indoor location. To estimate the tags location using time difference of arrival(TDOA-) based localization, the anchors’ local clocks are required to be fully synchronized with each other [2], but the anchors’ clocks are varied with the running time and temperature drift [3]. The anchors must be synchronized periodically [4]. The location system is as Figure 1 shows. There are four anchors: anchor 1 is selected as the reference anchor and the other three anchors are the passive anchors. The reference anchor sends the clock synchronization packets to its passive anchor, which are represented by the orange lines in Figure 1. The clock synchronization algorithm (Algorithm 1) that we used is one-way message dissemination [5]. The clock variance between the passive anchor’s local clock and its reference anchor is tracked. The data’s arrival time from tag to anchors is corrected for the same time base between the reference and passive anchors. Then the TDOA algorithm effectively gets the tag’s location. So how to track the clock variance between reference-passive anchors is important for UWB location. Traditionally, we model the clock time as a continuous function of clock skew (frequency difference) γ and the clock offset (phase difference) θ [6]. Cm (t) = t, Cs (t) = γ ⋅ t + θ, (1)


Introduction
Impulse radio ultrawideband (IR-UWB) [1] is considered to be promising for indoor location.To estimate the tags location using time difference of arrival-(TDOA-) based localization, the anchors' local clocks are required to be fully synchronized with each other [2], but the anchors' clocks are varied with the running time and temperature drift [3].The anchors must be synchronized periodically [4].The location system is as Figure 1 shows.There are four anchors: anchor 1 is selected as the reference anchor and the other three anchors are the passive anchors.The reference anchor sends the clock synchronization packets to its passive anchor, which are represented by the orange lines in Figure 1.The clock synchronization algorithm (Algorithm 1) that we used is one-way message dissemination [5].The clock variance between the passive anchor's local clock and its reference anchor is tracked.The data's arrival time from tag to anchors is corrected for the same time base between the reference and passive anchors.Then the TDOA algorithm effectively gets the tag's location.So how to track the clock variance between reference-passive anchors is important for UWB location.
Traditionally, we model the clock time as a continuous function of clock skew (frequency difference)  and the clock offset (phase difference)  [6].
where   () denotes a reference clock of the sending anchor and   () denotes the local clock of the receiving anchor.In digital clocks, time is recorded by counting the number of periods of a repeating clock signal.At each rising clock edge of the periodic signal, an integer time counter is incremented.
The main problem of network synchronization is to resolve the observed time in (1).The algorithms considered here use a one-way message dissemination approach at the level of discrete clock ticks.
Suppose that the anchors all have the features of transmitting and receiving the clock check packets (CCP) with the time stamps, and the initial master anchor transmits a CCP with period , as shown in Figure 2. In the th round of broadcast message, reference anchor broadcasts a synchronization message CCP at  1, and the passive anchor records its time  2, at the reception of that message.Δ  denotes the interval between receiving a signal and the following initial local clock tick caused by the clock offset.According to [5], the timing model of the th broadcast message is given by where   is the random variable delay in the transmission.The clock tracking is implemented with the main "process" function taking two inputs: (1) The slave anchor CCP receiving time with its time base.(2) The master anchor CCP transmitting time with its time base and the CCP time of flight (TOF).
According to Figure 3, the clock tracking process uses CCP receiving time and CCP transmitting time and the best estimated time between the master unit and the slave unit.If given the master and slave anchors' (, , ) coordinates, the CCP TOF will be obtained by dividing the distance by the speed.At last, clock tracking process draws the real relative clock offset and the best estimated relative clock offset between master and slave units.Digital phase-locked loop (DPLL) and Kalman filter both have been widely used as the clock tracking and clock correction schemes for the similar structure and properties.This paper compares the two schemes used for UWB location system.

Digital Phase-Locked Loop
Digital phase-locked loop (DPLL) is a digital closed-loop automatic control system that can follow the frequency and phase of the input signals [7,8].For UWB location system, we consider a second-order DPLL based on ZC-DPLL, as Figure 4 shows.
Assume that () is the input signal, () is zero mean additive white Gaussian noise, and  0 is the input signal clock period without correction.The input signal () with () is sampled at   by digital clock to output the loop phase error   .Ignore the impact of the quantizer; the sequence {  } directly comes into the digital filter; by smoothing, the digital filter outputs a more reliable correcting sequence {  } to digital clock:   = ()  .The second-order  operator function is where  1 and  2 are the loop gain factors.Assume that the loop gains of second-order DPLL are  0 and  1 , respectively.
In DPLL, correction signal   is used to control the next period:  +1 =  0 −  .Adjust   until the loop into the locked state   is the sample interval:   =   −  −1 ,  = 1, 2, . ... The sampling time   is deduced:

Kalman Filter
Kalman filter is the solution by the minimum mean square error (MMSE) of the optimal linear filtering [9,10].It estimates the current signal value according to the previous estimation and a recent observation data.In the concrete implementation process, the ( + 1)th period clock skew and clock drift of the master-slave clock is estimated according to the th sync cycle information. is the clock synchronization period;  , and  , are the correction of the clock skew and clock offset at the th clock period, respectively.  and   are the  clock skew and clock offset, respectively.At the moment of ( + 1), the clock relations between the adjacent clock periods are where  , is the clock skew variance and  , is the clock offset variance.Assume that   = [ ,  , ]  ; its additive covariance matrix is .We define the vector and matrix as follows: Kalman filter equations by iteration are as follows.
(1) Estimation where is the state to be estimated, and   is the input control vector. (

2) MMSE Matrix of the Estimation
where   is the MMSE matrix of the estimated   .
(3) Kalman Filter Gain Matrix where  +1 is the covariance matrix of the observation noise and the measurement matrix  +1 is a unit matrix.
(4) Correction After Kalman filtering, the correction is x+1 = [ θ+1 ; γ+1 ]  at the ( + 1)th clock period. +1 = x+1 is set to make up for the clock skew and clock offset.So the slave anchor's clock base will make up to the same clock base when the tag's data arrives. Relative According to ( 4)-( 7), as  = 0, 1, 2, . .., we will get Comparing ( 5) and ( 13), the recursive types are very similar.The Kalman filter structure is depicted in Figure 5.

Comparison and Analysis
According to the above descriptions about Kalman filter and DPLL, we compare the two schemes for UWB indoor location.In DPLL, correction sequences as the output of the signal through digital filtering control the digital clock period until the loop is locked.Kalman filter also abstracts the needed signal through the feedback loop, which uses the former data to estimate the current data.The two schemes use the error   through gain factor  to find the optimal estimation.By comparing ( 5) and ( 13), we just need to adjust gain factor  so as to get the similar results.
We define the passive anchor clock variance error between the real clock variance and the optimal estimated clock variance as   =   − x|−1 .Using the reference-passive anchors data backhaul sending time, data receiving time, and the optimal estimated time with the data flight time, the location engine in the server will calculate the relative clock offset variance.
As Figure 6 shows, the green line is the clock variance difference by Kalman filter and the black line is that by DPLL.They all tend to be stable over time, but the properties of Kalman filter are significantly better than those of DPLL.Kalman filter requires shorter capture time and smaller error.
By the theory of hypothesis, in order to give sufficient information for the DPLL to stay locked for continued real-time location system operation with good performance (including coping with a certain packet error/loss rate), we need to send the clock synchronization message more frequently than for Kalman filter.It reduces the air-occupancy needed for clock synchronization messages, which allows more air-time for receiving blink messages.This essentially increases the system tag capacity, especially in the lower data rate and longer preamble modes.

Improved Algorithms on Kalman Filter
As stated above, Kalman filter is better for clock synchronization indoor UWB location system.Its calculation is based on such an assumption: all measurements are composed of the real signal and additive Gaussian noise.If these assumptions are correct, Kalman filter will effectively get signal from the measurements containing noise.But if the reference anchor's clock check packets collide with tag's data packets with TOA or some other mistake challenges in [13], the assumptions are incorrect.Kalman filter will treat the collision or mistake as credible clock variance data, and it calculates by these data.And Kalman filter itself is a kind of low-pass filter; its response and correcting speed are slower.Therefore, the errors generated by the collision will for a long time seriously degrade the performance of the clock synchronization algorithm.
This paper proposes a method of monitoring and avoiding the wrong of collisions.Kalman filter gain is as (10) shows, defining an information matrix  as is used to represent the difference between estimated clock error and actual clock error.This information will be used  to prompt how well the current input fits the current state of filter.
If the OM (outlier metric) rises above a preset threshold which is an empirical value, the current input is untrusted.The improved Kalman filter does not update current state but discards this data directly to avoid error packet having a big impact for filter output.
In Figures 7 and 8, the blue lines are the real clock offsets and the red lines are the estimated clock offset by Kalman filter.We set a big data mistake at 150 s; the estimated clock offset is unable to keep pace with the real clock offset and up and down shocks with Kalman filter in Figure 7.With the resolution of the trustless input, the estimated clock offset is smooth in Figure 8.By comparing Figures 7 and 8, it is clearly seen that the improved Kalman filter enhances the capacity of resisting disturbance.

Conclusion
We have compared DPLL and Kalman filter for UWB indoor location network clock synchronization, and the analysis results show that Kalman filter copes better with clock errors and has better lock performance.And the improved Kalman filter is more immune to interference as the simulation results show.

Figure 3 :
Figure 3: The relative clock variation by clock tracking.

Figure 6 :
Figure 6: The difference between estimated time and real time.

Figure 7 :
Figure 7: The relative clock offset with big disturbance by Kalman filter.

Figure 8 :
Figure 8: The relative clock offset with big disturbance by improved Kalman filter.
to DPLL, we define   = [  ;   ] and define the Kalman gain vector as  = [ 0 ;  1 ].0 =  Δ / 0 ) 2 ]is the normalized variance values of  Δ with zero average distribution.The error is