local and broadcast clock synchronization in a sensor node

4
IEEE SIGNALPROCESSING LETTERS, VOL. 13, NO. 1, JANUARY 2006 9 Local and Broadcast Clock Synchronization in a Sensor Node Brian M. Sadler, Senior Member, IEEE Abstract—Energy constrained wireless sensor networks need to maintain network timing for coordinating event detection and pro- cessing, and to enable receiver duty cycling and communications rendezvous, in order to save energy. Motivated by this, we consider synchronization of a slow low-power local oscillator with an occa- sionally observed fast and highly accurate broadcast clock (such as GPS). Errors are modeled as quantization noise, incurred when comparing the slow and fast clocks. We consider estimation of the offset and skew between the clocks, detection of drift in the local clock, and prediction of the broadcast clock based on the locally observed times. Index Terms—Quantization noise, regression, sensor network, synchronization. I. INTRODUCTION AND MODEL E NERGY constrained wireless sensor networks (ECWSNs) are now being developed for a great variety of applica- tions. Network synchronization is needed for event detection and signal processing and is key for energy savings, enabling receiver duty cycling and communications rendezvous and thus significantly enhancing the network lifetime. Distributed network timing protocols provide message passing schemes to maintain synchrony among nodes [1]–[3], seeking to minimize the communications cost for a given level of performance. For an overview of ECWSNs, including issues relating to network synchrony and duty cycling, see [4]. Generally, ECWSNs can significantly benefit from available external assets, such as mobile access points, that are not so energy constrained as the sensor nodes [5]. These assets can greatly reduce the energy cost of network setup and mainte- nance [4], [6]. In this letter, we consider clock synchronization within a node, between its local oscillator and a broadcast clock (such as GPS). Local oscillator technology generally trades off accuracy and speed for power, with current power consumption ranging from Watts to mWatts. This letter is motivated by the availability of very low power consuming, but relatively inac- curate, oscillators [4]. Timing accuracy may be enhanced, and network synchrony achieved, with the occasional availability of a more accurate broadcast clock. To save energy, the broadcast clock receiver in the node may be duty cycled and employ fast acquisition techniques. We assume the local clock is low power, relatively slow (e.g., Watts, kHz), and continuously observable, while a very highly Manuscript received June 23, 2005; revised August 26, 2005. This work was supported in part by the DARPA Connectionless Networks program. The as- sociate editor coordinating the review of this manuscript and approving it for publication was Dr. Cihan Tepedelenlioglu. The author is with the Army Research Laboratory, Adelphi, MD 20783 USA (e-mail: [email protected]). Digital Object Identifier 10.1109/LSP.2005.860551 accurate high-speed broadcast clock may be occasionally ob- served, e.g., via a duty-cycled fast-acquisition GPS receiver. We assume a separate receiver for the broadcast clock and are not relying on a message passing protocol, so we do not consider queuing delay. With this scheme, with very low power allocated to the local oscillator, energy consumption depends critically on the duty cycle rate of the broadcast clock receiver. Given the wide disparity in local and broadcast clock rates, we model the relationship between the two clocks as (1) with , and [independent and identically distributed (i.i.d.) and uniformly distributed, with variance ]. The broadcast clock is linearly re- lated to the local clock , with offset and skew . Given an observation , the nearest value of is selected, so that and are linearly related with uniform quantization error . The uniformly distributed noise assumption is similar to the quantization error incurred in analog-to-digital conversion and requires that the rate of the broadcast clock is at least several times that of the local clock. In the following, we consider esti- mation of , detection of drift in the local clock, and prediction of the broadcast clock based on the locally observed time. II. MAXIMUM LIKELIHOOD ESTIMATION Define the unit step else. (2) With , the joint pdf is given by (3) The pdf is nonzero only if for all . So, we can write for else , else (4) U.S. Government work not protected by U.S. copyright.

Upload: bm

Post on 10-Mar-2017

217 views

Category:

Documents


0 download

TRANSCRIPT

IEEE SIGNAL PROCESSING LETTERS, VOL. 13, NO. 1, JANUARY 2006 9

Local and Broadcast Clock Synchronizationin a Sensor Node

Brian M. Sadler, Senior Member, IEEE

Abstract—Energy constrained wireless sensor networks need tomaintain network timing for coordinating event detection and pro-cessing, and to enable receiver duty cycling and communicationsrendezvous, in order to save energy. Motivated by this, we considersynchronization of a slow low-power local oscillator with an occa-sionally observed fast and highly accurate broadcast clock (suchas GPS). Errors are modeled as quantization noise, incurred whencomparing the slow and fast clocks. We consider estimation of theoffset and skew between the clocks, detection of drift in the localclock, and prediction of the broadcast clock based on the locallyobserved times.

Index Terms—Quantization noise, regression, sensor network,synchronization.

I. INTRODUCTION AND MODEL

ENERGY constrained wireless sensor networks (ECWSNs)are now being developed for a great variety of applica-

tions. Network synchronization is needed for event detectionand signal processing and is key for energy savings, enablingreceiver duty cycling and communications rendezvous andthus significantly enhancing the network lifetime. Distributednetwork timing protocols provide message passing schemes tomaintain synchrony among nodes [1]–[3], seeking to minimizethe communications cost for a given level of performance. Foran overview of ECWSNs, including issues relating to networksynchrony and duty cycling, see [4].

Generally, ECWSNs can significantly benefit from availableexternal assets, such as mobile access points, that are not soenergy constrained as the sensor nodes [5]. These assets cangreatly reduce the energy cost of network setup and mainte-nance [4], [6]. In this letter, we consider clock synchronizationwithin a node, between its local oscillator and a broadcast clock(such as GPS). Local oscillator technology generally trades offaccuracy and speed for power, with current power consumptionranging from Watts to mWatts. This letter is motivated by theavailability of very low power consuming, but relatively inac-curate, oscillators [4]. Timing accuracy may be enhanced, andnetwork synchrony achieved, with the occasional availability ofa more accurate broadcast clock. To save energy, the broadcastclock receiver in the node may be duty cycled and employ fastacquisition techniques.

We assume the local clock is low power, relatively slow (e.g.,Watts, kHz), and continuously observable, while a very highly

Manuscript received June 23, 2005; revised August 26, 2005. This work wassupported in part by the DARPA Connectionless Networks program. The as-sociate editor coordinating the review of this manuscript and approving it forpublication was Dr. Cihan Tepedelenlioglu.

The author is with the Army Research Laboratory, Adelphi, MD 20783 USA(e-mail: [email protected]).

Digital Object Identifier 10.1109/LSP.2005.860551

accurate high-speed broadcast clock may be occasionally ob-served, e.g., via a duty-cycled fast-acquisition GPS receiver. Weassume a separate receiver for the broadcast clock and are notrelying on a message passing protocol, so we do not considerqueuing delay. With this scheme, with very low power allocatedto the local oscillator, energy consumption depends critically onthe duty cycle rate of the broadcast clock receiver.

Given the wide disparity in local and broadcast clock rates,we model the relationship between the two clocks as

(1)

with , and [independent andidentically distributed (i.i.d.) and uniformly distributed, withvariance ]. The broadcast clock is linearly re-lated to the local clock , with offset and skew . Givenan observation , the nearest value of is selected, so that

and are linearly related with uniform quantization error. The uniformly distributed noise assumption is similar to the

quantization error incurred in analog-to-digital conversion andrequires that the rate of the broadcast clock is at least severaltimes that of the local clock. In the following, we consider esti-mation of , detection of drift in the local clock, and predictionof the broadcast clock based on the locally observed time.

II. MAXIMUM LIKELIHOOD ESTIMATION

Define the unit step

else.(2)

With , the joint pdf is given by

(3)

The pdf is nonzero only if forall . So, we can write

forelse

,

else

(4)

U.S. Government work not protected by U.S. copyright.

10 IEEE SIGNAL PROCESSING LETTERS, VOL. 13, NO. 1, JANUARY 2006

From the Neyman–Fisher factorization theorem, (4) showsthat together, the order statistics and

are minimally sufficient for the esti-mation of . However, finding the minimum variance unbiased(MVU) estimator is complicated by the fact that two statistics areneeded (the min and the max). Consequently, in the following,we consider maximum likelihood and linear estimators for .

The maximum likelihood estimator (MLE) of is given by

(5)

From (4), the maximum is achieved whenever both the min andmax conditions are satisfied, i.e., when both step functions areequal to one. The MLE is generally not unique. Further, allMLEs are equivalent in the sense that ,for any satisfying (5). So, finding involves searchingfor boundaries of (possibly disconnected) regions in the

plane such that (5) is satisfied for all , and allsuch are equally legitimate ML solutions. A valid ML solu-tion is such that for all .

Given an MLE set of solutions , it is not immediately ob-vious which might be preferred. The mean ofis not a good choice, as the 2-D region of support for issuch that the mean is not guaranteed to be contained in(see the example that follows). An alternative is to consider theresiduals , with an MLE.For example, we might choose such that the mo-ments of the corresponding residual sequence best matchesthe true moments of the pdf of . However, moment matchingmay require large , and finding the boundaries of gener-ally requires searching that may be computationally expensive.For these reasons, we next consider linear estimation of .

III. LINEAR ESTIMATION

Given the difficulties with the MLE, we turn to linear estima-tion of .1 Rewriting (1), we have

(6)

with , ,, and . Under our noise as-

sumptions, . For this case, regardless of the spe-cific pdf of , the best linear unbiased estimate (BLUE) is givenby the Gauss–Markov theorem (e.g., see [7])

(7)

with the variance of given by

var diag (8)

When the noise is i.i.d. normal, then the result is well knownto correspond to the MLE, with Fisher information matrix

, and the estimate is efficient (always achieves theCRB).

1The method can be extended to the Bayesian linear estimator, especiallywhen � is known, and the prior on � need only be specified via a mean andcovariance.

Fig. 1. Example comparing MLE and linear estimation of clock offset andskew.

It is interesting to contrast the MLE (5) and linear estimator(7). It is not clear what is the best attainable performance (wehave not found the MVU estimator). Numerical tests show thatthe linear estimator (7) is not guaranteed to be an MLE, in that

very often violates the min and max conditions in (4), so thatdoes not satisfy (5). This occurs for small or large and ,

often with a majority of Monte Carlo trials yielding that doesnot solve (5). On the other hand, the variance of the linear esti-mator is always given by and so has both relativelylow fixed complexity and predictable performance. From an ex-perimental design perspective, it is desired that the diagonal el-ements of the projection matrix be small.The BLUE may also be preferred from a robustness standpoint,as it incorporates all samples, and uniform sampling in is bestfrom a robustness perspective [8]. Robust linear estimators canbe employed if outliers are expected (e.g., [9, ch. 25]).

Sums, and sums of ratios of i.i.d. uniform random variables,quickly conform to a Gaussiandistribution (e.g., see [10]).There-fore, is asymptotically normal, and this holds even for small(the normal approximation is reasonable even for ). Con-sequently, results on Gaussian confidence intervals can be ap-plied when using (7), and this enables tests for lack of fit, as wellas prediction intervals. Results for inference on the meanare generally asymptotically valid when is i.i.d. non-Gaussian[7, ch. 10]. Here, with convergence to normal for small , theasymptotics become valid very rapidly. (The uniform noise caseis roughly the opposite of heavy tailed distributions, where theasymptotics may become valid very slowly.)

For an example, we set , ,, and . Results are shown in Fig. 1

for a single realization of . Results for both MLE and linearestimation are shown. The range of MLE values describing theboundary of was found via numerical search and is de-picted in the figure as the interior of the trapezoidal-like region.Both the true value for and the resulting linear estimate areshown. Also plotted is the 95% joint confidence region for linearestimation. The confidence region is found from

(9)

SADLER: LOCAL AND BROADCAST CLOCK SYNCHRONIZATION IN A SENSOR NODE 11

where degrees of freedom, , , anddenotes the percentage point of the -distri-

bution (e.g., [11]). Equation (9) describes an ellipse centered on, whose interior defines the joint confidence region. This ex-

ample illustrates the relative accuracy of estimating versus, which results in asymmetry in both the linear estimator con-

fidence region and . From (8), we find the variance of is. Note that, for this noise realization,

, although as we have mentioned this is not true ingeneral.

IV. DETECTING CLOCK DRIFT

The local clock will generally drift with time, primarily as afunction of temperature but also due to aging and other factors.This drift means that will be slowly time varying. In the shortterm, (1) will apply, but it is of interest to monitor and detect thedrift. Modeling the drift as constant, we have

(10)

Combining this with (1), we obtain

(11)

so that linear drift results in a quadratic model between the twoclocks that, if not accounted for, results in a bias in estimates of

when the linear model is assumed. (The bias is a function ofchoice of .) So, it is of interest to develop tests to discriminatebetween the linear versus quadratic model. Next, we considertwo such tests for lack of fit of the linear model.

One possible test compares the linear model against thefeared quadratic model ( linear, quadratic).The linear model is given by (6), while under the quadraticmodel, this is modified to be , with ,

, where denotes the vector whose

elements are squared. Let be the linear estimate underand the estimate under . The -test for this case is (e.g.,[11, ch. 29])

(12)

where and are theresidual sum of squares under and , respectively,

degrees of freedom under , and extra degrees offreedom. When the left-hand side of (12) is less than

, then we accept the linear model as more plausible and rejectthe quadratic. The test is exact under an additive Gaussian noisemodel and asymptotically valid for our case.

Another possible test is

(13)

This can be accomplished by finding the linear estimateand examining the confidence interval for .

Under our assumptions, the confidence interval is

std (14)

Fig. 2. Drift detection example, depicting probability of correctly detectingdrift, with curves parameterized by data size N .

where is the percentage point of the-distribution, degrees of freedom, and std is

the theoretical standard deviation of the estimate, obtained from(8) under the quadratic model. If the theoretical variance is notavailable, it can be estimated and used in (14). If the intervalin (14) contains 0, then the hypothesis cannot be rejected,whereas if the interval does not contain 0, then is rejectedwith confidence .

Note that the -distribution is well approximated by the stan-dard normal pdf as , for relatively small , in whichcase in (14) can be replaced with the tail probabil-ities from a standard normal. Examination of as afunction of , with small, shows that becomesnearly constant for or greater. So, for example, with,say, then we could simply check if 0 is contained in theinterval std .

For example, suppose the local clock has a nominal rate of32 kHz and set , . We vary the quadraticparameter and apply the test of (12) to detect the fact that

. Fig. 2 shows probability of correctly deciding ,plotted against a range of values of . Curves are parameter-ized by data size , with . The probabilityof detection is based on 5000 Monte Carlo trials for each valueof . Large results in faster drift that is more easily de-tected for constant , and larger observation size results inbetter detection for smaller drift.

V. RENDEZVOUS AND CLOCK PREDICTION

Network timing is key to enabling communications ren-dezvous and energy savings via receiver duty cycling. Givenan estimate based on values of , we can predict futurevalues of the broadcast clock based on the local clock. At aspecific future time on the local clock (say, secondsbeyond the th observation), the corresponding broadcastclock time can be predicted via

(15)

12 IEEE SIGNAL PROCESSING LETTERS, VOL. 13, NO. 1, JANUARY 2006

Fig. 3. Confidence intervals for prediction of broadcast clock, for two differentsets of observations.

where and are the mean of and , respectively. Confidenceintervals on then bound prediction accuracy.

The variance of the prediction in (15) is given by

var (16)

The confidence interval around , under our as-sumptions, is asymptotically approximated by

var (17)

where degrees of freedom. For example, for a givenfuture local time , and , then 95% of our randomobservations of are expected to lie in the interval definedby (17).

As an illustration, we consider prediction to schedule a com-munications rendezvous. To motivate, suppose a 1 ms transmis-sion slot isused; then,wemight wish to obtain future timing accu-racy to a fraction of a ms to avoid excess wasted receiver on timeand detection processing. The prediction is made using (15).

We use , , and , with the localclock running at 32 kHz. The observations are taken in two ways,1) every second in [0,99] s and (2) every 10 s in [0,990] s. Fig. 3plots var against prediction time for case1 (top) and case 2 (bottom), with a prediction time of zero cor-responding to the last observation time (99 or 990 s). The bestresults occur in the bottom panel, corresponding to the longer ob-servation interval (990 s). Here, for example, the results indicatethat with 95% confidence, prediction out to 1500 s will be within

0.2 ms of the actual reading of clock and about 0.4 ms at6000 s, which might be reasonable for a 1 ms slot time.

VI. CONCLUSION

Until very low power yet highly stable oscillators are avail-able, energy constrained sensor network synchronization will

rely on message passing protocols or reference transmissions. Insituations with prolonged network inactivity, coarse synchronycan be maintained over quiescent periods. Then, upon initia-tion of network traffic, a tighter synchrony can be reestablished.Based on the results of Section V, transmission (or receive) du-ration can be adaptively extended to ensure high probability ofdetection at the receiver, with the required transmission durationgrowing with prediction time . Thus, duty-cycle-based energysavings can be achieved in both low and high traffic scenarios.

While we have focused on one node, some interesting exten-sions to this paper include the passing of estimates of betweennodes, as well as joint estimation strategies. When the localclock is also used to generate a carrier for transmission, thenthe clock skew between two nodes is related to the observedcarrier offset, which can be directly estimated at the receiver.Knowledge of clock skew between two nodes implies knowl-edge about the carrier offset, and this can be used at the receiverto reduce carrier acquisition complexity, e.g., when employingnoncoherent direct sequence transmission [12].

Our model assumes that, due to the large disparity in ratesbetween the local and broadcast clocks, the error will be domi-nated by quantization between the two clocks. If additional errorsources are significant enough, then they must be accounted foras well; for example, the whiteness of the residuals should beverified. For long-term tracking, a Kalman filter approach maybe applied, and extensions of this to the case of a duty-cycledbroadcast clock receiver are of interest. Finally, we note that theresults of this paper may be more generally applicable due toasymptotic normality and because the noise variance may beestimated and used in the formulas presented.

REFERENCES

[1] J. Elson, L. Girod, and D. Estrin, “Fine-grained network time synchro-nization using reference broadcasts,” in Proc. 5th Symp. OperationSystem Design and Implementation, Dec. 2002.

[2] S. Ganeriwal, R. Kumar, and M. B. Srivastava, “Timing-sync protocolfor sensor networks,” in Proc. ACM Conf. Embedded Networked SensorSystems, 2003.

[3] F. Sivrikaya and B. Yener, “Time synchronization in sensor networks: asurvey,” IEEE Network, vol. 18, no. 4, pp. 45–50, Jul./Aug. 2004.

[4] B. M. Sadler, “Fundamentals of energy-constrained sensor network sys-tems,” IEEE Aerosp. Electron. Syst. Mag., pt. 2, vol. 20, no. 8, pp. 17–35,Aug. 2005.

[5] Q. Zhao and L. Tong, “Energy efficiency of large-scale wirelessnetworks: Proactive versus reactive networking,” IEEE J. Sel. AreasCommun., vol. 23, no. 5, pp. 1100–1112, May 2005.

[6] B. M. Sadler, R. J. Kozick, and L. Tong, “Multi-modal sensor localiza-tion using a mobile access point,” in Proc. Int. Conf. Acoustics, Speech,Signal Processing, vol. 4, 2005, pp. 753–756.

[7] S. F. Arnold, The Theory of Linear Models and Multivariate Anal-ysis. New York: Wiley, 1981.

[8] D. P. Wiens, “Designs for approximately linear regression: two opti-mality properties of uniform designs,” Statist. Prob. Lett., vol. 12, pp.217–221, Sep. 1991.

[9] N. R. Draper and H. Smith, Applied Regression Analysis, 3rd ed. NewYork: Wiley, 1998.

[10] G. Marsaglia, “Ratios of normal variables and ratios of sums of uniformvariables,” J. Amer. Statist. Assoc., vol. 60, pp. 193–204, 1965.

[11] A. Stuart, J. K. Ord, and S. Arnold, Kendall’s Advanced Theory of Sta-tistics. London, U.K.: Arnold, 1999, vol. 2a.

[12] B. M. Sadler, “Critical issues in energy-constrained sensor networks:Synchronization, scheduling, and acquisition,” in Proc. Int. Conf. Acous-tics, Speech, Signal Processing, vol. 5, 2005, pp. 785–788.