Open access peer-reviewed chapter

Kalman Filters for Parameter Estimation of Nonstationary Signals

By Sarita Nanda

Submitted: April 22nd 2017Reviewed: October 23rd 2017Published: February 21st 2018

DOI: 10.5772/intechopen.71874

Downloaded: 678

Abstract

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.

Keywords

  • nonstationary signals
  • power signal frequency and phasor estimation
  • hybrid Kalman approach
  • PSO tuning

1. 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.

2. 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 self-convolution 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.

3. 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.

3.1. Signal modeling using Taylor expansion

Let the discrete signal be represented as:

vi=Ai.cosi+ϕi+κiE1

where Ai,ωi,and ϕiare “the amplitude”, “angular frequency,” and “phase” of the sinusoid, respectively. ωi=2πfiand fiis the fundamental frequency of the signal, while κiis an additive white noise with unknown variance σg2Now 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]:

f=12πddtθi=f0+12πddtϕiE2

Eq. (1) can be expressed according to trigonometric function as:

vi=Qicos2πfiRisin2πfiE3

where Qi=AicosϕiandRi=Aisinϕi.

The coefficient functions QiandRiexpress the envelope of the time varying sinusoid and can be expanded using Taylor series [17, 18] as shown:

Qim0+m1i+m2i2+andRin0+n1i+n2i2+E4

where

m0=Q0,m1=dQidtat k = 0; m2=d2Qidt2and m3=d3Qidt3at k = 0.

n0=R0,n1=dRidtat k = 0, n2=d2Ridt2and n3=d3Ridt3at k = 0.

Now we can obtain the amplitude and phase angle of the described given sinusoid using Eq. (3) and (4) as follows at k = 0:

â=m02+n02E5

and

ϕ̂=arctann0/m0E6

where m0=A0.cosϕ0

n0=A0.sinϕ0E7

Similarly for estimating the frequency of the given sinusoid, consider Eq.(4) at k = 0, the first derivative will be:

m1=ddtA0.cosϕ0E8
n1=ddtA0.sinϕ0E9

By substituting Eq. (7) in Eq. (8) and (9) and by neglecting

ddtA0:ddtϕ0=m0n1n0m1m02+n02E10

Now from Eq. (2) and Eq. (10), we get the formula for computing the frequency:

f̂=f0.+12πm0n1n0m1m02+n02E11

3.2. Updation of Taylor coefficients using the PSO-tuned Kalman filtering algorithm

Let us consider the following discrete signal:

Yi=a.sinTS+ϕ+nkE12

where a,Ts,ω,andϕare the amplitude, sampling time, angular frequency, and phase of the signal, respectively, and nkrepresents measurement noise with a covariance R.

We can represent the state space Eq. (10) of the discrete signal as:

χ^i=fiχi+ηiE13
χi1=m0;χi2=m1;χi3=m2;χi4=n0;χi5=n1;χi6=m2E14

And the state transition matrix is given by:

fi=100000010000001000000100000010000001E15

The stochastic model of the signal is obtained as

χ1iχ2iχ3iχ4iχ5iχ6i=100000010000001000000100000010000001χ1iχ2iχ3iχ4iχ5iχ6iE16

The measurement model of the signal expressed in Eq. (12) can be calculated as:

Si=hiχi+viE17

where the observation matrix can be calculated as:

Hi=sin2πf0idtidtsin2πf0idtcos2πf0idtidtcos2πf0idtE18

The error signal can be obtained as

Ei=SHiχ̂iE19

Using Eq. (19) the updated state estimate can be obtained from the following equation

χ^i=χ^i1+KiSiHχ^iE20

where the Kalman gain K(i) is given as:

Ki=P̂i1HiTHP̂i1iHiT+r1E21

where P̂iis the covariance matrix given by

P̂i=P̂i1KiHiP̂i1E22

and

P̂i+1=P̂i+qE23

where q is the model noise covariance matrix given by

q=qa000000qb000000qc000000qd000000qe000000qfE24

r is the measurement noise covariance which is fine tuned by using the error between the desired and estimated signals for

ri=λgr+Ei^2E25

where λgis the forgetting factor in the range (0.9–1). Finally using the EKF time updated equations the Ximatrix is computed which determines the values of the Taylor series coefficients m 0, m 1, n 0, and n 1.

3.3. 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:

F=1Li=1LEi2E26

Particle swarm optimization is used to minimize the value of Eq. (26). Each particle is characterized by two attributes:

  1. pbest or Personal best: it holds the best value of position with respect to the previous positions of the particular particle.

  2. 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 xijand Vijbe the position and velocity of the ithparticle in the jthdimension at kthinstance of time. The personal best value can be determined from Eq. (27).

pbestik+1=pbestik,ifFxik+1>Fpbestikxik+1,ifFxik+1<FpbestikE27

where F indicates the cost function. The value of global best is obtained as:

gbestk=minC..Fpbest0kC..Fpbest1kC..Fpbest2k.C..FpbestskE28

For each particle, the updated velocity and position at time k+1are given by

Vik+1=Kαvik+b1rnd1pbestikxik+b2rnd2gbestikxikE29
xik+1=xik+Vik+1E30

where αis the inertia weight factor, b1and b2are the acceleration constants, rnd1and rnd2are random numbers in the range [0, 1], Kis a constriction factor given by:

K=22bb24b,andb=b1+b2;b>4E31

The performance of the PSO algorithm is significantly affected by the three factors w,c1, and c2. In this approach, a detection function defined as: φk=gbestixik/pbestixik. The values of the three factors are adjusted dynamically using the following equations

αk=αinitialαfinal1+eφkk1+lnφkLmax/μ+αfinalE32
c1k=c1φ1kE33
c2k=c2φkE34

where winitialand wfinallie in the range 0<w<2, Lmaxis the final evolutionary generation, and kis the current evolutionary generation.

3.4. 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.

Figure 1.

Filter structure of the proposed approach.

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.

4.1. Tracking of a nonstationary signal with simultaneous change in amplitude, phase, and frequency

A nonstationary test signal as shown in Eq. (35) is generated in MATLAB. The simulation is done over 1000 samples of the signal. To make the signal nonstationary, a double step is introduced in the signal by changing the value of amplitude from 500 to 700 samples. This is done to simulate voltage surge occurrences in real time, where the amplitude increases from that of its desired value for some period of time. Similar disturbances also change the values of frequency and phase which is also simulated to test the tracking accuracy of the proposed algorithm. The results in Figures 2 5 reveal that the accuracy of the proposed algorithm is very high and tracking is achieved within one cycle of the signal.

yi=aisintdt+ϕi+niE35

where,

ai={0.8p.u,i<500samples1p.u,500<i<700samples0.8p.u,i>700samples

is the signal amplitude.

fi={50Hz,i<500samples51Hz,i>500samples

Figure 2.

Estimated amplitude under 30 dB noise.

Figure 3.

Estimated frequency under 30 dB noise.

Figure 4.

Estimated phase under 30 dB noise.

Figure 5.

Estimated signal under 30 dB noise.

The sampling frequency fs=2kHzϕi=0.5rad0.45rad

niis the noise sequence with power level 30 dB. This signal fed into the algorithm and simulated in MATLAB 2013a environment.

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.

ParameterSamplesActual valueEstimated value
LMSEKFProposed method
20 dB30 dB40 dB20 dB30 dB40 dB20 dB30 dB40 dB
Amplitude0–5000.80.70.7720.7270.760.760.7770.7950.7980.799
500–70010.8850.9460.9190.890.880.930.8960.9420.997
700–10000.80.70.7720.7270.780.790.7870.7890.7940.797
Frequency0–5005050.0550.0250.0250.0350.0250.0350.0050.0150.00
500–10005150.3850.5550.6350.4350.7651.0250.9450.9951
Phase0–5000.50.530.5130.5210.530.530.530.5110.5130.533
500–10000.450.4650.4450.470.430.480.470.440.450.45

Table 1.

Estimated values of amplitude, frequency, and phase under different noise conditions.

4.2. 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.

yi=a1isinidt+ϕ1i+0.8isini3ωidt+0.4+0.6isini5ωidt+0.3+0.5isini7ωidt+0.25+0.4isini11ωidt+0.2+0.2isini19ωidt+0.1E36

The signal parameters are taken as:

ai=0.1sin2πidt+0.05sin10πidta1i=1+aifi=50Hzfsi=4kHzϕ1=0.50.2sin2π5idtd+0.3

The amplitude, frequency, and phase are estimated, and results are shown in Figures 6 11 .

Figure 6.

Estimated fundamental amplitude for case 4.2.

Figure 7.

Estimated third amplitude for case 4.2.

Figure 8.

Estimated fifth amplitude for case 4.2.

Figure 9.

Estimated seventh amplitude for case 4.2.

Figure 10.

Estimated frequency of fundamental for case 4.2.

Figure 11.

Estimated signal for case 4.2.

Table 2 shows the comparison of the absolute errors in amplitude, frequency, and phase estimation for different harmonic components for EKF, LMS, RLS, and the proposed method. The values show that the higher order (>5th order) components exhibit higher error values for all the methods, but the comparison shows that among all the methods compared, the proposed method has the least values of error. This comparison sheds light on the superiority of the proposed method over the other methods.

ParameterComponentAbsolute error
EKFLMSRLSProposed
Amplitude (harmonic order)A10.010.030.0230.007
A30.0130.0320.040.003
A50.020.0470.0560.009
A70.040.0580.08560.017
A110.0250.06230.0210.017
A190.030.08750.0750.025
FrequencyFundamental0.0650.0450.02010.058
PhaseΦ10.00290.00870.00470.0023
Φ30.0060.040.0320.0005
Φ50.0240.0450.0540.007
Φ70.0050.0760.0720.002
Φ110.030.0850.0880.0019
Φ190.0670.0830.07650.04

Table 2.

Comparison of absolute errors.

4.3. Estimation of a power signal in the presence of DC component

When a fault occurs it not only distorts the signal by changing the voltage and current waveforms but some DC component that decays over time also gets added to the signal. DC components are nonperiodic in nature and this simulation shows that the proposed algorithm efficiently tracks nonperiodic components in the signal which is clearly evident from Figures 12 15 . A nonstationary test signal with a decaying DC component as shown in Eq.(37) is considered:

yi=aisintdt+ϕi+niE37

where,

ai=Aexpi/300p.u.A=1p.u.

is the signal amplitude. fi=50Hz

Figure 12.

Estimated amplitude for signal with decaying DC component.

Figure 13.

Estimated frequency for signal with decaying DC component.

Figure 14.

Estimated phase for signal with decaying DC component.

Figure 15.

Estimated signal with decaying DC component.

The sampling frequency fs=2kHzand ϕi=0.52radniis the 30 dB noise.

5. 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 utility network. The objective of developing such a technology is to create a compact and versatile tool. It is a small contribution toward the development of smart grid technology.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Sarita Nanda (February 21st 2018). Kalman Filters for Parameter Estimation of Nonstationary Signals, Kalman Filters - Theory for Advanced Applications, Ginalber Luiz de Oliveira Serra, IntechOpen, DOI: 10.5772/intechopen.71874. Available from:

chapter statistics

678total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Kalman Filter Models for the Prediction of Individualised Thermal Work Strain

By Jia Guo, Ying Chen, Weiping Priscilla Fan, Si Hui Maureen Lee, Junxian Ong, Poh Ling Tan, Yu Li Lydia Law, Kai Wei Jason Lee and Kok-Yong Seng

Related Book

First chapter

Highlighted Aspects From Black Box Fuzzy Modeling For Advanced Control Systems Design

By Ginalber Luiz de Oliveira Serra

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us