Adaptive Unscented Filtering Technique and Particle Swarm Optimization For Estimation of Non-Stationary Signal Parameters

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Adaptive Unscented Filtering Technique and

Particle Swarm Optimization for Estimation of


Non-stationary Signal Parameters
Shazia Hasan, B.K. Panigrahi, IIT Delhi
Silicon Institute of Technology, Bhubaneswar B. Biswal,
P.K. Dash, Silicon Institute of Technology, Bhubaneswar
Silicon Institute of Technology, Bhubaneswar

Abstract: The paper presents an adaptive Unscented Kalman that stimulates the social behaviors of birds or fish. In this
Filter (AUKF) for the estimation of non-stationary signal paper, Particle Swarm Optimization (PSO) technique [8, 9, 10]
amplitude and frequency in the presence of significant noise and is used to optimize the noise covariance matrices in order to
harmonics. The initial choice of the model and measurement achieve the best UKF performance. Generally, PSO has global
error covariance matrices Q and R along with other UKF
parameters is performed using a modified Particle Swarm
searching ability at the beginning of the run and a local search
Optimization (PSO) algorithm. Further to improve the tracking near the end of the run. Therefore, while solving problems
performance of the filter in the presence of noise the error with more local optima, there are more possibilities for the
covariance matrices Q and R are adapted iteratively. Various PSO to explore local optima at the end of the run. Although
simulation results for time varying frequency of the signal reveal PSO is easy to implement and has few parameters to adjust, it
significant improvement in noise rejection and accuracy in suffers from premature convergence, velocity explosion, and
obtaining the frequency and amplitude of the signal. finding good solutions as quickly as it could. Thus we use
Index Term: Adaptive Unscented Kalman Filter Extended adaptive particle swarm optimization (APSO) algorithm. The
Kalman Filter, Particle Swarm Optimization. paper uses Unscented Kalman filter to track the signal
parameters in noise (as low as SNR=10 dB) based on an
I. INTRODUCTION optimal choice of Q and R matrices. The simulation results of
tracking sinusoids corrupted by noise with low SNR and
The classical nonlinear filter is extended kalman filter harmonics reveal significant accuracy and noise rejection
(EKF) [1]; its filter equation is the same as linear kalman filter property.
equation by linearizing the nonlinear equation based on 1-
order Taylor expansion at the predicted points. So the filter II. SIGNAL MODEL
maybe diverge when the observability of the system is low,
instable due to linearization and erroneous parameters, costly Consider a signal consisting of M sinusoids, which can be
calculations of derivatives and the biased nature of the modeled as
estimates and sometime the Jacobian matrix does not exist, in
yk = ∑i=1 Aik cos(ωik tk + φik ) + vk , k = 1,2,....N
M
this case, The EKF can not be used, to address the deficiencies (1)
of EKF, Julier [2] proposed a new unscented transform, which
can be efficient and unbiased for the mean and variance, based Where Aik , ωik and ϕ ik are amplitude, frequency and phase of
on this transform, the Unscented Kalman filter was proposed, the i-th sinusoid respectively, t k = kT s where T s is the
it is shown that this filter have 2-order approximate
convergence for Taylor expansion. sampling time. The modeling error v k is a zero mean Gaussian
The main advantage of unscented transformation used in white noise with variance σ 2
v
. Since the focus in this paper is
UKF is that it does not use linearization for computing the to estimate the amplitude and frequency of a sinusoid buried
state and error covariance matrices resulting in a more in noise only the fundamental component of the signal is
accurate estimation of the parameters of a non stationary considered which is described as
signal [3]-[6]. However, its accuracy significantly, if SNR is
y k = Ak cos(kω k Ts + φ k ) + v k , (2)
low and the noise co variances and some of the parameters
used in unscented transformation are not chosen correctly. The white noise vk is modeled as vk ∼ N (0, Rk ) , and the
Thus for best signal tracking performance, it is proposed in covariance of the measured error is given by
this paper to use particle Swarm Optimization technique T
(PSO),for the optimal choice of UKF parameters and error Rk = E( vk v k ) (3)
covariance matrices Q and R. The discrete signal can be represented in state space as
The particle swarm optimization technique is a stochastic x k +1 = Fk x k + wk (4)
optimization technique developed by Eberhert and Kennedy

978-1-4244-2800-7/09/$25.00 ©2009 IEEE 3853 ICIEA 2009


and the model error covariance wk = N(0, Q k ) and the problem, L=3 so χ k −1 is a 3×7 matrix. The sigma points are
state variables are expressed as computed as,

x k (1) = A sin( x k (3).kΔTs + φ)


(
χ 0, k −1 = x̂ k −1 χi,k −1 = xˆ k −1 + (l + λ)Pk −1 i , i = 1, 2 , ..., L )
x k (2) = A cos( x k (3).kΔTs + φ) (5)
(
χi+L,k−1 = xˆk−1 − (L + λ)Pk−1 i , i = L +1, ...,2L ) (11)
The parameter λ is used to control the covariance matrix, and
x k (3) = ω 2
is λ = α (L + K ) − L (12)
The state-transition matrix in this case becomes equal to
Both λ and K are scaling parameters. The constant α
⎡ cos(xk (3)ΔTs ) sin(xk (3)ΔTs ) 0⎤ determines the spread of the sigma points and its value is
Fk ( xk ) = ⎢⎢− sin(xk (3)ΔTs ) cos(xk (3)ΔTs ) 0⎥⎥ (6) between 0.0001<= α<=1.
⎢⎣ 0 0 1⎥⎦ After computing the sigma points the time update of state
estimates are given by
The observation model is given by
y k = h( x k ) + v k (7) χ k k −1
= F k −1 ( x k −1 ) (13)
2L
Here h( x k ) = [1 0 0] x k , and the observation matrix H is xˆ k− = ∑W i
m
χ i, k k −1
(14)
given by i=0

H=[1 0 0] (8) Where the weights Wim are defined by


And the model noise covariance matrix is given by λ λ , W (m ) = 1 , i
⎡q1 0 0 ⎤ W 0( m ) = , W i( m ) = i+ L
⎢ (9) L+λ 2(L + λ ) 2(L + λ )
Q = ⎢ 0 q2 0 ⎥⎥
=1, 2…, L (15)
⎢⎣ 0 0 q 3 ⎥⎦ The a priori error covariance is given by
In the presence of harmonics, the performance of the single
[ ][ ] +Q
2L T
sinusoid model might deteriorate and, therefore, the signal Pk = ∑ Wi(c) χi,k k−1 − x̂ −k χi,k k−1 − x̂ −k k (16)
model should contain harmonics also. In the model with a i =0
nonlinear observation matrix, any number of harmonic Where the weights Wi c are defined by
components can be added increasing the computational
burden. λ
W 0( c ) = + (1 − α 2 + β )
(L + λ )
III. ADAPTIVE UNSCENTED KALMAN FILTER (AUKF) 1 1
W i( c ) = + (1 − α 2 + β ) , W i(+cL) = ,
2(L + λ ) 2(L + λ )
Although EKF is straightforward and simple it suffers from i=1,2…,L (17)
instability due to linearization and erroneous parameters, The estimated output is
costly calculation of Jacobean matrices; and the biased nature
of its estimates. The unscented Kalman filter known as UKF is
Yi , k k −1 = H χ i ,k k −1,( ) (18)
considered in this paper to overcome the disadvantages of 2L

EKF. The main advantage of UKF is that it does not use ŷ −k = ∑Wi−0
i
(m )
Y i,k k −1
(19)
linearization for calculating the state predictions and
The a posterior state estimate is computed as
covariance matrices and thus it provides accurate Kalman gain
estimates. Instead of liberalizing the Jacobean matrices, the X̂ k = X̂ −k + K k ( y k − ŷ −k ) (20)
UKF uses a deterministic sampling approach to capture mean Where Kk is the Kalman gain given by
and covariance estimates with a minimal set of sample points.
K k = G k S −k1 (21)
It utilizes a deterministic sampling approach in choosing
[χ ][ ] (22)
2L
2×L+1, sigma points (L is the state dimension) based on a
∑W
T
With G k = i
(c)
− x̂ −k Y i , k k −1 − ŷ −k
i , k k −1
square-root decomposition of the prior covariance. These i=0
sigma points are propagated through the nonlinearity, without
[Y ][ ]
2L

∑W
T
approximation, and a weighted mean and covariance is found. Sk = (c)
− ŷ −k Yi , k k −1 − ŷ −k + Rk (23)
i i , k k −1
i=0
The UKF thus involves the recursive application of the
sampling approach to the state space equations of the signal. Rk is measurement error covariance matrix. The a posterior
The UKF algorithm is summarized in the following steps: estimate of the error covariance matrix is given by
For the system state x, initialize with
Pk = Pk−1 − K k S k K Tk (24)
xˆ 0 = E[ x 0 ] , P0 = E[( x 0 − xˆ 0 )( x 0 − xˆ 0 ) T ] , (10)
Like the EKF algorithm, the UKF parameters Qk, Rk,α,β, K
Given a state vector at step k-1, sigma points are computed are to be chosen by trial and error. The measurement error
and stored in the columns of L×(2L+1) sigma point matrix χ ,
covariance Rk and model error covariance Qk are updated in
where, L=dimension of the state vector. For the present
the following manner gives us Adaptive Unscented Kalman

3854
filter. Adaptive PSO algorithm (APSO):
The model error can be estimated at instant k as follows The inertia weight ω is updated by finding the variance of the
Z k = Xˆ k − Xˆ k− = K k ( y k − yˆ k− ), (25) population fitness as
2
M
⎛ fi − favg ⎞ . (33)
Note that , according to number of state which is three in the σ 2
= ∑ ⎜⎜
f
⎟⎟
i =1 ⎝ ⎠
above UKF model Z k takes different value, leading to
where f avg is the average fitness of the population of particles
different variance estimates. Hence the model error covariance
estimate is taken as the average of all the three terms in a given generation. f i is the fitness of the ith particle in the
( )
^
population. M is the total number of particles
Qk = 1/ 2 abs(Z1k ) + abs(Z2k ) + abs(Z3k ) 2 × I ,
2 2
(26)
And measurement error covariance is estimated as { (
f = max fi − favg , i=1, 2, 3……M )} (34)

R = R0 + λ (abs Z k )(abs Z k −1 ), (27) In the equation given above f is normalizing factor which is
Where λ is forgetting factor and 0 ≤ λ ≤ 1 used to limit σ. If σ is large, the population will be in a random
In this way in every instant the model error covariance and searching mode, while for small σ or σ = 0, the solution tends
measurement error covariance are updated .This new value of towards a premature convergence and will give the local best
^ position of the particles. To circumvent this phenomenon and
covariance matrix Q k and R is used to improve estimate of to obtain gbest solution, the inertia weight factor is updated
the state through iterative procedure. using a fuzzy rule base and fuzzy membership values of the
change in standard deviation Δσ in the following way:
IV. PARTICLE SWARM OPTIMIZATION OF AUKF
Δσ = σ(k) −σ(k −1) (35)
ALGORITHM
The fuzzy rule base for arriving at a weight change is
An optimized solution to obtain an optimal performance expressed as
with low SNR can be possible using particle swarm R1. If Δ σ is Big Then Δ ϖ =rand1 ( ) Δσ (36)
optimization technique. PSO is a novel stochastic origin in the R2: If Δ σ is Small Then Δϖ = rand2 ( ) Δσ
motion of a flock of birds searching for food. During its flight
each particle adjusts its trajectory by dynamically altering its Where the membership functions for Big and Small are given
velocity according to its own flying experience and the flying by μ B (s) = Δσ ; μ S (s) = 1 − Δσ (37)
experience of the other particles in the search space. For a
particle moving in a multidimensional search space let si,j and where rand1 ( ) and rand 2 ( ) are random numbers
vi,j denote the position of ith particle in the jth dimension and between 0 and 1, and 0 ≤ Δσ ≤ 1
velocity at time t is,
Using centroid defuzzification principle the value of Δ ϖ is
⎧pbesti (t), if f (si (t +1) > f ( pbesti (t) obtained as
pbesti (t +1) = ⎨ (28)
⎩ si (t +1),if f (si (t +1) < f ( pbesti (t) Δϖ = Δ σ . rand1 ( ) Δσ + rand2( ) Δσ . (1- Δσ ) (38)
and the global best position is obtained as Thus the value of the new weight is obtained as
gˆbest(t) = min{ f ( pbest0(t), f ( pbest s (t)} (29)
1(t),.....,f ( pbest w(k) = w(k - 1) + Δϖ ; 0.4 ≤ w (k) ≤ 0.9 (39)
The modified velocity and position of each particle at time Here the influence of the past velocity of a particle on the
(t+1) can be calculated as current velocity is chosen to be random and the inertia weight
⎛ωvi (t) + ϕ1.rand( ).(pbesti − si (t))⎞ is adapted randomly depending on the variance of the fitness
vi (t +1) = K.⎜⎜ ⎟⎟ (30) value of a population. This results in an optional coordination
⎝ + ϕ2 .rand( ).(gbesti − si (t)) ⎠ of local and global searching abilities of the particles.
si (t + 1) = si (t ) + vi (t + 1) (31)
V. SIMULATION RESULTS FOR ESTIMATION OF TIME
where vi is the velocity of ith particle at time t+1, si is the VARYING FREQUENCIES
current position, ω is the inertia weight factor ϕ1 and ϕ 2 are
acceleration constant, rand ( ) is an uniform random value in The following case studies on frequency, amplitude and
the range [0,1], K is the constriction factor which is a function phase of the non-stationary signals in noise are presented to
highlight the adaptive EKF, AUKF and APSO performance
ϕ1 and ϕ 2 given by
1 (32) Case 1: Ramp variation in signal Frequency
K =
2
2 − ϕ − ϕ − 4ϕ
The signal considered for performance is
and ϕ = ϕ1 + ϕ 2 ; ϕ > 4 y (k ) = sin(kωTs + φ ) + n(t ) and the angular frequency
A suitable selection of inertial weight ω and acceleration ω is varied linearly as ,For
coefficients ϕ1 and ϕ 2 is crucial in providing a balance
between the global and local search in the flying space.

3855
0 ≤ k ≤ 300 w(k ) = w0 ,for 300 ≤ k ≤ 700 components. Thus, UKF and its variants are able to track non-
stationary signal frequency and amplitude efficiently in
w(k ) = w0 + ( w1 − w0 ) / 400(k − 300) ,and presence of noise and harmonics. Also Table-3 presents the
for k > 700 w( k ) = w1 . (40) mean of MSE for the different variants of the Kalman filter.
The above equation represents a time varying frequency from Table. I
w0= 50 Hz to w1=55 Hz. The sampling frequency is chosen as The mean of MSE over 100 independent runs
1 kHz. The errors between the tracked parameters and the Algorithm 60Db 30Db 20Db 10Db
actual parameters are shown in Fig.1 for noise level of 10 dB. EKF 0.0049 0.0063 0.3031 0.501
From the figures it is observed that for the SNR 10dB the AEKF 0.0044 0.0058 0.2901 0.490
performance of the EKF tracker is found to deteriorate as
UKF 0.0042 0.0056 0.2953 0.493
shown in Fig.1. The tracked frequency is found to contain
AUKF 0.003 0.0033 0.0192 0.0312
noise and fluctuations during the initial samples and when the
frequency is ramped. Same signal is analyzed using UKF, AUKFPSO 0.0021 0.0031 0.0063 0.0137
AUKF and AUKF with APSO.Fig.2 shows the improvement
Table. II
of AUKF which uses tuning of measurement and model error The mean of MSE over 100 independent runs
covariance matrices. Then tuning of AUKF parameters is Algorithm 60Db 30Db 20Db 10Db
done through one of the variants of PSO (APSO). To have a EKF 0.00513 0.0854 0.0538 0.231
meaningful comparison of the performance of the various
AEKF 0.0032 0.0721 0.0489 0.219
filters like the EKF, AEKF, UKF, AUKF and the UKF
UKF 0.0030 0.073 0.0501 0.214
optimized by the PSO the mean of MSE over a 100 iterations
AUKF 0.0021 0.035 0.0386 0.1551
are given in Table-1 at different noise levels.
AUKFPSO 0.00146 0.0219 0.046 0.0214
Case 2: Frequency modulated variation Table. III
The mean of MSE over 100 independent runs
In this test the frequency of the sinusoid is modulated by a Algorithm 60Db 30Db 20Db 10Db
small time varying frequency component and the resultant EKF 0.121 0.0263 0.196 0.421
frequency is tracked with the various filters mentioned for test AEKF 0.0987 0.0209 0.190 0.401
1. The test signal used is UKF 0.0955 0.017 0.189 0.398
y k = A sin(φ (k )) + n(k ) (41) AUKF 0.0087 0.016 0.163 0.288
where φ( k ) = φ( k − 1) + ω( k ) Δt , for k ≥1 (42) AUKFPSO 0.0063 0.0089 0.096 0.126
and the frequency is time varying,
ω(k) = 2π [50 + sin(2π.1.t k ) + .5 sin(2π.6.t k )] (43)
Frequency estmate

60
The signal to noise ratio of the signal y k is 10 dB as in the 55
last two examples. Fig.3. shows the results of tracking of
frequency, frequency error and amplitude error of the signal 50 EKF
with 10db noise. It is observed that when the SNR is lowered AEKF
to 10 dB, the frequency tracking performance of the Kalman 45
filters deteriorate and significant errors creep in as shown in 0 200 400 600 800 1000
Fig.3. Similar to case.1 analysis the above signal is analyzed
using UKF, AUKF and AUKF with APSO. Fig.4 shows the 4
Frequency error

improvement of AUKF and APSO over UKF at 10dB SNR.


As in case 1,the performance of the various filters like the 2
EKF, AEKF, UKF, AUKF and the UKF optimized by the 0
PSO the mean of MSE over a 100 iterations are given in
Table-2 at different noise levels. -2
0 200 400 600 800 1000
Case 3: Step variation in signal frequency
0.5
Amplitude error

First the time varying signal considered here has a frequency


jump from w0=50 Hz to w1=52 Hz. Fig.5 shows the signal
0
parameter tracking results at SNR=10 dB. Similar to case.1
analysis the above signal is analyzed using UKF, AUKF and
with APSO. Fig.6 shows the improvement of AUKF and -0.5
APSO over UKF at 30dB SNR.Fig.7 shows the effect of 0 200 400 600 800 1000
harmonics present in the signal as noise. Here the signal is samples
corrupted with 30dB noise, 3rd and 5th harmonic components. Fig.1 Comparison of EKF and AEKF for ramp
Fig.7 illustrates the negligible effect of 3rd and 5th harmonic frequency variation with 10Db noise

3856
F req uen c y e s tim ate

Frequency estimate
58
56 52 AUKFPSO
UKF
54 AUKF
UKF 50
52
AUKF
50 AUKFPSO
48 48
0 200 400 600 800 1000 0 200 400 600 800 1000

frequency error
1
fre que nc y error

0 0

-1 -1
0 200 400 600 800 1000
0 200 400 600 800 1000
1
1

Amp error
A m p error

0.5 0

0
-1
0 200 400 600 800 1000
-0.5
0 200 400 600 800 1000 Samples
Fig.4 Comparison of UKF, AUKF and AUKFPSO for
Fig.2 Comparison of UKF,AUKF and AUKFPSO
modulated frequency variation with 10Db noise
for ramp frequency variation with 10Db noise
Frequency estimate

53 54
Frequency estimate

52 TEKF
51 52
EKF
50
50
49
48 48
0 200 400 600 800 1000 0 20 40 60 80 100
1
Frequency error

1
frequency error

0
0.5

-1 0
-2
-0.5
0 200 400 600 800 1000 0 20 40 60 80 100
0.1
Amp error
Amplitude error

0
0
-0.2

-0.4
-0.1
0 200 400 600 800 1000
0 20 40 60 80 100
Samples Sample
Fig.3 Comparison of EKF and AEKF for modulated Fig.5 Comparison of EKF and AEKF for modulated
frequency variation with 10Db noise frequency variation with 10Db noise
AEKF, EKF
3857
VII. CONCLUSION
The paper proposes an adaptive Unscented Kalman filter
F re q u e n c y e s tim a t e

technique with optimized noise covariance matrices by


54
Adaptive PSO optimization techniques to estimate the
52 amplitude and frequency of a signal, whose frequency is either
UKF ramped, modulated or is varied in a step-wise manner. Both
50 AUKF large and small variations along with noise are considered for
AUKFPSO signal frequency and parameter estimation. It is observed that
48 the error in frequency estimation decreases significantly in
0 10 20 30 40 50 60 70 80 90 100
2 UKF with Q and R optimization using APSO. The paper also
presents the effects of an adaptive measurement error
F re q u e n c y e rro r

covariance R and model error covariance Q on the overall


1
performance of the UKF in tracking accurately the signal
parameters along with frequency.
0
REFERENCES
-1
0 10 20 30 40 50 60 70 80 90 100 [1]. P.K.Dash, R.K. Jena, G.Panda, and A.Routray, “An extended complex
Kalman filter for frequency measurement of distorted signals’, IEEE Trans. on
1 Instrument and Measurement, vol.49, pp.746-753, 2000

[2]. S. J. Julier and J. K. Uhlmann “Unscented Filtering and Nonlinear


A m p e rro r

0.5
Estimation” in Proceedings of the IEEE, Vol. 92.No.3, March 2004

0 [3] Julier S J, Uhlmann J K, Durrant-Whyte H F. “A new approach for


filtering nonlinear systems,” Proc. of the 34th IEEE ACC, Washington:
Seattle, Jun. 1995, pp. 1628-1632.
-0.5
0 10 20 30 40 50 60 70 80 90 100 [4] Julier S J, Uhlmann J K, Durrant-Whyte H F. “A new approach for the
Sample nonlinear transformation of means and covariances in filters and estimators”,
IEEE Trans on Automatic Control, vol. 45(3), 2000, pp. 477-482.
Fig.6 Comparison of UKF, AUKF and AUKFPSO
for square frequency variation with 10Db noise [5] Julier S J. “The scaled unscented transformation”. Proceedings of the
American Control Conference, Anchorage, AK, 2000, pp. 4555-4559.

[6] Lefebvre T, Bruyninckx H, De Schutter J. “Comment on ‘a new method


for the nonlinear transformation of means and covariances in filters and
F re q u e n c y e s t im a t e

54 estimators’,” IEEE Trans on Automatic Control, vol. 47(8), 2002, pp.1406-


1408.
52
[7]. M.Athans, R. P.Wishner and A.Bertolini. Suboptimal State Estimation
50 For Continuous-Time Nonlinear Systems From Discrete Noisy Measurements.
IEEE Transactions on Automatic Control, TAC-13(6) 504-518, October 1968.
48
0 10 20 30 40 50 60 70 80 90 100 [8]. J. Kennedy, and R.C. Eberhart, Swarm Intelligence, Morgan Kaufmann
Publishers, 2001.
F r e q u e n c y e r ro r

1 [9]. Z.la, T.Y.ji, W.H.Tang, Q.H.Wu“Optimal Harmonic Estimation using a


Particle Swarm Optimizer”, IEEE Trans. on Power Delivery, vol.23, No.2,
pp.1166-1174, April. 2008.
0
[10]. M.A. Abido, “Optimal design of power system stabilizers using particle
-1 swarm optimization”, IEEE Trans. on Energy Conversion, vol.17, pp.406-413,
Sept.
0 10 20 30 40 50 60 70 80 90 100
0.1
A m p e rr o r

-0.1
0 10 20 30 40 50 60 70 80 90 100
Sample
Fig.7 Comparison of UKF and its variants
with harmonic and 30dB noise
UKF, AUKF, AUKFPSO

3858

You might also like