IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 52, NO. 4, AUGUST 2003 1021 Fully Automated Spectral Analysis of Periodic Signals J. Schoukens, Y. Rolain, G. Simon, and R. Pintelon Abstract—In this paper, we propose a method that allows to make a fully automated spectral analysis of a periodic signal, including a noise analysis, without any user interaction. The only action required from the user is to provide a data record that contains more than two periods of the signal (no integer number of periods is required). No synchronization between the generator and the data acquisition is needed, and different sampling rates are allowed (no integer number of samples/period is required). II. PROBLEM FORMULATION Consider a periodic signal (1) sampled at the time instances Index Terms—Frequency response function measurement, noise analysis, spectral analysis. I. INTRODUCTION P ERIODIC signals play a key role in many measurement applications. For many problems, for example, frequency response function measurements [1], [2], periodic signals result in a reduced measurement time and an increased accuracy. Also, in system identification applications, [1], [3] offer periodic signals significant advantages. However, a number of additional conditions (compared to random excitations) should be met in order to access these advantages. The generator and the data acquisition should be synchronized; an integer number of periods should be measured, preferably with an integer number of data points per period; the data should be analyzed period per period. For less experienced users, it is not always obvious to have a good synchronization, and even more important, the segmented processing of the data requires (highly) skilled users. This makes the advantages of periodic signals often inaccessible for many potential users. The aim of this paper is to remove these experimental and educational constraints. A method is presented that allows to make a full spectral analysis, including a noise characterization, of periodic signals without any user interaction. This method is fast, such that it can also be applied to long data records (for example, with more than 50 000 data points). The computing time is independent of the number of estimated frequencies and depends only on the length of the data record. (2) (the restriction to 80% of the with Nyquist frequency is to allow upsampling and interpolation later is the Fourier coefficient of the th compoon). is the nent (where denotes the complex conjugate), is the sample period of the data acperiod of the signal, and quisition unit. is not restricted to those values that allow a Note that synchronization between the generator and the acquisition, so is not necessarily a rational number. equidistant measurements of this signal are made over more than two periods (3) , and where models the measurement with noise, all transients are assumed to be disappeared. of the Fourier The aim of the paper is to obtain estimates , together with an estimate of the variance coefficients (4) of the estimates. III. SOLUTION Define with , and consider the signal model (5) Manuscript received June 15, 2002; revised December 9, 2002. This work was supported in part by the FWO-Vlaanderen, in part by the Flemish community (concerted action IMMI, bilateral agreement 99/18), and in part by the Belgian government (IUAP-5/22). J. Schoukens, Y. Rolain, and R. Pintelon are with the Vrije Universiteit Brussel (VUB), Electrical Measurement Department (ELEC), Brussels, Belgium (e-mail: johan.schoukens@vub.ac.be). G. Simon is with the Budapest University of Technology and Economics, Department MIS, Budapest, Hungary. Digital Object Identifier 10.1109/TIM.2003.814817 the number of estiwith the period to be estimated, and is assumed mated Fourier coefficients, the dc coefficient to be zero. Eventually, the dc can be readed from the final fast Fourier transform (FFT) results. The solution consists of two parts. In a first step, an initial is made using correlation estimate of the period length methods. In a second step, this initial estimate is improved by (that will be defined below), minimizing a cost function and eventually the corresponding Fourier coefficients are calcu- 0018-9456/03$17.00 © 2003 IEEE 1022 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 52, NO. 4, AUGUST 2003 lated using an FFT. Since this problem is nonlinear in , a numerical search procedure is developed. Both steps are discussed in more detail below. A. Initial Estimate of the Period Length The initial estimate of the period length is based on the autoof . The basic idea is to detect the distance correlation . If a wide band signal with a between successive peaks in flat amplitude spectrum is analyzed, this simple method gives a good estimate. However, it fails in practice for a number of special cases. Since the method should be robust, it is refined to deal also with these signals. is a Beat Signal (a Narrow Band Signal): This re1) , and instead sults in an strongly oscillating nature of of estimating the correct period, the period of this oscillation is detected. This problem is solved by normalizing and smoothing . In the normalizing step, all values above a critical level ] are put equal [set as a fraction of the maximum of to 1 and the remaining values are set equal to zero. Next, the normalized autocorrelation sequence is smoothed with a filter , having a Gaussian impuls respons ( ). This procedure is repeated, with decreasing the critical level in each iteration, till at least three peaks are detected. Next, the median distance between these peaks is used as an initial period length estimate. is a Beat Signal With a Strongly Odd Behavior: Due 2) , a parasitic peak at to the odd behavior, half the period length pops up for beat signals. The presence of these peaks is detected by checking if . If this is the case, the period estimator is also . If the resulting estimate is close to the preapplied to vious one, the initial estimated period length is doubled. In case this decision was wrong, it is not a disaster, because it only leads to an estimated period that is two times too large. This is still a period of the signal. The only disadvantage is that the minimum length of the record should be twice as long in order to meet the requirement that the measurement time is at least two times the estimated period length. B. Improved Estimate of the Period Length The improved period will be obtained by minimizing a cost , which is defined below step by step. function • Assume that the period of the signal is (to be estimated). From the initial estimate, we know that the measurements periods of the signal. cover more than • In the next step, we interpolate the samples with an samples per period, such that equidistant grid with points in the processed record (FFT we get transform calculations). The number of data points is also . The chosen high enough to avoid aliasing interpolated signal (6) . It is calculated starting from is an estimate of using classical upsampling [4] and the measurements interpolation techniques [5]. The upsampling factor used is 6, a FIR filter of 48 6 taps is used internally (de- signed with the Remez exchange procedure, pass band until , stopband from ). A cubic interpolation is made on the upsampled data. Using these choices, the systematic errors are 100 dB below the signal level up to . This idea is very similar to the method that is presented in [6], where an upsampling/downsampling procedure is proposed to resample the data. The disadvantage of that approach is that only a restricted set of upsampling/downsampling fractions can be realized. In order to get a sufficient good approximation, a very high upsampling rate should be selected (e.g., a factor 1000). In the method proposed in this paper, not such a restriction is present. In combination with the iterative procedure that is explained below, a much better accuracy is obtained (errors 100 dB below the signal level compared to the 40–50 dB reported in [6]). • Calculate the DFT spectrum (using the FFT) (7) Note that the choice of allows a fast calculation of the DFT using the FFT. • Define the cost function (8) This can be interpreted as the ratio of the power on the nonexcited frequency lines to that on the excited lines. • Define the estimate as (9) Remarks: The minimization problem in (9) is nonlinear in . A nonlinear line search is used, that is initialized from . Since the cost function has many local minima, the search is split in a coarse search, scanning the cost function around the initial guess, followed by a fine search (based on parabolic interpolation) to get eventually the final estimate. C. Estimation of the Fourier Coefficients and Their Variance Once an estimate is available, the full record is resampled sub records. For according to this period length and split in each subrecord, the DFT spectrum is calculated. The final estimates of the Fourier coefficients and their variance are then obtained as the sample mean and sample variance of the spectra of these subrecords. IV. COMPARISON WITH EXISTING METHODS In [7], a maximum likelihood procedure is proposed to estimate the signal parameters in (5), for the case of white normally distributed disturbing noise . This is done by minimizing the cost function (10) SCHOUKENS et al.: FULLY AUTOMATED SPECTRAL ANALYSIS OF PERIODIC SIGNALS 1023 TABLE I COMPARISON OF THE COMPUTING TIME Fig. 1. Comparison of the nonsynchronized processing and the synchronized (+ + processing : the measured FRF (. . .), the complex error +) and the standard deviation on the FRF obtained with both methods (the gray line and dots). G 0G with respect to . This method will be used as a reference. Since it is a maximum likelihood method (MLE), it gives optimal statistical properties for the estimates, and it will allow to measure the efficiency of the newly proposed automatic procedure. It turned out that the MLE has a smaller uncertainty; the standard deviations (on the frequency and the Fourier coefficients) of the automated procedure are 25% to 80% larger than those obtained with the MLE procedure. We will also compare the computing time of both methods. For the MLE, we restricted the unknown Fourier coefficients to those that appeared in (1). In other words, we assumed for this method that we knew which harmonics were present in the signal. For the automatic procedure, we estimated all Fourier coefficients, including those that are zero in (1). This is done because we do not want to ask for prior knowledge to inexperienced users. The results are given in Table I. In this table, and are the number of estimated frequencies in the MLE method and the automatic procedure, respectively. From this table, it is seen that for a small number of unknown components and short data records, the MLE procedure is much faster, although the automatic procedure gives also the results in a very reasonable time. For a larger number of components, the automatic procedure outperforms completely the MLE procedure. Even very large data records can still be processed with the method. It is also interesting to note that the memory requirements grow proportional with (the number of estimated frequency components) only for the automatic procedure, while it grows for the MLE procedure. with V. ILLUSTRATIONS ON EXPERIMENTS In this Ssection, the method is illustrated with two experimental results. In the first experiment, data with an extremely good SNR (signal-to-noise ratio) were used (around 70 to 90 dB before averaging). In the second experiment, the SNR was about 30 to 50 dB before averaging. Both experiments are discussed below. In these experiments, we measured the frequency response function of the transfer function (FRF) of two test systems. To do so, we first extracted the period from the input signal, and next the output signal is analyzed using this estimated period. In order to get a reference measurement, we synchronized the generator and the data acquisition. The data are processed twice. The first time the new method is used (making no use of the synchronization), the second time the data are classically processed, using explicitly the fact that the data were synchronized. In each experiment, we compare the measured FRF and the estimated standard deviations to those obtained with the reference measurements. A. Experiment 1: A Low Noise Experiment data points were available. In this experiment, More than nine periods were covered by these data. The results of the analysis are shown in Fig. 1. The system was excited up . From these results, it can be seen that both to 0.36 dB, which FRF’s coincide very well. The error is below was the error level that we designed for in the interpolation step. The standard deviations obtained with both methods is very well in agreement. Moreover, it can be observed that the error is well below the standard deviation of the noise; hence, the stochastic errors dominate the results, or in other words, the additional errors introduced by the nonsynchronized processing are negligible, even if nine periods are averaged (pushing down the noise levels with about 10 dB). B. Experiment 2: A High Noise Experiment In this case, measurements were made on a system that creates a lot of output noise. 7800 data points were available, covering about seven periods of 1024 points each. The results are shown in Fig. 2. As can be seen, there is again a perfect agreement between both results. The systematic errors are just as in the first example below the stochastic errors (here after averaging over seven periods). C. Discussion In Section IV, we observed an increase of the uncertainty of the estimated Fourier coefficients compared to the maximum likelihood estimator. It is interesting to note that the uncertainty 1024 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 52, NO. 4, AUGUST 2003 The price to be paid for all these advantages is a loss of a factor two in uncertainty on a single signal spectrum, while for FRF measurements, no increase of the uncertainty could be observed. REFERENCES Fig. 2. Comparison of the nonsynchronized processing and the synchronized (+ + processing, the measured FRF (. . .), the complex error +) and the standard deviation on the FRF obtained with both methods (the gray line and dots). G 0G on the FRF obtained with the new method is the same as the uncertainty if the period is exactly known. Hence, no significant loss appears if the period length has to be estimated. The reason for this behavior is twofold. ), next to the actual spectral 1) On the FFT line (e.g., ), the dominating error is a phase shift. line (e.g., But this appears identical for the input and the output record, so that it disappears in the division of the FRF calculation. and 2) The errors on the other lines (e.g., ) are minimized during the estimation process, so that the errors on the modeled spectrum decrease to zero in . As such, it is no surprise to observe that the FRF errors are well below the noise level. [1] R. Pintelon and J. Schoukens, Identification of Linear Systems. A Frequency Domain Approach. Picataway, NJ: IEEE Press, 2001. [2] J. Schoukens, P. Guillaume, and R. Pintelon, “Design of broadband excitation signals,” in Perturbation Signals for System Identification, K. Godfrey, Ed. Englewood Cliffs, NJ: Prentice-Hall, 1993, ch. 3. [3] L. Ljung, System Identification: Theory for the User, 2nd ed. Upper Saddle River, NJ: Prentice-Hall, 1999. [4] R. E. Crochiere and L. R. Rabiner, Multirate Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1983. [5] Y. Rolain, J. Schoukens, and G. Vandersteen, “Signal reconstruction for nonequidistant finite length sample sets: A ‘KIS’ approach,” IEEE Trans. Instrum. Meas., vol. 47, pp. 1046–1052, Oct. 1998. [6] R. M. Hidalgo, J. G. Fernandez, P. R. Rivera, and H. A. Larrondo, “A simple adjustable window algorithm to improve FFT measurements,” IEEE Trans. Instrum. Meas., vol. 51, pp. 31–36, Feb. 2002. [7] R. Pintelon and J. Schoukens, “An improved sine-wave fitting procedure for characterizing data acquisition channels,” IEEE Trans. Instrum. Meas., vol. 45, pp. 588–593, Apr. 1996. J. Schoukens received the degree of engineer and the Ph.D. in applied sciences from the Vrije Universiteit Brussel (VUB), Brussels, Belgium, in 1980 and 1985, respectively. He is presently a Professor at the VUB. The prime factors of his research are in the fields of system identification for linear and nonlinear systems. Y. Rolain is with the Electrical Measurement Department (ELEC), Vrije Universiteit Brussel (VUB), Brussels, Belgium. His main research interests are nonlinear microwave measurement techniques, applied digital signal processing, parameter estimation/system identification, and biological agriculture. VI. CONCLUSION In this paper, a fully automated method is proposed to analyze a periodic signal. The method is designed to reduce the required user knowledge as much as possible in order to make the advantages of periodic signals accessible to a wide public, as follows. • No synchronization between the generator and the acquisition is required. • The user should not select in advance the excited harmonics. • The spectrum and its uncertainty are obtained. This allows an automatic selection of the relevant frequencies. The only prior request on the user is that more than two periods should be measured. The proposed method is also fast on large data records, and it requires less memory than the classical least squares based methods. G. Simon received the M.Sc. and Ph.D. degrees in electrical engineering from the Budapest University of Technology, Budapest, Hungary, in 1991 and 1998, respectively. Since 1991, he has been with the Department of Measurement and Information Systems, Budapest University of Technology and Economics, Budapest, most recently as a Senior Lecturer. His research interests include digital signal processing, adaptive systems, and system identification. R. Pintelon received the degree of engineer and the Ph.D. degree in applied sciences from the Vrije Universiteit Brussel (VUB), Brussels, Belgium, in 1982 and 1988, respectively. He is presently a professor at the VUB in the Electrical Measurement Department (ELEC). His main research interests are in the field of parameter estimation/system identification and signal processing.