A new sine-fitting algorithm for accurate amplitude and phase measurements in two channel acquisition systems Pedro M. Ramos * , Anto ´ nio Cruz Serra Instituto de Telecomunicac ¸o ˜es, Department of Electrical and Computer Engineering, Instituto Superior Te ´cnico, Technical University of Lisbon, IST, Av. Rovisco Pais 1, 1049-001 Lisbon, Portugal Received 19 December 2005; received in revised form 18 February 2006; accepted 20 March 2006 Available online 25 April 2006 Abstract Sine-fitting algorithms are very accurate methods to estimate the parameters (amplitude, phase, frequency and DC com- ponent) of a digitized sinusoidal signal. In this paper, the standardized algorithms are improved, producing a new algo- rithm to estimate the sinewave parameters of two acquired sine signals sharing a common frequency. This new algorithm can be used for example in impedance measurements or in the accurate frequency characterization of linear sys- tems by measuring its input and output and varying the input signal frequency. Ó 2006 Elsevier Ltd. All rights reserved. Keywords: Sine-fitting algorithms; Amplitude and phase measurement; Digital signal processing algorithms 1. Introduction The frequency response of a linear invariant sys- tem can be determined by sweeping the input fre- quency of a sine signal while measuring the input/ output amplitude ratio and phase difference. In [1,2], two basic least-squares methods, appropriately named sine-fitting algorithms are presented. The three-parameter algorithm estimates the amplitude, phase and DC component of a known frequency sinusoidal voltage sampled at a known sampling rate and digitized with a analog-to-digital converter (ADC). In fact, only the normalized frequency (ratio between the sine and sampling frequencies) must be known. The algorithm is non-iterative and requires only the construction of a M · 3 matrix (M is the number of acquired points) and the deter- mination of its pseudo-inverse matrix and multipli- cation with the actual samples. However, in most applications, either the sine frequency is not known with enough accuracy (either because the signal source is not controlled or because of the lack of frequency accuracy of the function generator) or the sampling frequency value is not as accurate as would be expected (inac- curate sampling clock of the ADC). In these situa- tions, the frequency must also be estimated. Unlike the three-parameter algorithm, in this case the fitting model is not linear regarding one of the parameters to be estimated (the frequency). To line- arize the model, a Taylor series expansion is used which requires multiple iterations to converge to 0263-2241/$ - see front matter Ó 2006 Elsevier Ltd. All rights reserved. doi:10.1016/j.measurement.2006.03.011 * Corresponding author. Tel.: +351 218418485; fax: +351 218418472. E-mail address: pedro.ramos@lx.it.pt (P.M. Ramos). Available online at www.sciencedirect.com Measurement 41 (2008) 135–143 www.elsevier.com/locate/measurement