Issues Related to the Stability Analysis of a Nonstationary Sinusoid Tracking Algorithm Honors Undergraduate Thesis Proposal Clarkson University K. Anderson Advisor: A. K. Ziarani March 2005 1 Objective Some issues related to the stability analysis of a method of extraction of nonstationary sinusoids developed by A. K. Ziarani will be addressed. In particular, the parameters that govern the accuracy and time to convergence of the algorithm on the sinusoid’s amplitude, frequency and phase will be numerically characterized. Presentation of this characterization as a set of guidelines will enable the selection of optimum parameter values under different circumstances. A correlation between the numerical analysis of governing parameters and the eigenvalues of the linearized system will also be sought. 2 Motivation 2.1 Adaptive Signal Processing The tracking algorithm under investigation is a form of adaptive signal processing, or an adaptive notch filter. A filter is a system that allows some frequency components of a signal to pass through unchanged but attenuates components of other frequencies. A notch filter in particular either selects or rejects a specific frequency component of a signal. Traditionally, the discrete Fourier transform has been used to represent and isolate the frequency components of signals, but this method is often impractical when the frequencies of the signal are changing in time [1]. Instead, adaptive filtering and signal processing techniques have been developed to more adequately handle nonstationary signals (signals with time-varying frequencies). Adaptive signal processing is used in many applications, including the estimation of time varying biomedical signals and the filtering of variable noise from the biomedical signals [2]. It is also used to manage noise disturbances in power [3] and control systems [4]. The audible sound emitted from vibrating equipment can also be mitigated through the use of adaptive filtering [5]. In general, adaptive signal processing is well-suited to the estimation of signal frequency. The algorithm developed by A. K. Ziarani can extract a single sinusoid from a nonstationary input signal comprised of multiple components. Although not all signals are sinusoidal, a periodic signal can be represented with its Fourier Series as a sum of sinusoids. The algorithm’s dynamic is governed by a set of three nonlinear differential equations, and the amplitude, frequency and phase of the extracted sinusoid are estimated in real time and easily accessed. The algorithm can be duplicated and run in parallel or cascaded to extract multiple sinusoidal components from an input signal [1]. 2.2 Advantages of Algorithm over Leading Methods Leading methods of adaptive filtering in addition to the algorithm under discussion include those developed by Regalia and Kalman [1]. The extended Kalman filter estimates the parameters of a linearized model of the process being considered. Two random processes are included in the state equation and output equation that model the noisiness of the input signal. The two random processes are often represented by covariance matrices. The accuracy of the parameter estimation depends largely on modeling the noise correctly, which includes choosing adequate values in the covariance matrices. The selection of initial conditions of the state variables amplitude, phase and frequency also influences the accuracy significantly. In contrast, Ziarani’s algorithm can track sinusoidal components by merely specifying an input model and not assuming a noise model. His algorithm is also less sensitive to noise and the selection of internal parameters and initial conditions [1]. The method of Regalia as adjusted by Hsu et al. for greater noise immunity is a set of second-order nonlinear equations. These equations were developed on different principles than were Ziarani’s equations, and thus the two systems exhibit different properties. Despite the modifications made to Regalia’s method to provide greater noise immunity, Ziarani’s method exhibits greater immunity still. Ziarani’s algorithm also estimates the amplitude and phase of the extracted sinusoid where Regalia’s does not. Finally, Ziarani’s algorithm is less dependent on the setting of internal parameters than Regalia’s. Thus Ziarani’s method has advantages over both the Kalman filter and Regalia’s method [1]. 2.3 Importance of Parameter Study There remains, however, a hindrance to easy application of Ziarani’s algorithm. The accuracy of the estimated parameters and the time the algorithm takes to converge on the estimations are governed largely by three internal parameters, known as μ1, μ2 and μ3. Optimum parameter values have been selected for the pursuit of sinusoids around 60Hz, but to use the algorithm in other situations, the values must again be optimized. Currently, the parameters are chosen intuitively by persons familiar with the algorithm, or by scaling the input signal such that the heuristically found parameters (in the case of 50/60 Hz operation) may be used. In the development of the algorithm, Ziarani mathematically proved “the existence, uniqueness and stability of a periodic orbit of the dynamical system governing the proposed algorithm.” This included the derivation of implicit expressions for the eigenvalues of the linearized system, which give some indication of the parameters’ contributions to the stability of the system. While extensive mathematical manipulations might yield an expanded understanding of the parameters’ control of the algorithm, numerical investigation is a much more practical approach to characterizing the parameters. The resulting information could be organized as a set of guidelines and graphs that guide users of the algorithm in choosing the parameters that are best for their application. 2.4 Applications of this Algorithm One of the application areas of this method of signal extraction is testing the hearing functionality in infants. Current methods include sending a signal into the human ear and measuring either the return signal from the ear or the electric potential across the patient’s scalp (EEG) using the average results of the DFT repeated in time. The averaging DFT method requires several minutes of silence and immobility from the infant under examination, but using Ziarani’s algorithm has thus far cut the measurement time in half. The algorithm is also more forgiving of environmental noise than the averaging DFT [6]. The algorithm is also being used in sensorless measurement of the speed of AC machines. The stator current contains harmonics that can be related to the speed of the machine, and the sinusoid tracking algorithm is being used to estimate these harmonics. The advantage of this algorithm over other methods is that the harmonics can be estimated in time, whereas other methods only yield the frequencies of the harmonics and not the time at which the frequencies appeared. Other applications of the algorithm include time-frequency analysis of blood flow measurement signals, and the elimination of narrow-band interference in real time, such as the interference in telephone loops. The understanding of algorithm parameters and creation of a set of guidelines will allow this algorithm to be used by others in more diverse applications with less overhead associated with the algorithm itself. 3 Method 3.1 The Algorithm Suppose u(t) is a signal that is usually continuous and almost periodic (frequency is somewhat changing with time), and yt At sin t is a component of interest. Then u(t) is the input to the algorithm and y(t) is the output. A is the amplitude of the output, and is the total phase. The total phase can also be broken down into frequency and constant phase parts as follows. Note that any two of the variables are sufficient to describe the third. t t d t The differential equations governing the behavior of the algorithm that extracts y(t) from u(t) are as follows: A t 21et sin t t 22 et At cos t t t 3 t μ1, μ2 and μ3 are parameters that control the convergence and accuracy of the algorithm. It is known that μ1 contributes most significantly to the stability (convergence and accuracy) of the amplitude, μ2 to the frequency, and μ3 to the total phase / constant phase. The equations are highly coupled, however, indicating that the parameters have a more complicated influence on the system’s stability [1]. These equations can also be represented by a block diagram (Figure 1), which can be modeled using Simulink (a MATLAB component). Adjustments can easily be made within the Simulink environment to alter the input signal, noise level, initial conditions, and gains (including the μ parameters). Simulink can simulate the system on command and display the time signals of interest (i.e. input, amplitude, frequency, etc). The numerical analysis of this thesis project will primarily be accomplished through the use of MATLAB and Simulink. Figure 2: Simulink Block Diagram of Algorithm 3.2 Project Details The considerations for this analysis are organized in Table 1. Convergence and accuracy are the means of assessing the effect of the μ parameters on the system. They are a direct result of the parameter values. However, the characteristic convergence and accuracy for a range of parameter values may change depending on other conditions, which are shown on the left in order of concern. The ranking of these conditions are based on the knowledge of current algorithm users of the most influential and pressing conditions. Table 1: Organization of Analysis Aspects Conditions fo Rate of (Δf / f * 100%) fo ± Δf Ao ± ΔA SNR (signal to noise ratio) Parameters μ1 μ2 μ3 Outcomes Convergence Speed Accuracy First, the approximate frequency (fo) of the signal to be tracked is known to affect the way the parameters control the system, primarily in the convergence and accuracy of the frequency estimation. This is an important relationship to understand because it would facilitate the use of the algorithm for applications other than 60Hz. The amount of variation in frequency (fo ± Δf) and the rate of variation (Rate of (Δf / f * 100%)) also seem to influence the convergence and accuracy. Likewise, variation in amplitude (Ao ± ΔA) will also be investigated. It is well established by current users of the algorithm that if the input signal to noise ratio (SNR) decreases (the signal becomes noisier), then the performance of the algorithm worsens. Though this general trend is known, systematic analysis may be performed to reveal how the μ parameters might be adjusted to maintain the same accuracy and convergence for two simulations with different SNR’s. Finally, others have observed that a phase other than zero sometimes causes the algorithm to have a glitch in tracking the phase. It will converge to the proper phase but within a cycle, briefly lose the lock on the phase. In actual applications, the phase cannot be specified so this is more a point a curiosity than application. This list of conditions is tentatively prioritized. The order of investigation may be rearranged as the analysis progresses and needs are reassessed. Some of the conditions listed may not be investigated at all due to time constraints or changing priorities, and it is possible that other considerations may come to light. 3.2.1 Data Representation A significant challenge of this project will be to represent the simulation data meaningfully. There are three controlling parameters of the algorithm, two measurable outcomes for each of amplitude, frequency and phase, and many conditions under which the algorithm can be run. How can so many aspects be represented on one plot? Or how can the data be represented efficiently, using few plots but still conveying meaning? Taking the first condition, frequency, perhaps convergence could be plotted against frequency as a family of μ2 curves. Or, convergence verses a μ parameter with a family of frequency curves. Representation of the data will change as needed throughout the project as the need arises. Ultimately, the findings of this study will be organized as a set of guidelines and graphs that will enable a user of the algorithm to choose the optimum parameter values for their situation. These final graphs will most likely be a composite of the most useful graphs generated during the characterization process. 3.2.2 Eigenvalues Investigating the μ parameters numerically is a more practical approach to understanding the stability of the system than a strictly mathematical analysis. However, perhaps the two methods could be done in concert. Numerical analysis may suggest a relationship between the parameters and frequency for example, that could be confirmed by the eigenvalues of the system. Similarly, examination of the eigenvalues may suggest a relationship that can be tested numerically. The implicit eigenvalues appear in [1]. 4. Timeline Numerical Investigation of Parameters Organize Results into Guidelines Relate to Eigenvalues (as time permits) Write Thesis Paper Spring 2005 Fall 2005 Spring – Fall 2005 Fall 2005 – Spring 2006 5. Summary Understanding the parameters that govern the algorithm developed by A. K. Ziarani will make the algorithm much easier to use under a variety of circumstances. A set of guidelines would also allow people who are unfamiliar with the algorithm to choose the best parameters for their application. This thesis project entails numerical characterization of the parameters, organization of this information into a set of guidelines, and correlation between numerical and mathematical analysis of the system. Works Cited [1] A.K. Ziarani and A. Konrad, “A method of extraction of nonstationary sinusoids,” Signal Processing, Vol. 84, No. 8, 2004, pp. 1323-1346. [2] M. Ferdjallah and R.E. Barr, “Adaptive digital notch filter design on the unit circle for the removal of powerline noise from biomedical signals,” IEEE Transactions on Biomedical Engineering, Vol. 41, Issue 6, June 1994, pp. 529-536. [3] J.Z. Yang and C.W. Liu, “A precise calculation of power system frequency and phasor,” IEEE Transactions on Power Delivery, Vol. 15, Issue 2, April 2000, pp. 494-499. [4] C.R. Fuller and A.H. von Flotow, “Active control of sound and vibration,” IEEE Control Systems Magazine, Vol. 15, Issue 6, December 1995, pp. 9-19. [5] L.J. Eriksson, “Active sound and vibration control using adaptive signal processing,” Acoustics, Speech and Signal Processing, Vol. 1, April 1993, pp. 51-54. [6] M.J. Fitzpatrick, “Real-Time Implementation of a Hearing Testing Technique,” Master's Thesis, Clarkson University, Potsdam, NY, November, 2004.