XIX IMEKO World Congress Fundamental and ppled Metrology September 6, 009, Lsbon, Portugal PERFORMNCE COMPRISON OF THREE LGORITHMS FOR TWO-CHNNEL SINEWVE PRMETER ESTIMTION: SEVEN PRMETER SINE FIT, ELLIPSE FIT, SPECTRL SINC FIT Pedro M. Ramos, Fernando M. Janero, Tomáš Radl 3 Insttuto de Telecomuncações, Insttuto Superor Técnco, Lsbon, Portugal, Pedro.Ramos@Lx.t.pt Insttuto de Telecomuncações, Unversdade de Évora, Portugal, fmtj@uevora.pt 3 Insttuto de Telecomuncações, Lsbon, Portugal, Tomas.Radl@Lx.t.pt bstract The comparson of three dfferent algorthms for the estmaton of parameters of two sne sgnals wth common frequency s presented. The algorthms are the ellpse ft, the seven parameter sne ft and the spectral snc ft. The comparson ncludes sgnal to nose rato analyss, ampltude analyss and phase dfference analyss.. THE LGORITHMS Ths secton descrbes the three algorthms compared n ths paper: ellpse ft; seven parameter sne ft; and spectral snc ft. The goal of these algorthms s to estmate the ampltudes D, phases φ, DC components C and common frequency f of two acqured snewaves modeled by Keywords: snewave parameter estmaton, ampltude and phase measurements. u ( t ) = D cos ( πft + φ ) + C. In most two-channel applcatons the value of the ampltude and phase of each channel s not requred. The only values needed are n fact the ampltude rato D/D and phase dfference ϕ = φ φ. However, the frequency f must also be estmated snce t s not accurately known. Ths s due to the uncertanty of the generated snewaves frequency and uncertanty of the samplng frequency fs. The Cramér-Rao lower bound (CR) for parameter estmaton of dual-channel snewaves was determned n [4].. INTRODUCTION Estmaton of snewave parameters s needed n many applcatons of nstrumentaton and measurement. Drven by the need to standardze algorthms for analog to dgtal converters, IEEE ncluded n the 057 standard [] two algorthms that are smple to mplement, very effcent and accurate. The frst algorthm estmates the ampltude, phase and DC component for a known sgnal frequency. It s called the three-parameter sne-ft and t s a multple lnear regresson that requres no ntal estmatves of the parameters and the optmal parameters are obtaned wthout teratons. However, ther accuracy depends heavly on the accuracy at whch the sgnal frequency s known. To address ths ssue, the second algorthm also estmates the sgnal frequency (or more accurately, t estmates the rato between the sgnal frequency and the samplng rate). Unfortunately, t becomes a nonlnear regresson wth the addton of the frequency to the lst of estmated parameters. The soluton presented n [] requres an ntal set of estmatves of the four parameters whch are then mproved wth each teraton. In some applcatons, t s necessary to estmate the parameters of two common frequency sne sgnals (e.g., mpedance measurements [], laser anemometry [3] and lnear system sngle tone characterzaton). In these cases, the methods presented n [] are not sutable because they don t take nto account the system restrcton that both sgnals have the same frequency. In ths paper, the comparson between three algorthms that are capable of estmatng the parameters of two common frequency sne sgnals s presented. ISN 978-963-8840-0- 009 IMEKO ().. Ellpse Ft The ellpse ft algorthm was orgnally developed by [5] and mproved by [6]. It reles on estmatng the parameters of the ellpse that best ft, n a least-squares sense, the X-Y plot of two snewaves. The ellpse s mathematcally descrbed by the conc F ( u, u ) = au + buu + cu + du + eu + g = 0 () wth the constrant b 4ac < 0 whch can be transformed nto b 4ac = by scalng. The algorthm conssts on a non-teratve constraned mnmzaton process based of Lagrange multplers [6]. The ampltude rato and phase dfference are determned from the ellpse parameters [7] sgn ( a ) b D a =, cos ( ϕ ) =. D c ac (3) The sgn of the phase dfference s obtaned by observng the rotaton drecton of the consecutve samples. To avod mscalculatons due to the presence of nose, a votng system was mplemented to obtan the rotaton drecton [7]. 480
The numercal mplementaton of ths algorthm requres the constructon of 3 3 matrces wth a total of only 5 dfferent elements. Ths s a major advantage n terms of memory requrements makng the algorthm sutable for DSP mplementaton, snce the amount of memory needed s ndependent of the number of acqured samples N. 3. NUMERICL SIMULTIONS To assess the performance of the dfferent algorthms, they were mplemented n Matlab and several tests were executed. Snce the ultmate goal s to estmate the ampltude rato (D/D) and the phase dfference ( ϕ), the tests estmated the ampltude rato error (.e., the dfference between the estmated ampltude rato and the mposed rato) as well as the phase dfference error. For each set of tested parameters, 0 000 dfferent runs were executed to obtan the average values and the correspondng standard devatons. In each run, the ntal phase of the frst channel (φ) s a random varable wth a unform pdf between -80º and 80º. Sgnal frequency s khz and 90 samples per channel are taken at 96 ks/s. Whte Gaussan nose s added accordng to each channel sgnal-to-nose-rato (SNR)... Seven parameter sne ft The seven parameter sne ft algorthm [8] s a two channel extenson of the four parameter sne ft algorthm normalzed n [] for the characterzaton of DCs. The samples of the two acqured snewaves are used smultaneously to estmate the ampltudes D, phases φ, DC components C and the common frequency f. The need to estmate the frequency makes the algorthm nonlnear and teratve. From the ntal estmates of the snewaves parameters a system of nonlnear equatons yelds new estmatves and a frequency correcton f to be used n the next teraton. The convergence of the algorthm s dependent on the number of samples and the ntal estmates used. Ths algorthm nvolves the creaton of a matrx of sze N 7. s the number of samples ncreases, the memory requrements wll lmt the algorthm applcablty n DSP mplementaton. 3.. Sgnal to nose rato analyss In ths analyss, the sgnal ampltudes are fxed at D= V and D=0.5 V. Snce t s known that the ellpse ft algorthm cannot work near ϕ=80 and ϕ=0 because of ellpse degeneraton, the phase dfference s a unform pdf n the ±[0º;70º ] range. Ths ssue wll be analyzed and dscussed n Secton 3.3. The results for the ellpse ft are shown n Fg. and Fg.. It can be seen that the algorthm s based for poor sgnal to nose ratos (typcally below 40 d). s expected, the standard devatons mprove wth the ncrease n SNR. D Xˆ ( ω) = W ( ω ωx ) e jϕ + W ( ω + ωx ) e jϕ (4) where W (ω) s the spectrum of a rectangular wndow (.e., a snc functon). The resultng two-sded spectrum Xˆ (ω) conssts on two overlappng snc functons centered at ±ω X = ±π f f s. The maxmums of Xˆ (ω) are not centered at the frequences ±ω X due to the leakage of one snc nto the other. The algorthm searches for the snewaves parameters that mnmze the cost functon Xˆ ( ω) X ( ω) ω + Xˆ ( ω) X ( ω) (5) where X (ω) s the spectrum of each acqured channel. The algorthm s teratve and uses as a frst estmate the frequency obtaned by the IpDFT [0]. The remanng ntal parameters are obtaned by applyng the three parameter sne ft to each channel. The man advantage of ths algorthm s that the teratve part can be accurately computed usng as lttle as three sample ponts per channel, makng t memory wse very effcent (only the ntal FFTs are done wth the full number of acqured samples). D/D Error Standard Devaton ε= verage D/D Error.3. Spectral snc ft The spectral snc ft algorthm has been recently proposed as a new method to estmate the parameters of an acqured snewave [9]. Ths method has been extended to be appled to two channel acqustons. The acquston of a lmted number of samples s equvalent to applyng a rectangular wndow to the snewaves. The theoretcal spectrum of a wndowed snewave s Fg.. verage ampltude rato error () and correspondng standard devaton () for the ellpse ft algorthm as a functon of the two sgnal to nose ratos for D= V and D=0.5 V. 48
D/D Error Standard Devaton verage ϕ Error [ ] Fg. 3. Standard devaton of the ampltude rato () and phase dfference error () for the seven parameter sne ft algorthm as a functon of the two sgnal to nose ratos for D= V and D=0.5 V. Fg.. verage phase dfference error () and correspondng standard devaton () for the ellpse ft algorthm as a functon of the two sgnal to nose ratos for D= V and D=0.5 V. D/D Error Standard Devaton Note that, the fluctuatons n the results of the average phase errors (Fg. ) for the worst sgnal to nose ratos are caused by the low number of repettons and that the correspondng standard devatons are consderably hgher than the represented fluctuaton (e.g., for SNR=30d the average error s -0.005 and the standard devaton s 0.4 ). The results for the seven parameter sne ft are shown n Fg. 3 whle the results for the spectral snc ft are presented n Fg. 4. These algorthms are not based and so the results that are shown correspond only to the standard devatons. Note that, the evolutons of the standard devatons are qute smlar for these algorthms. Comparng wth the ellpse ft algorthm, the evoluton pattern s the same, but the standard devaton of the phase error s hgher for the ellpse ft. 3.. mpltude analyss In ths secton, the ampltude analyss of the three algorthms s presented. The sgnal to nose ratos are set to 60 d and the ampltudes are swept from 0. V up to V wth 0. V resoluton. For these stuatons, the phase dfference error standard devaton s ndependent on the sgnal ampltudes (.e., for ths analyss, t s constant and the values are presented n Table for dfferent SNR values). For these SNR values, the ellpse ft s not based as shown n Fg. and Fg.. The results n Fg. 5 represent the ampltude rato error relatve standard devaton. It can be seen that the lowest values are obtaned for hgher value of D. Ths s caused by the fact that the ampltude of the frst channel s the denomnator of the ampltude rato and D s the numerator. Fg. 4. Standard devaton of the ampltude rato () and phase dfference error () for the spectral snc ft algorthm as a functon of the two sgnal to nose ratos for D= V and D=0.5 V. 48
D [V] verage ϕ Error [ ] D/D Error Relatve Standard Devaton D/D Error Relatve Standard Devaton D [V] SNR=30 d SNR=45 d SNR=60 d D/D Error Relatve Standard Devaton C Fg. 6. verage phase dfference error () and standard devaton () for the ellpse ft algorthm as a functon of the phase dfference and common SNR for D= V and D=0.5 V. D [V] verage ϕ Error [ ] Fg. 5. Relatve standard devaton of the ampltude rato for the ellpse ft (), seven parameter sne ft () and spectral snc ft (C) as a functon of the two sgnal ampltudes for SNR=SNR=60 d. 3.3. Phase analyss Regardng the phase analyss, the tests that were performed used D= V, D=0.5 V and three dfferent values of the common SNR. The mposed phase dfference was swept from -80º up to 80º wth resoluton 0.005º. s expected, the seven parameter sne ft and the spectral snc ft algorthms are ndependent on the phase dfference (results presented n Table ). The ellpse ft algorthm s qute dfferent. Due to ellpse degeneraton, the algorthm has problems for phase dfferences near 0º and 80º (as shown n Fg. 6 and wth more detal n Fg. 7). The range of affected phase dfference values depends on the SNR values. Remarkably, n spte of the ellpse degeneraton, the algorthm s capable of estmatng the ampltude rato wthout bas and wth the same standard devaton for all phase dfference values. SNR=30 d SNR=45 d SNR=60 d SNR=30 d SNR=45 d SNR=60 d Fg. 7. Detaled vew of Fg. 6 near ϕ=0º. 483
The results presented n Table, correspond to the values obtaned wth the three dfferent algorthms for dfferent values of sgnal to nose ratos obtaned for the phase dfference of 90º (to avod problems wth the ellpse ft algorthm), D= V and D=0.5 V. lso ncluded n Table for comparson are the CramérRao bounds determned usng the equatons derved n [4]. For the relatve ampltude rato, the standard devaton that corresponds to the bound s σ D / D D / D = SNR + SNR N SNR SNR 4. CONCLUSIONS The performance of three algorthms for two-channel snewave parameter estmaton was analyzed. The ellpse ft method s based for low SNRs and has a slghtly lower precson n the phase dfference estmaton. The ampltude analyss shows that the three algorthms perform almost dentcally. The seven parameter sne ft and spectral snc ft algorthms are phase ndependent, whle the ellpse ft algorthm suffers from the ellpse degeneraton phenomena. Despte ths, the ellpse ft estmates the ampltude rato wthout bas and wth smlar precson as the other algorthms for SNR>40 d. For equal sgnal to nose ratos, the standard devatons of the estmated parameters are dentcal to the CR for the seven parameter sne ft and spectral snc ft. (6) whle the standard devaton that corresponds to the bound of the phase dfference s σ ϕ [ ] = 80 π SNR + SNR N SNR SNR (7) CKNOWLEDGMENTS where SNR = Ths work was sponsored by the Fundação para a Cênca e Tecnologa. D σ (8) REFERENCES and σ s the varance of the zero-mean Gaussan whte nose of channel. Note that the results from the seven parameter sne ft are dentcal to the ones obtaned wth the spectral snc ft and also dentcal to the Cramér-Rao bound. The results of the ellpse ft are slghtly worse. [] IEEE Standard for Dgtzng Waveform Records, Dec. 994. IEEE Std. 057-994. [] Pedro M. Ramos, M. Fonseca da Slva,. Cruz Serra, Low frequency mpedance measurement usng sne-fttng, Measurement, vol. 35, n.º, pp. 89-96, Jan. 004. [3] P. Händel,. Høst-Madsen, Estmaton of velocty and sze of partcles from two channel laser anemometry measurements, Measurement, vol., n.º 3, pp. 3-3, July 997. [4] P. Händel, Parameter estmaton employng a dual-channel sne-wave model under a Gaussan assumpton, IEEE Trans. Instr. Meas., vol. 57, n.º 8, pp. 66-669, ug. 008. [5]. Ftzgbbon, M. Plu and R. Fscher, Drect least squares fttng of ellpses, 3th Intern. Conf. on Pattern Recognton, pp. 53-57, Venna, ustra, Sept. 996. [6] R. Halíř and J. Flusser, Numercally stable drect least squares fttng of ellpses Proc. WSCG 98, pp 5-3, Unversty of West ohema, Czech Republc, Feb. 998. [7] P. M. Ramos, F. M. Janero, M. Tlemçan,. C. Serra, Recent developments on mpedance measurements wth DSP based ellpse fttng algorthms, IEEE Trans. Instr. Meas., vol. 58, n.º 5, pp. 680-689, May 009. [8] Pedro M. Ramos,. Cruz Serra, new sne-fttng algorthm for accurate ampltude and phase measurements n two channel acquston systems, Measurement, vol. 4, n.º, pp. 35-43, Feb. 008. [9] Tomáš Radl, Pedro M. Ramos,. Cruz Serra, New spectrum leakage correcton algorthm for frequency estmaton of power system sgnals, IEEE Trans. Instr. Meas., vol. 58, n.º 5, pp. 670-679, May 009. [0] H. Renders, J. Schoukens, G. Vlan, Hgh-accuracy spectrum analyss of sampled dscrete frequency sgnals by analytcal leakage compensaton, IEEE Trans. Instr. Meas., vol. 33, n.º 4, pp. 87 9, Dec 984. Table. Comparson of the algorthms for ϕ=90º. SNR=SNR 30 d 45 d 60 d D/D relatve standard devaton.5 0-3.6 0-4 4.6 0-5 Phase dfference standard devaton [ ] 8.3 0-.5 0-.6 0-3 D/D relatve standard devaton 3. 0-5 Phase dfference standard devaton [ ] 5.8 0-.0 0-.8 0-3 D/D relatve standard devaton 3. 0-5 Phase dfference standard devaton [ ] 5.9 0-.0 0-.8 0-3 D/D relatve standard devaton 3. 0-5 Phase dfference standard devaton [ ] 5.8 0-.0 0-.8 0-3 Ellpse ft Seven parameter sne ft Spectral snc ft CramérRao bound 484