Kalman Filters for Parameter Estimation of Nonstationary Signals

An adaptive Taylor-Kalman filter with PSO tuning for tracking nonstationary signal parameters in a noisy environment with primary focus on time-varying power signals has been presented in this piece of work. In order to deal with the dynamic envelope of the power signal, second-order Taylor expansion has been used such that the Taylor coefficients are updated with the PSO-tuned Taylor-Kalman Filter algorithm. In addition to this, for fast convergence, a self-adaptive particle swarm optimization technique has been used for obtaining the optimal values of model and measurement error covariances of the Kalman filter. The proposed algorithm is linear and therefore has less computational burden, which is easier to be implemented on a hardware platform like DSP processor or FPGA. The proposed PSO-tuned Taylor-Kalman filter exhibits robust tracking capabilities even under changing signal dynamics, immune to critical noise conditions, harmonic contaminations, and also reveals excellent convergence properties.


Introduction
Signal parameter estimation, which dates back to the late 19th century, describes the various methods employed to track amplitude, phase, and frequency-like parameters of a signal. Among all the signal parameters, frequency is the primary concern, as it is a nonlinear function in the received data sequence, and once that is measured accurately, tracking of other parameters like phase, amplitude, and damping factor of a signal can be relatively easier. Most real-world signals are nonstationary in nature, i.e., they have a time-varying frequency behavior. Some of the popular sources of nonstationary signals include speech, audio, sounds of mammals, machine vibrations, electrical power networks, and a variety of biomedical signals like electromyogram (EMG), electroencephalogram (EEG), phonocardiogram (PCG), and vibroarthrogram (VAG)).
These signals are rich in information and when analyzed properly provides with information that could be used to improve many aspects of our lives. Hence, the information of interest of the signal can be extracted, which includes the estimation of parameters like amplitude, phase, frequency, and damping factor directly from the discrete measurement in the presence of noise both in stationary and nonstationary environments. Precise and smooth operation of the power generation and distribution system is very much required in the present day scenario. With the increasing demand for power, the number and type of load are having deteriorating effects on the power quality. Power quality is defined as the ability of the electrical grid to deliver clean and stable power to the consumer. Between generation and supply, the power being delivered encounters large number of transformers and several lengths of overhead lines and underground cables. Phenomena like lightning strikes, system faults, load switching, and other such intentional or unintentional events are the main cause of electromagnetic disturbances, which results in voltage or current waveform distortions to propagate in the entire power system. Recently, the increase in the number of power electronic loads in the system causes nonlinear loading effect on the power system signal, leading to degradation of power quality.
Recently, harmonic estimation has become a challenging and critical issue for electrical engineers. Estimating harmonics and other faults is important for maintaining power quality. Research works carried out recently sheds light on various techniques for estimating harmonics. FFT [1]-based techniques are the conventional ones, and they suffer from some pitfalls such as aliasing and picket fence effects, which lead to inaccurate estimation results. There are some other methods suffering from these three problems, and this is because of existing high frequency components measured in the signal; however, truncation of the sequence of sampled data, when only a fraction of the sequence of a cycle exists in the analyzed waveform, can boost leakage problem of the DFT method. So, the need of new algorithms that process the data, sample-by-sample and not in a window as in FFT and DFT, is of paramount importance. Another very robust algorithm for the purpose of estimating sinusoidal signals with unknown noise content is the Kalman filter (KF) [2,3].
However, when cases related to system dynamics, like sudden changes in frequency, amplitude and phase of a signal, arise, KF exhibits serious drawbacks. Study of several literature shows that single methods employed for the purpose of signal estimation are not efficient on their own, so hybrid methods based on the combination of different need to be formulated. The major contribution of this chapter is the accurate tracking of nonstationary power signal parameters, i.e., phasor, frequency, and harmonics. The power signal is modeled using Taylor series, and the coefficients of the Taylor series are updated using the Kalman Filter [4,5], which are again utilized to estimate the time varying amplitude, phase, and frequency of the test signal. Moreover, a self-adaptive particle swarm optimization approach is deployed to choose the optimum values of the Kalman filter parameters like model and measurement error covariances, which in turn enables the filter to attain convergence in a faster rate.

Literature review
Work on harmonic and parameter estimation has been going since the introduction of AC power generation. Over the course of time, several methods have been proposed to fulfill this particular requirement, but so far, the existing methodologies have exhibited significant drawbacks. Here are some of the research works that have been performed in the last 5 years.
For the estimation of harmonics and interharmonics, a technique using simple techniques like least mean square [4] and a two-stage ADALINE network has been studied [5]. The method utilized here provided a better accuracy even when power frequency deviation and interharmonic components are present in the measured signal. As the conventional ADALINE is unable to detect interharmonics, a two-stage ADALINE is used. The architecture is classified in two parts-the front stage that extracts the frequency value and the back stage that computes amplitude and phase. Here, the adaptive algorithm used in the filter is the RLS algorithm. The method yielded more accurate results in protection and monitoring applications.
Sliding window tracking (SWT) [6] accurately tracks the frequency and amplitude of a signal by processing only three (or more) recent data points. It works for a signal with any nonzero moving average and noise. Teager-Kaiser algorithm (TKA) is a well-known four-point method for online tracking of frequency and amplitude. TKA takes into assumption that the signal is purely harmonic, so any moving average in the signal can totally destroy the accuracy of TKA, whereas SWT uses a pair of windowed regular harmonics to estimate the frequency and amplitude thus eliminating the effect of moving average. In order to start the online tracking of frequency, SWT requires TKA to provide the first estimate of the frequency. The accuracies of SWT and TKA are compared using Hilbert-Huang transform, which is used to extract accurate time-varying frequencies and amplitudes by processing the whole data set without assuming the signal to be harmonic. Tracking accuracy increases when window length is equal to or greater than one quarter of the signal period. If the chosen window length is too long, then the estimated frequency is an average over the window length. The method requires constant frequency and amplitude to accurately track the parameters, and this shows that the dynamic response of the method is very poor and the accuracy deteriorates, if there is no change in the parameter values.
A real-time approach for the estimation of power system frequency based on Newton-type algorithm and least squares method has been used in this paper [7]. The adopted optimization technique has been based on a two-stage mathematical model. A Newton type algorithm has been used to model the first stage for estimating the line to neutral voltage-phase angle and its variation. The second stage has been modeled using LS minimization technique that extracts the power system frequency by processing the information in the phase angles estimated using NTA. The method also studies the modulating effect of time-varying frequency on the online estimation of the phase angle.
Taylor series expansion and Fourier algorithm have been used for frequency estimation [8]. To model the changing envelope of a power signal within an observation, a second-order Taylor series has been used, and the parameters of the model have been estimated using Fourier algorithm. Comparing with the traditional Fourier algorithm, this method introduces more computational load.
A modified ADALINE structure has been used in the paper [9] for online tracking of harmonics. Self-synchronized ADALINE network for power system harmonics estimation relies on the Levenberg Gradient Descent method for updating the system parameters. A faster response and better noise immunity are provided by conventional methods. A high computational load is the only drawback that exists in the proposed approach.
Ensemble Kalman Filter has been used in the proposed method [10] for filtering and estimating signal harmonics and interharmonics. To avoid the problem of singularity and for the computational feasibility of state covariance P, the state covariance P is replaced by a sample covariance C for the computation of Kalman gain.
The proposed method [11] is adopted for real-time estimation of phasor and harmonics. The technique reduces the turnaround time on two different off-the-shelf research and development DSP platforms. The proposed method has been found to be superior to that of ADALINE and RDFT techniques under the presence of noise sub-harmonics and frequency variations. The proposed technique has a computational efficiency that is higher than that of ADALINE and RDFT techniques.
The proposed algorithm in [12] is simple, computational efficient and makes the correction of the signal that enables to reach the mean square error. It provides a new kind of step adaptation for LMS algorithm. Two LMS algorithms have been utilized by this method. The first one has a fixed-step size, and the weight coefficient generated from the first algorithm is used to update the step size of the second algorithm, which has initial step size of 0.001.
An adaptive linear network (ADALINE) [13][14][15] for harmonic and interharmonic estimation (Martin) allows the computing of root mean square voltage and total harmonic distortion indices. Classification and detection of sags, swells, outages, and harmonics-interharmonics have been done using the indices computed before. Classification of spikes, notching, flicker, and oscillatory transients has been achieved by using a feed forward neural network through pattern recognition using horizontal and vertical histograms of a specific voltage waveform. The method used in [16] uses noneven item interpolation FFT based on triangular selfconvolution window. Variances of frequency estimation are proportional to the energy of the adopted window. By choosing suitable values of length of FFT, sampling frequency, and the shape of the adopted window, the variances of frequency estimation have been determined.

PSO-tuned Taylor-Kalman filter
To improve the performance of Kalman Filter in this aspect, a hybrid adaptive filter has been proposed in this thesis work that consists of the combination of Taylor series, Kalman Filter, and self-adaptive PSO. Taylor series is used to model the changing envelope of the sinusoidal signal. The sinusoidal signal is expressed in its trigonometric components, which in turn are expanded by using Taylor series. The Taylor coefficients are stored in the state vector that is further used to estimate the signal and its amplitude, frequency, and phase. In each iteration, the state vector is updated in order to get a better estimate than the previous, and the process continues until convergence is reached. There are two parameters on which the performance of the KF depends-the model and measurement error covariances. In the traditional approach, the values for these parameters are chosen by trial and error that makes the algorithm time consuming and prone to errors. Self-adaptive PSO is used here to select the optimal values of the error covariances in order to achieve fast convergence.

Signal modeling using Taylor expansion
Let the discrete signal be represented as: where Ai ðÞ, ω i ðÞ, and ϕ i ðÞare "the amplitude", "angular frequency," and "phase" of the sinusoid, respectively. ω i ðÞ¼2πfi ðÞand fi ðÞis the fundamental frequency of the signal, while κ i ðÞ is an additive white noise with unknown variance σ g 2 Now let us represent θ i ðÞ¼2πfidt þ ϕ i ðÞ: The rate of change of phase angle is equal to frequency. So the signal frequency can be represented as [3]: Eq. (1) can be expressed according to trigonometric function as: vi ðÞ¼Qi ðÞcos 2πfi ðÞ ðÞ À Ri ðÞsin 2πfi ðÞ ðÞ where Qi ðÞ¼Ai ðÞcos ϕ i ðÞand R i ðÞ¼Ai ðÞsin ϕ i ðÞ.
The coefficient functions Qi ðÞand R i ðÞexpress the envelope of the time varying sinusoid and can be expanded using Taylor series [17,18] as shown: where where m 0 ¼ A 0 ðÞ : cos ϕ 0 ðÞ Similarly for estimating the frequency of the given sinusoid, consider Eq.(4) at k = 0, the first derivative will be: By substituting Eq. (7) in Eq. (8) and (9) and by neglecting Now from Eq. (2) and Eq. (10), we get the formula for computing the frequency:

Updation of Taylor coefficients using the PSO-tuned Kalman filtering algorithm
Let us consider the following discrete signal: where a, T s , ω, and ϕ are the amplitude, sampling time, angular frequency, and phase of the signal, respectively, and n k represents measurement noise with a covariance R.
We can represent the state space Eq. (10) of the discrete signal as: And the state transition matrix is given by: The measurement model of the signal expressed in Eq. (12) can be calculated as: where the observation matrix can be calculated as: The error signal can be obtained as Using Eq. (19) the updated state estimate can be obtained from the following equation where the Kalman gain K(i) is given as: where b Pi ðÞis the covariance matrix given by where q is the model noise covariance matrix given by r is the measurement noise covariance which is fine tuned by using the error between the desired and estimated signals for where λ g is the forgetting factor in the range (0.9-1). Finally using the EKF time updated equations the Xi ðÞ matrix is computed which determines the values of the Taylor series coefficients m 0 , m 1 , n 0 , and n 1 .

Particle swarm optimization-based tuning of the Kalman filter
For fast convergence, optimum values of q and r are selected by applying a self-adaptive PSO [19]. For this purpose, a cost function is formulated, which passed in the PSO algorithm to get the optimum value for q and r. Here, the cost function is: Particle swarm optimization is used to minimize the value of Eq. (26). Each particle is characterized by two attributes: i. pbest or Personal best: it holds the best value of position with respect to the previous positions of the particular particle.
ii. gbest or Global best: it holds the best value of position in the entire search space.
The PSO algorithm either minimizes or maximizes the value of gbest. Let x ij and V ij be the position and velocity of the i th particle in the j th dimension at k th instance of time. The personal best value can be determined from Eq. (27).

ÈÉ
(28) For each particle, the updated velocity and position at time k þ 1 ðÞ are given by where α is the inertia weight factor, b 1 and b 2 are the acceleration constants, rnd 1 and rnd 2 are random numbers in the range [0, 1], K is a constriction factor given by: The performance of the PSO algorithm is significantly affected by the three factors w, c 1 , and c 2 .
In this approach, a detection function defined as: φ k ðÞ¼| gbest i À x i k ðÞ ÀÁ = pbest i À x i k ðÞ ÀÁ |. The values of the three factors are adjusted dynamically using the following equations where w initial and w final lie in the range 0 < w < 2 ðÞ , L max is the final evolutionary generation, and k is the current evolutionary generation.

PSO-based Taylor-Kalman filter structure
The adaptive filter structure with the proposed adaptive algorithm is shown in the Figure 1. This particular structure is modeled for only the fundamental component of the signal to be estimated. For a signal with Nth order harmonics, the same structure can be extended to meet the requirements. The signal is modeled using Taylor series up to the second order, so the filter  has six weights for the six inputs that are used for the purpose of estimation. The performance of the algorithm is judged on the basis of speed of convergence, which is verified from the simulation results in Section 4.

Simulation and results
The performance of the proposed algorithm for power system signals has been shown with the help of three computer simulated examples.   Kalman Filters for Parameter Estimation of Nonstationary Signals http://dx.doi.org/10.5772/intechopen.71874 Table 1 contains the estimated values of the amplitude, frequency, and phase of the signal under different noise conditions. In this simulation, three different noise conditions have been considered. The simulation is carried out in a dynamic noise range from high noise (20 dB) to low noise (40 dB) conditions to test the performance of the proposed algorithm under noise. The analysis of the performance under noisy conditions shows that the proposed algorithm is able to track the desired signal very closely even under heavy noise conditions.

Performance of the proposed algorithm in harmonic estimation
In this case, the ability of the proposed algorithm is tested with respect to the tracking of harmonics. The number of harmonic components present in the system is not constant, and it can vary from few to a large number. It is not possible for any method to track infinite number of harmonics but can handle a substantial quantity. In the real-time scenario, harmonics occur as odd multiples of the fundamental frequency, so the simulation is carried out with a system generated signal containing harmonics up to the 19th order. where, ai ðÞ¼A exp Ài=300 ðÞ p:u: is the signal amplitude. fi ðÞ¼50Hz The sampling frequency f s ¼ 2kHz and ϕ i ðÞ¼0:52 rad n i ðÞis the 30 dB noise.

Conclusion
The traditional Kalman filter has been extended to Taylor-Kalman filter which resulted in filters that are able to have flat magnitude and phase responses. These filters exhibit excellent tracking abilities and accurately estimate the amplitude, frequency and phase of a time varying power signal without any distortion. The further combination of the Taylor-Kalman filter with self-adaptive PSO makes the performance of the proposed method superior to the traditional approach. The methods can be individually used for the purpose of signal and parameter estimation, but individually, they suffer from some drawbacks. By combining the three methods into one hybrid method, the pitfalls of each are compensated by the other and hence much better results are obtained.
Further, the hardware implementation of the proposed method can be attempted for real-time applications [20][21][22][23]. The hardware implementation of the proposed method can be embedded within an integrated circuit that will result in a system on chip that can be installed at power distribution centers, from where power gets distributed to the consumers, thus equipping them with a tool for detecting anomalies in power quality before power is dispatched to the Author details Sarita Nanda Address all correspondence to: sarita22579@rediffmail.com School of Electronics, KIIT University, India