nd Inernaional Conference on Elecronic & Mechanical Engineering and Informaion Technology (EMEIT-) A Muli-model Kalman Filer Clock Synchronizaion Algorihm based on Hypohesis Tesing in Wireless Sensor Neworks Xiali Li,a, Shaona Yu,Yuan Lin, Min Xi Compuer Science and Technology, Minzu Universiy of China, Beijing, China, Compuer Science and Technology, Xi an JiaoTong Universiy,Shannxi, China a xiaer_li@63.com Keywords: WSN;Muli-model;Kalman Filer;Hypohesis Tesing;Clock Offse Absrac. Accurae and efficien clock synchronizaion algorihm is very imporan in Wireless Sensor Neworks (WSN). Considering he physical naure of sensors, a muli-model kalman filer clock synchronizaion algorihm based on experimens and hypohesis esing heory is proposed. The sensor experimens on he base of TelosB plaform demonsrae ha sensor clock sysem swiches beween differen models. Based on his observaion, a general muli-model kalman filer o describe clock offse is presened. Hypohesis esing mehod is used o swich he model beween he firs-order kalman filer and second-order kalman filer. Experimens show ha he proposed algorihm can race clock offse effecively. Inroducion Clock synchronizaion is imporan in wireless sensor nework (WSN). Soring logs for sysems diagnosics, coordinaing of scheduling evens in some media access conrol(mac) proocols and providing accurae imesamps for crypographic proocols all need precise clock synchronizaion mechanism. Ref. [] and [] hink ha limied power of sensor nodes in WSN make i impossible o achieve clock synchronizaion by unlimied passing informaion among sensor nodes. Due o limied power, phase noise, hermal noise and degradaion rae, he sensor clock crysal frequency is no very precise. Ref. [3] hink ha sensors are usually deployed in a complex environmen in which emperaure, humidiy and oher facors may affec he work of he clock. The feaures of WSN make i very difficul o use he exising mehods o realize clock synchronizaion. Mos clock synchronizaion proocols such as hose presened in [4, 5, 6] use Sochasic Differenial Equaions (SDEs) o describe he clock model on he base of oscillaor physical naure. Proocols presened in [7, 8] use a consan model o describe he relaively sable clock sysem wih "whie noise" which reflecs phase noise and oher random facors. Researchers usually build clock skew modeling by using he firs-order auoregressive model. Ref. [4] uses second-order kalman filer model o describe clock skew. However, mos of he models are only suiable for special environmens and are no general. In order o alleviae he various difficulies of clock synchronizaion, his paper proposes a general clock synchronizaion algorihm based on he muli-model kalman filer and hypohesis esing heory. From he sensor experimens on he base of TelosB plaform, i is observed ha sensor clock sysem swich beween differen models. Based on his analysis, a general muli-model kalman filer model is pu forward for describing clock oscillaor drif. Expecaion-maximum(EM) algorihm is used o esimae parameers in he model and hypohesis esing mehod is used o realize model swich beween he firs-order kalman filer and second-order kalman filer. Finally, he performance gains of our algorihm is demonsraed by using differen kalman filer models based on experimen daa. Sensor Clock Experimen and Analysis Published by Alanis Press, Paris, France. he auhors 4
nd Inernaional Conference on Elecronic & Mechanical Engineering and Informaion Technology (EMEIT-) offse value(ms) Sensor Clock Experimen Se.In order o sudy clock model from he perspecive of crysal oscillaor, he following experimens are implemened. Clock skew es of wireless sensor nodes was conduced. Node model is TPR4CA, he plaform is TelosB, CPU frequency is from 4MHz o 483.5MHz. I is noeworhy ha TPR4CA is he mainsream hardware for wireless sensor neworks. The es environmen was he enclosed area wih air condiioning where emperaure was conrolled o be 5 ± 5 C. All sensors were deployed a differen locaions o monior emperaure and send emperaure messages o he receiver a 5s inervals. Receiver was conneced o he compuer wih a sable elecriciy supply. When emperaure message was received, he ime when he message was sen exacly will be recorded. This recorded ime is he basis of ime synchronizaion es. All sensor nodes were powered by he same ype of baery. The experimen was repeaed imes. All he sensor nodes have he same ime offse rule was observed. Here he paper randomly seleced hree nodes daa o explain he experimen resuls. Resuls and Analysis.Before node power is depleed, each node can upload abou 67 daa o he receiver. During he las period when baery is nearly depleed, he received daa is very unsable. So only he firs 6 messages were used o analyze he daa. Fig. shows he clock offse of hree nodes a differen ime. The doed line shows he ideal clock, he oher hree curves show he hree clock offse of he sensor nodes. From Fig., i can be seen ha every clock offse curve has a deviaion wih he ideal curve and he deviaion has a gradual upward rend. The firs 3 sampling poins are relaively sable, while he remaining nodes deviae from he ideal curve rapidly. All he informaion shows ha random noise is no he only facor ha affecs clock offse and hese clocks are slower han he ideal clock. From Fig., i can be observed ha he clock skew has he model-swiching phenomenon. A single model can no effecively describe he sensor node clock changes from he observaion and analysis of he experimens. Figure he clock offse of hree nodes Muli-model Kalman Filer Clock Model Clock model of he wireless sensor node is very complex. Therefore, esablish a reliable clock model o realize clock synchronizaion is imporan. As he clock oscillaor frequency is a key facor ha affecs clock, crysal oscillaor characerisics are he focus in his secion. From Ref.[], he following general clock offse model is goen, o[ = o[n ] + s[τ [ +.5γ [τ [ + ϑ[ () where o[ is clock offse, s[ is he clock skew a sampling ime n, τ [ is sampling ime inerval, ϑ[ is he combinaion of offse noise, skew noise and aging rae noise, and γ [ is he aging rae. Published by Alanis Press, Paris, France. he auhors 5
nd Inernaional Conference on Elecronic & Mechanical Engineering and Informaion Technology (EMEIT-) As in [], x [ represens he n-h value of he clock variable, y[ represens he n-h clock observaion, F represens he sae ransiion marix, H represens he observaion marix, μ [ and ζ [ represens he whie noise covariance marix Q and R respecively, he following Kalman Filer can be obained. x[ = Fx[ n ] + μ[ () y[ = Hx[ + ζ [ Two kinds of kalman filer models according o he above definiions are discussed here. Case : If he aging rae is zero, he clock model is regarded as a consan velociy model. The following se for he kalman filer is given x = [ o[ s[ ] T τ, F =, H = [ ], μ [ n ] = [ ϑ[ η[ ] T where μ [ is sae noise and ζ [ is observaion noise. Thus he model is he firs-order kalman filer of he clock offse. Case : If he aging rae is a non zero consan, he clock model is regarded as an acceleraed moion model. The aging rae is a small perurbaion around he mean random process. Assuming a iny disurbance for a whie noise, se he kalman filer o be he following τ τ x = [ o[ s[ γ[ ] T, F = τ, H = [ ], μ [ n ] = [ θ[ η[ ρ[ ] T, where ρ[ is aging rae noise, ζ [ is observaion noise. Then he model becomes he second-order kalman filer of he clock offse. Ref. [] has used firs-order kalman filer o rack he clock synchronizaion and he resuls shown ha firs-order kalman filer can only race he observaion daa of some sampling poins. Ref. [] has used second-order kalman filer o rack he clock synchronizaion and he resuls shown ha second-order kalman filer has proper performance in racing he laer sampling poins. Ref. [] and Ref. [] show ha wheher firs-order kalman filer or second-order Kalman filer clock model can no race clock offse very well independenly. Furher analysis demonsraes ha he clock offse can be divided ino wo pars. The firs par approximaes o mee he firs-order kalman filer model and he oher par approximaes o saisfy he second-order kalman filer model. In his paper, a muli-model kalman filer clock synchronizaion model is proposed. Using his mehod, he dynamic sysem can swich beween firs-order kalman filer and second-order kalman filer. Hypohesis Tesing for Muli-model Kalman Filer Hypohesis Tesing.The covariance S a ime in he ieraive process of he kalman filer can be obained by he following equaion T S = HV, H + R (3) where H represens observaion marix model a ime and is used o map he acual sae space o he observaion space, R is whie noise covariance marix value a ime, V, is he error covariance marix for esimaion value based on observaional daa of he - momen prior o he ime, H represens he iniial se and has differen value for firs-order filer and second-order filer. For he sysem wih wo models, he ransfer of he model can be refleced in he changes of he error covariance. Tha is, if he model is ransferred, significan changes in error covariance will occur. Therefore, hypohesis esing is used o deermine he ransfer of his model. Based on hypohesis esing heory [], he following null hypohesis and alernaive hypohesis can be goen, H S S, H S S (4) : = : where H is rejecion region and H is accepance region. Published by Alanis Press, Paris, France. he auhors 6
nd Inernaional Conference on Elecronic & Mechanical Engineering and Informaion Technology (EMEIT-) Using (3) and (4), Eq. (5) can be obained, P { rejech Hisrue} = P{ ( D K) ( D K) } = sh (5) where s h is he significance level, Kand K are hreshold, K < K, D is rejecion region. Based on Eq. (4) and Eq. (5), he following rejecion region D will be goen, D K = χ ( m) or D K = χ ( m) (6) s h / s h / where m is degrees of freedom. Using he mehod of hypohesis esing, no only compuing he ransiion probabiliy marix is avoided, bu also judging when he sae of he kalman ieraive process ransfer is avoided. Clock Offse Tracing Using Muli-model Algorihm.The only observaional daa is clock skew in observing sysem. The observaion error U is one-dimensional vecor. Ref. [] indicaes ha hypohesis esing is usually 5%, % or.% significance level. sensor-s sensor-s sensor3-s sensor's error 5-5 muliple firs-order second-order - 3 4 5 6 P(,) 8 6 4 3 4 5 6 sampling poins sensor's error sensor3's error 5-5 muliple firs-order second-order - 3 4 5 6 5-5 muliple firs-order second-order - 3 4 5 6 sampling poins Figure he firs iem of error covariance marix Figure 3 Error comparison resul beween differen models If he hypohesis esing probabiliy is less han s h, i will rejec he null hypohesis. The more significanly lower han s h, i will be he more inclined o accep he null hypohesis. Bu a he same ime, i will increase he risk of error null hypohesis (Type II error described in []). Therefore, i does no have saisical naure. As how o choose significan level is involved in balance significance and effeciveness of hypohesis esing, he significan level is generally in he probabiliy inerval from Type I o Type II error probabiliy. Here % is used o be as he significance level o verify he muli-model kalman filer performance. Fig. shows he racking of he firs iem (P(,)) of error covariance marix of mulimode clock offse racking. (P(,)) converges o a fixed value in a very shor period of ime. There is a small flucuaion a approximaely he 3h sampling poin and i demonsraes ha a model swich occurs a his ime. Fig. 3 shows ha he error comparison beween observaion value and esimaed values of differen models. From Fig.3, i can be seen ha he error in he las par of he firs order filer and he firs par of second-order filer are greaer han hose in muli-model. Fig. and Fig. 3 demonsrae ha he muli-model kalman filer has a higher accuracy compared wih firs-order filer and second-order filer. Conclusion The muli-model kalman filer mehod in clock offse racking has smaller error compared wih he simple firs-order or second-order mehods. The muli-model algorihm is divided ino learning phase and racking phase. I coninuously collecs clock synchronizaion messages of he clock model in Published by Alanis Press, Paris, France. he auhors 7
nd Inernaional Conference on Elecronic & Mechanical Engineering and Informaion Technology (EMEIT-) learning sage. The messages are he basis for racking in he nex sage. In he racking phase, he algorihm synchronizes he clock of he wireless sensor nodes using he muli-model kalman filer. The compuing funcion of he wo sages is configured in he server, so he algorihm does no have oo much impac on he energy consumpion of sensor nodes. Therefore, he muli-model kalman filer algorihm based on hypohesis esing has good performance han firs-order and second- order filer. Acknowledgmen This paper is suppored by he Naional Key Technologies R&D Program of China(No.9BAH4B7) and he Real-ime POCS daa reconsrucion based on conjugae gradien and Graphic Processing Uni projec(n.kyqn38). References [] Hamilon BR, Ma X, Zhao Q, e al. ACES: adapive clock esimaion and synchronizaion using Kalman filering[c]: ACM, 8: 5-6. [] Sullivan D, Allan D, Howe D, e al. Characerizaion of clocks and oscillaors. Naional Ins. of Sandards and Technology, Boulder, CO. Time and Frequency Div, 99. [3] Sundararaman B, Buy U, Kshemkalyani AD. Clock synchronizaion for wireless sensor neworks: a survey[j]. Ad Hoc Neworks, 5, 3 (3): 8-33. [4] Galleani L, Sacerdoe L, Tavella P, e al. A mahemaical model for he aomic clock error[j]. Merologia, 3, 4: S57-S64. [5] Kim KS, Lee BG. Kalp: A kalman filer-based adapive clock mehod wih low-pass prefilering for packe neworks use[j]. IEEE Transacions on Communicaions,, 48 (7): 7-5. [6] Auler LF, d'amore R. Adapive Kalman Filer for Time Synchronizaion over Packe-Swiched Neworks: An Heurisic Approach[C], 7: -7. [7] Veich D, Babu S, Pàszor A. Robus synchronizaion of sofware clocks across he inerne[c]: ACM New York, NY, USA, 4: 9-3. [8] Allan DW. Time and frequency(ime-domain) characerizaion, esimaion, and predicion of precision clocks and oscillaors[j]. IEEE ransacions on ulrasonics, ferroelecrics, and frequency conrol, 987, 34 (6): 647-654. [9] Elson JE. Time synchronizaion in wireless sensor neworks[d]: Universiy of California Los Angeles, 3. [] Xiali Li,e al. A General Clock Synchronizaion Mehod Based on Kalman Filer Model in Wireless Sensor Neworks[C], Inernaional Conference on Consumer Elecronics, Communicaions and Neworks,. [] Yu Yang, Zhulin An, Yongjun Xu, Xiaowei Li, Canfeng Che. Passive Loss Inference in Wireless Sensor Neworks Using EM Algorihm[J], Wireless Sensor Nework,,(7):5-59. [] Xiali Li,e al. Clock Synchronizaion Using Expecaion-Maximizaion Algorihm in Wireless Sensor Nework[C],inernaional Conference on Compuer Science and Service Sysem,:in press. Published by Alanis Press, Paris, France. he auhors 8