You are on page 1of 5

Proceedings of the American Control Conference

Chicago, Illinois June 2000


FREQUENCY TRACKING VIA
EXTENDED KALMAN FILTER: PARAMETER DESIGN

Sergio Bittanti, Sergio M. Savaresi


Politecnico cJi Miluno, Dipartiinento di Elettronica e Ii$orriicizione, Picizzci Leonardo dci Vinci,32, 20133,
Milcino, ITALY. E-iVIui1: :hiltun/i;sLi1:cii,esi~ ' ~ ~ l e ~ . ~ ~ o l i i i t i . i t .

Abstract. In this paper, the problem of estimating the noises, having variances q and r, respectively:
frequency of an harmonic signal embedded in broad-band w(t) W N ( 0 , q ) and v ( t )= W N ( 0 , r ) . The parameter E
noise is considered. The paper focuses on the Extended (where & L O and, typically, & < < I ) has the goal of
Kalman Filter Frequency Tracker, which is the application enforcing stability into the third equation of ( I ) . The state
of the Extended Kalman Filter (EKF) framework to the variable x 3 ( t ) represents the unknown frequency U .
frequency estimation problem. The EKF Frequency Tracker
Given the state-space model ( l ) , the EKF technique can be
recently proposed in the literature is characterised by a
applied straightforwardly (see e.g. [l], [13] for a general
vector of three design parameters, whose tuning is still a
description of EKF). The complete set of equations of the
controversial and unclear issue. In this paper it is shown
EKF Frequency Tracker derived from (1) is here recalled
that the Extended Kalman Frequency Tracker can be
(see [7-91 for more details):

I
parametrized using just one design parameter, without any
loss of performance. This simplification allows an easier ,?(t//) = f ( $ t - I / / - I ) ) + K ( t ) ( y ( l ) - Hf(.i(t - I / / - I)))
and more transparent tuning of the EKF tracking behaviour. &(t) = C i ( r / t )
(2a)
Key words. Extended Kalman Filter; frequency tracking; K ( I ) = P ( ~ ) H( /H P ( ~ ) H+' r)-'
harmonic analysis; parameter estimation. P(t + 1) = F(t)[P(/)- P ( / ) H /( H P ( t ) H / + r ) - l H p ( t ) k /(/) + q/,
where
I . INTRODUCTION
This paper deals with the problem of estimating the
frequency o of an harmonic signal s ( t ) = Acos(ot + cp),
given its noisy measurement y ( t ) = s ( t ) + n ( t ) ,where n ( t )
is a broad-band stationary signal (e.g. a white noise).
This problem is frequently encountered in real-world
applications, especially in the fields of adaptive control and
signal processing, and numerous techniques have been
developed for its treatment (see e.g. [5-61, [lo-111). This
paper focuses on the use of the Extended Kalman Filter
(EKF), an approach which has been recently proposed by
Bitmead and co-authors in [7-91 for the design of a
Frequency Tracker. In particular, in [7] the EKF Frequency
Tracker is proposed, and some heuristic guidelines for the
tuning of its parameters are proposed. In [9] its stability Recursive eqs. (2) are suitable for on-line frequency
analysis is developed, whereas the case of high-noise tracking. In particular, the fourth equation in (2a), giving a
environments is considered in [SI. recursion for the auxiliary matrix P(t) of dimension 3x3, is
The basic idea around which papers [7-91 evolve around is the celebrated Riccafi equation ([3]).
to model the measured signal y ( t ) = s ( t ) + n ( t ) by means As any frequency tracker, from an external point of view
of a third-order state space model, as follows: the EKF Frequency Tracker (2) can be seen as a device

1
x,(t + 1) = cos(x3(t))xl(t) - sin(x,(t))x,(t) receiving the measured signal y ( t ) as input, and delivering
x2(t + 1) = sin(x,(t))x,(t) +cos(x,(t))x,(t) the estimated frequency h(t)= i , ( t / t ) as output. The
(1) internal structure is constituted by two main sub-parts: the
x;(t+1)=(1-E)X3(t)+W(f)
first one performs the updating of the state equations,
y ( t ) = XI ( t ) + 4 2 ) according to the first expression in (2a); the second one has
Here w(t) and v ( t ) are zero-mean incorrelated white the task of providing the gain vector at each time step, and
is based on the third and fourth equations of (2a).
0-7803-551 9-9/00 $10.00 0 2000 AACC 2225
Notice that the EKF is parameterised in { 4 , r , ~ }These . Proof. Consider the state equations of the EKF (2a), under
three parameters are the ”knobs”, by means of which the the assumption that the frequency estimate is at steady-
designer can obtain suitable tracking performance. state, namely i 3 ( t / t )= i 3 ( t - 1 l t - 1) = X3 . Then, denoting
In [7] and [9] a preliminary analysis of the roles played by by { K , ( f ) ) i = , , 2the
, j three components of K(t), the original
the parameters { 4 . r , ~ }is given, and some guidelines for equations of (2) can be written as:
their tuning are proposed. Such analysis, having the

1
*GI(///) = C O & ~ ) ? ~ ( / - I / / - 1) -sin(y?)-Q?(/- I / / - I ) +
objective of explaining the effects of each parameter on the + K , (r)lv(/)-co+;)i-, (/ - I / i - i) +sin(i; )q2 ( I - I / / - I)]
EKF performance. is mainly based upon Monte-Carlo (3)
.t2( I //) = siii(.Tl IQ,( I - I / / - I ) + cos(.^;).<-^ ( I - I / / - I ) +
simulation trials. Some useful and interesting indications
have been obtained in this way, but the tuning of ( 4 , r , ~ )
still remains a difficult task due to the unclear cross-
relationships between such parameters.
I + K2(t)Lv(l)- c04.Y~PI(I - I / t - I)+sin(Y; ( I - I / / - I)]
X; = ( I -&)y3+ K ; ( t ) ~ ( / ) - C O ~ . Y ; ~ ~I ,/ (/ /-- I )t sin(Tl).Q2(/ - I / / - I)]
Note that the dynamics of (3) is confined into the first two
equations. Thus, i , ( f l t ) and i z ( t / t ) are the only state
Moving from the seminal works [7-91, the goal of this
paper is to go a step further in the analysis of the EKF variables of system (3). Y, can be seen as its output,
Frequency Tracker, in order to gain more insight in the whereas y(t) plays the role of input signal. Interestingly
relationships between its behaviour and its tuneable enough, while system (3) is non-linear, the system obtained
parameters (4,r, E } . Precisely, two simple but fundamental by setting &(t/t)=const. is linear. So, one can compute
results will be established: the transfer function from y(t)to T3 . To this purpose, using
0 Even in a noise-free setting ( n ( t ) = 0 V t ), if E > 0 the (3), by cumbersome but simple computations, one obtains:
EKF Frequency Tracker (2) provides an 0;; = K; (t)G(z;Ki ( t ) ,K2 ( t ) ,Z; >y(t> 7 (4)
asymptotically biased estimate of the unknown where
frequency w . The bias is zero only for E = 0 . G ( z ; K (, t ) , K 2 ( t ) . y 3=)
Q The performance of the EKF Frequency Tracker z ( 2 - 2ZCOS(Y3) + 1) .( 5 )
depends on the ratio h = r 14 only. -
(K,(t)cos(jT,)-
Z* -z(K,(t)sin(jT3)+2cos(jT3))+ K , ( t ) + 1)
The main outcome of these statements is that a wise Eq. (4) expresses the relationship between the input y(t) and
parameterisation of (2) corresponds to set E = 0 from the the output Ex3, Under the assumption of noise-free setting,
very beginning, and then using h = r14 as the only tuning
the input signal of system (5) is a pure sinusoid:
knob. This greatly simplifies the designer task. y ( t ) = s ( t ) = Acos(wt) . Therefore we can resort to the
The outline of the paper is as follows: in Section 2 a bias- frequency-response theorem to determine the steady-state
analysis of (2) is given, whereas Section 3 is devoted to the value of the output. Equation (4) hence can be rewritten as:
analysis of the dependence of (2) upon r and q. These
results are both illustrated with a numerical example at the 6, K , ( / ) ,K 2 ( t ) ,Z3)lc~s(o>/+ L G ( e ” ; Kl(t), K ~ ( / ) , T , ) ) . ( ~ )
= K,(t)IG(e’“’;

end of Section 2 and Section 3, respectively. Eq. (6) is peculiar in that it expresses how a sinusoidui
signal determines a constant signal. As a matter of fact,
2. BIAS ANALYSIS what really matters is when the bias xj -a is zero. Now
A minimal requirement for a good frequency tracker is the from ( 5 ) it is apparent that the numerator evaluated in e’”
so-called unbiasedness in a noise-free setting. This means is zero if and only if 2, = w . Thus, from ( 6 ) it is possible
that, if the measure y(t) of the harmonic signal to conclude that the frequency estimation bias is zero if and
s ( t ) = Acos(wt) is not corrupted by noise ( n ( t ) = 0 V t ),
only if EO = 0 .
and the frequency w is constant, the frequency tracker is
The above Proposition 1 states a very simple but interesting
expected to provide an estimate h(t) which, at steady- twofold result:
state, coincides with w . Most of the frequency trackers 0 At steady-state, the EKF frequency Tracker (2) is
typically used in real-world applications (see e.g. [2], [4-61, unbiased (for every value of o ) in a noise-free setting
[IO-121) obviously have the above simple property. In the only if the parameter E is set to zero.
subsequent result we will show that the EKF Frequency
Tracker (2) does not have this property if E > 0 . Since IG(e’”;K,(t),K,(t),2;)I=O V t if and only if
Proposition 1. Consider the EKF Frequency Tracker (2). Z3= w , equation (4) points out that the bias must
Assume that n(t) = 0, V t and that the frequency w of
depends on the value T, of the sinusoidal signal
the harmonic signal s ( t ) = Acos(ot) is constant. At frequency. Specifically, since the first member of
steady-state, the frequency estimate & ( t ) = , f , ( t / t ) equation (4) grows as 2, increases, the bias is expected
provided by (2) is unbiased if and only if EW = 0 .
2226
to grow with X3.Such a dependence of the bias upon has been set to ~=0.05;as a second trial, E is set to zero. The
the estimated frequency was already empirically results of the so-obtained frequency estimation are
pointed out in [7]. Proposition 1 now provides a simple displayed in Fig. 1. These diagrams clearly show the main
explanation to this fact. conclusions which can be drawn from Proposition 1 :
A straightforward consequence of the above Proposition 1 If E>O, the estimation is strongly biased even for small
is that the best choice for E is to set E=O; as a matter of fact values of E.
E>O may lead to a strong estimation bias which (unless o The bias increases as the value of the unknown
is very close to zero) dominates the mean square error of frequency increases;
the frequency estimate (this is confirmed by the heuristic The dynamic properties (stability and noise rejection)
analysis proposed in [7] - see also Example 1 below), of the EKF Frequency Tracker in the case ~=0.05and
without providing any clear benefit. In this regard, it is E=O are similar (the only clearly visible difference is
interesting to notice that the condition E>O was introduced just the presence of bias if E>O ).
in [7-91 with the goal of having the 3rd equation of model 25 frequency - _-
, 1
I
(1) asymptotically stable. As is well known, however, the ................................................
stability of the model is not required in order to come out
.*....'.
with a stable Kalman Filter: specifically, it is easy to check
by simulation that the stability properties of the EKF
Frequency Tracker using E=O or E>O (with ~ < < 1 )are
indistinguishable (see Example 1 below). This is confirmed J
by the fact that, in the stability analysis of the EKF 0 100 200 300 400 500
time
600 700 800 900 1000

proposed in [9], the assumption E>O does not play a crucial 2.5
I
frequency
I
-1
1

role.
On the basis of the above result, in the rest of the paper the
EKF Frequency Tracker (2) will be replaced by its
simplified version obtained by substituting E=O in (2),
namely: 05

(i(///) - I / / - I))+ K ( / ) ( Y ( / )- H f ( i ( / - I / / - 1)))


= f(i(/ 0
0 100 200 300 400 500 600 700 800 900 1000

I W ( / ) = Ci(///)

+ .)-'
K ( t ) = P(t)H'(HP(f)H'
( P ( t + 1) = F ( t ) [ P ( / ) - P ( t ) H 7(HP(/)H' + r)-'HP(l)JF' ( I ) + q/
dashed line indicates the true frequency).
tlme
Fig. 1. Frequency tracking of the EKF ~=0.05and E=O (the

where: 3. PARAMETERISATION ANALYSIS


In the previous section it has been shown that, in order the
EKF Frequency Tracker to, be asymptotically unbiased in a
noise-free setting, the parameter E must be set to zero.
Another issue - even more important and interesting - is
[.=[I 0 01 c=[o 0 I] the role played by q and r in determining the tracker
In this way, the vector of "tuneable" parameters reduces to performance. Some indications and guidelines are given in
two parameters only, q and r. We conclude this section with [7] and [9]. The issue, however, remains somewhat
a simulation example, having the goal of showing the effect controversial and unclear.
of setting E=O vs. E ~ Oin (2). In this section it will be shown that the performances of the
Example 1. EKF Frequency Tracker are not influenced independently
by q and r, but they only depend on the ratio h = r / q . This
The signal considered in this numerical example is an
harmonic signal embedded in white noise, characterised by result is particularly interesting since allows a further
simplification of the tracker (7). The result is formally
a time-varying frequency. Specifically, y ( t ) = s ( t ) + n ( t ) ,
stated and proven in the following Proposition 2.
t=1,2, ... 1000, where n ( t ) = WN(O,O.Ol), s(t) = cos($t) for
Proposition 2. Given a measured signal
t=1,2 ...300, and s ( t ) = c o s ( 4 t ) for ~ 7 0 1 , 7 0 ...
2 1000; for y ( t ) = Acos(ot) + n(t) , the estimated frequency
~ 3 0 1 , 3 0 2..700
. s ( t ) is characterised by a time-varying 6 ( f =) i , ( t / t ) obtained using the EKF Frequency
frequency which increases linearly from 4 6 to 2n/3. Tracker (8) depends upon the ratio h = r / q only.
In order to estimate the frequency of the harmonic signal Proof. Consider the time series ;(t / t ) , F(t), f ( t ) and K ( t )
embedded in y ( t ) , the EKF Frequency Tracker (2), with obtained by means of the EKF Frequency Tracker (7)
~0.01 and q=0.005, has been used. First the parameter E when using the parameters q and r (and fed with y(t)). We
2227
are now interested in understanding the relationships =3 K(t)=K(t).
between i ( f I t ) , F(t) P(t) and K(t) and the corresponding
By inspecting the structure of the EKF (see (7)) we can
time series, say F ( t l t ) , F ( t ) , F ( t ) and i ( t ) , obtained conclude that, if the initialisation of the filter is the same,
when using = aq and 7 = ar (a>O)instead of q and r . scaling the parameters q and r by the same positive real
number a has no effects on the state estimation. This means
To this end, consider the Riccati Equation used in (7) given
by :
P ( / + l ) = ~ - ~ , ) [ P ~ / ) - f ( / ) H / ( H P (+/r). H / P ( / ) l F ’ ( / ) + q / :(8)
j’H ,
that the estimated frequency & ( t ) obtained using the EKF
Frequency Tracker (7) depends on the ratio h = r / q only.
The above Proposition 2 is interesting since rigorously
.
and plug in (8) aP(f+l)in place of f ( t + l ) , aP(t) in place of
allows a re-parameterisation of the EKF Frequency Tracker
P(t), aq in place of q, and ar in place of r :
(7). As a matter of fact, by conventionally setting q=l
@t -@t)H7 (hlxqt)H7 +w)-Ihlxqf)lp’(t)+CYq4 .
+ I) = qtkt) (9) (hence h = r ), we obtain:
After some simple manipulations of (9) we come to the
Riccati equation
P ( f+ 1) = F(f)[P(t)- P(t)H’ (HP(f)H7 + $1 HP(f)E’r(t)+ q I 3 , (10)
which actually coincides with (8). This means that if
9 = aq and F = ar (a>O) are used instead of q and r, the
I i ( t / t )= f ( i ( t - l / r
&(f) = C i ( f / f )
- I ) ) + K(r)&r)

K ( t ) = P ( f ) H ‘ (HP(f)H7 +$I
- Hf(i(t- l / r - 1)))

P(r + 1) = F(i)[P(t)- P(r)H7 (HP(t)H7 + h)-lHP(r)b‘ ( r ) + 1;


where:
(13a)

1 ‘ I
resulting solution F ( t ) is equal to aP(t). cos(i,(t/t))i, ( t / t )- sin(i3(t/t))i2( t / t )
It is important to stress, however, that this is true under the f ( i ( r / r ) )= sin(i3(t/t))il( t / t )+ cos(i,(t/t)P,(t/t)
.(13b)
assumption that F(t) does not change if q and r are both i,(t/f)
scaled by the same factor a, namely that F ( f )= F ( t ) . By H=[l 0 01 c=[o 0 I]
inspecting the structure of the EKF Frequency Tracker (7) Tracker (1 3) is a significant simplification of (8); the vector
and that of the matrix F(t), it is easy to see that of the “tuneable” parameters of (13) is now constituted by a
F(f) = F ( t ) if z ( t / t ) = i ( t / t ) b’f . Moreover, K ( t ) = K ( t ) single parameter il .
implies that Z ( t l t ) = i ( t / t ) . This can be easily proven We conclude this section by presenting a numerical
since example, which qualitatively shows the influence of the
parameter h on the tracker behaviour.
i(t/t)=f(i(t-~/t-~))+K(t)(y(t)-Hf(i(t-~/t-~))).
Example 2.
From this expression, it is apparent that, if g ( t ) = K ( t ) and
- - The signal considered in this example is an harmonic signal
;(t - 1 / t - I ) = ;(t - 1/ t - 1) , then i ( t l t ) =i ( t / t ) .
Since embedded in white noise, characterised by a time-varying
the initial condition of the filter are chosen by the designer frequency. Specifically, y ( t ) = s ( t ) + n(t) , t=1,2, ... 1000,
at a value say X(0) , we have to take z ( 0 ) = i ( 0 ) = X(0) , where n ( t ) = WN(O,O.Ol) and s ( t ) = cos(:t) for
and then, by induction, we can conclude that i ( t ) = K ( t ) t=1,2 ...500, s ( t ) = c o s ( g t ) for r=501,502 ... 1000.
In order to estimate the frequency of the harmonic signal
implies % ( t / t ) = i ( t / t ) Vf . Thus, the following chain of
embedded in y ( t ) , the EKF Frequency Tracker (13), is
implications holds true:
-
i ( t ) =K(t)= i ( t l t ) = i ( f / t ) = F(t) = F ( t ) =3 F ( t ) =aP(t).
used. To assess the effect of h on the tracker behaviour,
three different values of h have been used: h=O, h=l, and
So far, we have to analyse the gain variation against the h=lO; the corresponding frequency estimation results are
scaling effect. To this end, recall that displayed in Fig.2.
From Fig.2 some useful indications on the tracker
K ( t ) = P(t)HT(HP(t)HT +,)-I . (1 1) behaviour can be drawn. In particular, as for every on-line
By plugging in (1 1) aP(t) in place of P(t), and ar in place frequency tracker (see e.g. [6], [12]), there is a trade-off
of r, after some manipulations we obtain: between the variance error of the estimated frequency and
the ability of the tracker to follow frequency variations (in
K ( t ) = P ( t ) H T(HP(t)H + r)-’ . (12) the case considered herein we have considered the most
The fact that (12) coincides with (1 1) means that demanding situation, given by a large and sudden jump of
F ( t ) =aP(t)3 K ( t ) = K(t). Therefore, the following set of the frequency to be tracked). Specifically:
circular implications holds: When h increases the variance error diminishes, as can
be seen by observing the decrement in the fluctuations
~ ( t ) = K ( t ) ~ ~ ( t l t ) = ~ ( t / t ) == .F~( t() t- )p ( t ) = a P ( t ) of the estimated frequency up to time 500; however,

2228
the ability of the tracker to follow rapidly varying of parameters tuning much easier and more transparent.
frequency changes deteriorates.
When h decreases the variance error grows, but the ACKNOWLEDGEMENTS
tracker is more robust towards frequency variations. Paper supported by CARIPLO Foiindation for Scientific
In particular notice from Fig.5 that if h=10 the frequency is Research. The authors are grateful to Professor R.R.
accurately estimated at steady-state, but the EKF gets Bitmead, for his enlightening hints and suggestions.
completely lost after the frequency jump. This problem can
be overcome using a lower value of h, at the price of a
REF E RENC E S
worse noise rejection.
Anderson B.D.0, Moore J.B (1979). Optimal
The correct choice of h clearly depends on the features of
Filtering. Prentice-Hall, Englewood Cliffs, NJ.
the measured signal: if the frequency of the harmonic signal
is constant or slowly-varying a large value of h should be Bittanti S., Campi M., Savaresi S.M. (1997).
used; on the other hand, if h is subject to large and sudden "Unbiased Estimation of a Sinusoid in Noise via
variations, a small value of h should be used, in order to Adapted Notch Filters". Automatica, Vo1.33, n.2,
guarantee robustness to the tracker. pp.209-2 15.
25
frequency Bittanti S., Laub A.J., Willems J.C. (eds.), The Riccati
2 m Equation. Springer-Verlag, 1991.
Handel P., Tichavsky P., Savaresi S.M. (1 998). "Large
error recovery for a class of frequency tracking
algorithms". International Journal on Adaptive Control
05

- 0 ' 3bO 4b0 Sbo


tl-
6k 7bo 6bo 9bo
I
1kO
and Signal Processing, Vol. 12, pp.417-436.
Hsu L., Ortega R., Damm G. (1999). "A Globally
frequency
Convergent Frequency Estimator". IEEE Trans. on
Automatic Control, Vo1.44, No.4, pp.698-713.
,.....
Kay S.M., Modern Spectral Estimation: Theory and
Applications. Prentice-Hall, 1988.
La Scala B., Bitmead R. (1996). "Design of an
05 Extended Kalman Filter Frequency Tracker". IEEE
-.L-. Trans. on Signal Processing, Vo1.44, n.3, pp.739-742.
treouenc"
La Scala B., Bitmead R., Quinn, B.G. (1996). "An
2 5 1 , I Extended Kalman Filter Frequency Tracker for High-
Noise Environments". IEEE Trans. on Signal
Processing, Vo1.44, n.2, pp.43 1-434.
1
La Scala B., Bitmead R., James M.R. (1995).
"Conditions for Stability of the Extended Kalman
05
Filter and Their Application to the Frequency Tracking
0
0 100 200 300 404
1"
500 6W 700 600 9W 1000 Problem 'I. Mathematics of Control, Signals and
Fig.2. Frequency tracking of the EKF using h=O, h=l, and Systems, Vo1.8, pp. 1-26.
h=10 (the dashed line indicates the true frequency). [IO] Quinn B.G, Femandes J.M. (1991). "A Fast Efficient
Technique for the Estimation of Frequency".
Biometrika, Vo1.78, pp.489-497.
4. CONCLUSIONS
[ 1 11 Pisarenko V.F. (1973). "The retrieval of harmonics
In this work the problem of estimating the frequency of an
from a covariance function". J.Roy.Astr., Vo1.33,
harmonic signal in noise, by means of an EKF Frequency
p.374-3 76.
Tracker, has been considered. The EKF Frequency Tracker
recently proposed in literature is characterised by a vector [12] Savaresi S.M. (1997). "Funnel Filters: a new class of
of three design parameters { 9 , r , ~ }In. this paper it is shown filters for frequency estimation of harmonic signals".
Automatica, Vo1.33, n.9, pp.1711-1718.
that, even in a noise-free setting, if E > O the EKF
Frequency Tracker (2) provides biased estimate of o , and [ 131 Song Y., Grizzle J.W. (1 995). "The Extended Kalman
that the performance of the EKF Frequency Tracker depend Filter as a Local Asymptotic Observer for Nonlinear
Discrete-Time Systems". Journal of Math. Systems,
on the ratio h = r / 9 only.
Estimation Control, Vo1.5, pp.59-78.
These results allow a simplification of the parameterisation
of the EKF Frequency Trackerand, and make the problem

2229

You might also like