0% found this document useful (0 votes)
185 views

Ge2019 - Numerical Implementation of High Order Vold-Kalman Filter Using Python Arbitrary-Precision Arithmetic Library

Uploaded by

henrique
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views

Ge2019 - Numerical Implementation of High Order Vold-Kalman Filter Using Python Arbitrary-Precision Arithmetic Library

Uploaded by

henrique
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Automotive Innovation

https://doi.org/10.1007/s42154-019-00065-1

Numerical Implementation of High‑Order Vold–Kalman Filter Using


Python Arbitrary‑Precision Arithmetic Library
Linhe Ge1 · Fangwu Ma1   · Jinzhu Shi1 · Hongbin Yin1 · Ying Zhao1

Received: 31 January 2019 / Accepted: 1 May 2019


© China Society of Automotive Engineers (China SAE) 2019

Abstract
The Vold–Kalman (VK) order tracking filter plays a vital role in the order analysis of noise in various fields. However, owing
to the limited accuracy of double-precision floating-point data type, the order of the filter cannot be too high. This problem
of accuracy makes it impossible for the filter to use a smaller bandwidth, meaning that the extracted order signal has greater
noise. In this paper, the Python mpmath arbitrary-precision floating-point arithmetic library is used to implement a high-order
VK filter. Based on this library, a filter with arbitrary bandwidth and arbitrary difference order can be implemented whenever
necessary. Using the proposed algorithm, a narrower transition band and a flatter passband can be obtained, a good filtering
effect can still be obtained when the sampling rate of the speed signal is far lower than that of the measured signal, and it
is possible to extract narrowband signals from signals with large bandwidth. Test cases adopted in this paper show that the
proposed algorithm has better filtering effect, better frequency selectivity, and stronger anti-interference ability compared
with double-precision data type algorithm.

Keywords  Noise order analysis · Vold–Kalman filter · Arbitrary-precision arithmetic library

1 Introduction author. Based on the conventional Kalman filter, the VK


filter was proposed by Vold and Leuridan in 1993 [2]. The
Order analysis is used in a variety of applications, from basic authors found that normal tracking filters (analog or digital
plant machinery testing to complex automotive engine test- implementations) have limited resolution in situations where
ing. It is often combined with acoustic measurements to ana- the reference RPM is rapid. Thus, the authors proposed the
lyze the noise, vibration, and harshness (NVH) qualities of application of nonstationary Kalman filters for the tracking
an engine or vehicle as a whole. Automotive engineers often of periodic components in such noise and vibration signals,
use order tracking methods for product evaluation and devel- namely, the VK filter. Vold then introduced the mathematical
opment, design validation, production testing, quality evalu- background of the VK filter [3]. This was the first presenta-
ation, and trouble shooting. The paper [1] reviewed some tion of the second-generation algorithm and its theoretical
basic ideas behind different kinds of order analysis methods foundations. This new algorithm enables the simultaneous
and compared their main advantages and limitations. estimation of multiple orders, effectively decoupling close
Particularly, the VK filter is a vital technique in order and crossing orders. In another paper published the same
analysis. The main framework of the filter have been basi- year [4], the authors explored the advantages of the filter
cally presented [2–4] and then on this basis, the algorithm in detail, including: (1) RPM estimation accuracy, even for
appears in almost all NVH-related commercial software fast-changing events such as gear shifts, (2) higher-order
presently on the market. Because of the importance of Kalman filters, with improved shapes for extracting modu-
these researches, the algorithm is also named after the main lated orders, and (3) decoupling of close and even crossing
orders by use of multiple RPM references. Vold et al. [5]
reported the development of a new VK filter for decoupling
* Fangwu Ma
[email protected] interacting orders in multi-axle systems. Based on the foun-
dation of the first- and second-generation VK filters, a num-
1
State Key Laboratory of Automotive Simulation and Control, ber of studies provided further understanding of the math-
Jilin University, 5988, Renmin Ave., Changchun 130025, ematical derivation of the filters, the physical meaning of
China

13
Vol.:(0123456789)
L. Ge et al.

their parameters, and the relationship between these param- 2 VK Filter Formulation
eters [6–11]. Herlufsen et al. [6] described the filter charac-
teristics of the VK order tracking filter, investigating both This section discusses the VK filter algorithm and its numer-
the frequency response and time response of their time–fre- ical implementation in detail. The numerical implementa-
quency relationship. Pelant et al. [7] derived the detailed tion of the algorithm is given in the form of pseudocode.
formulation of the filter, while Tuma [8] reported the band- Readers can use the Python programming language and its
width calculation formula for the 1st–4th order of the filter arbitrary-precision numerical operation library to realize this
and established the relationship between the bandwidth and algorithm, or contact the author to obtain the source code.
the weight coefficient. As an extension, the present paper The author will accept any requests with an open mind, and
presents a calculation formula for the filter bandwidth at later relevant source code will be released on GitHub.
arbitrary orders. Blough [9] explained the formulations and
behavior of the filter in very straightforward and practical 2.1 Analytical Solution of VK Filter
terms through the use of both equations and example data-
sets. Čala and Beneš [10] described the implementation of In this section, the analytical solution of the VK filter will be
both first- and second-generation VK order tracking filters, derived. Firstly, two basic equations, i.e., data equation and
with a focus on optimizing the calculations. It is worth men- structural equation, correspond to the measurement equation
tioning that Vold et al. [11] considered the bandwidth of the and state equation of the standard Kalman filter, respectively.
VK filter to be limited by the numerical conditioning of the Based on minimizing the weighted sum of squares of the
least-squares normal equations associated with its applica- error terms of the two equations, the analytic solution of the
tion. This suggests that even narrower bandwidths may be VK filter is obtained.
achieved by a direct least-squares solution using a banded The recorded signal y(t) is modeled as follows:
version of the QR algorithm. As a more general approach,
the present study adopts another method based on an arbi- y(n) = x(n) exp (j𝜃(n)) + 𝜂 (1)
trary-precision floating-point arithmetic library. Similar to where 𝜃(n) is the phase of an ideal signal, that is, the integral
∑n
the VK filter, the method of transforming the filter problem of the angular velocity, 𝜃(n) = 𝜔(i)Δt  , η represents the
into an optimization problem appears, although this has not i=0
noise item. The complex envelope x(n) represents the signal
yet become the mainstream approach. Amadou et al. [12]
amplitude and phase fluctuations. This equation is named
proposed another method that converges quickly and pro-
the data equation.
vides a small estimation error compared to those used for the
The matrix representation is
linear time-invariant model. An offline processing approach
using the preconditioned conjugate gradient method has also y − Cx = 𝜂 (2)
been proposed [13]. Pan et al. [14] further studied theoreti- and the square of the error vector norm is
cal basis, numerical implementation and parameter of VK
filter. It should be pointed out that VK filter is very useful in 𝜂 T 𝜂 = (y − Cx)T (y − Cx) (3)
many fields of sound analysis, even fault diagnosis [15, 16]. The structural equation can be described by the following
When the order of the VK filter is large, it has the advan- higher-order difference equation:
tages of a flat passband and a fast-changing transition band.
At the same time, smaller filter bandwidths can better isolate
Δnd x(n) = 𝜀(n) (4)
the influence of noise and other vibration signals. However, where Δ represents the difference computation symbol, nd
both cases result in larger matrix values, even beyond the is the order of the difference equation, and the value of 𝜀(n)
precise representation of double-precision data. None of the should be sufficiently small so that the complex envelope
research mentioned above can solve this problem effectively. x(n) changes very slowly. The difference equation is
This is the main problem considered in this paper—how to

r
obtain higher-order and narrower passband VK filters for an Δr f (x) = (−1)i Cri f (x + r − i) (5)
arbitrary desired order and bandwidth. i=0
To better understand how this problem is solved, there
sections are introduced as follows. Section 2 describes the To deduce the formula and programming conveniently,
relevant VK filter in detail and gives the pseudocode of the the coefficients of the difference equation are expressed as
related algorithm. Using an arbitrary-precision floating- dv . This is a vector of elements
point arithmetic library, the extension of this VK filter to
any higher orders is explained. Section 3 presents the results dv (i) = (−1)i Cni (i = 0, 1, 2 … nd ) (6)
d

from three test cases to verify the effectiveness of the algo-


Thus, the difference equation can be described as follows:
rithm. Finally, Sect. 4 gives the conclusions to this study.

13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…

( ) ( ) calculation process, it should be emphasized that a larger


dv (0)x(n) + dv (1)x(n − 1) + ⋯ + dv nd x n − nd = 𝜀(n)
weight coefficient always means a narrower bandwidth.
(7) Thus, larger weight coefficients are needed to achieve nar-
where i = 0, 1, … , nd . The matrix representation is rower bandwidths, even beyond the computational range of
� � double-precision floating-point numbers. Firstly, by exploit-
⎡ dv (0) dv (1) dv (2) … dv �nd � 0� � …0 ⎤ ing the structure of the analytical solution of the VK filter,
⎢0 dv (0) dv (1) … dv nd-1 d v nd …0 ⎥ the frequency response of the filter is obtained. The pseu-
⎢… … … … … … … � � ⎥⎥
=
⎢ docode for calculating the frequency response of the filter
⎣0 0 0 dv (0) dv (1) dv (2) … d v nd ⎦ is then given.
� � ( )
⎡ �𝜀 nd � ⎤ The dimension of matrix A is N − nd + 1 × N  , and its
⎢ 𝜀 nd + 1 ⎥ elements can be represented as follows:
⎢ ⎥ { ( )( )
⎢ ⋯ ⎥ ( ) dv ic − ir 0 ≤ ic − ir ≤ nd
⎣ 𝜀(N) ⎦ A ir , ic = (15)
(8) 0 other

According to the matrix multiplication formula:


which can be written as

N−nd

Ax = 𝜀 (9) AT A(i, j) = AT (i, k)A(k, j) (16)


( )
The dimension of A is N − nd + 1 × N . k=1

The optimization objective is to minimize Thus, according to (15), assuming that AT A(i, j) is
J = r 2 𝜀T 𝜀 + 𝜂 T 𝜂 (10) nonzero, the following relationship holds:
{
where r is the weight factor. We compute 0 ≤ i − k ≤ nd
0 ≤ j − k ≤ nd (17)
𝜕J ( )
= r2 AT A + E x − CH y = 0 (11)
𝜕x H
This transforms to
{
which can be expressed as i − nd ≤ k ≤ i
( 2 T ) j − nd ≤ k ≤ j (18)
r A A + E x = CH y (12)
( ) ( )
and so Let Su = min N − nd , i, j and Sd = max i − nd , j − nd , 1  .
According to (15)–(18), the following relationships can be
( )−1
x = r2 AT A + E CH y (13) obtained:

The above formula gives the analytical solution of the VK ⎧ ∑Su � �


filter for a single-order signal. For the purpose of conveni- ⎪ AT (i, k)A(k, j) Su ≥ Sd
(19)
T
A A(i, j) = ⎨ k=Sd
ence, define a new matrix ⎪0 other
( ) ⎩
B = r2 AT A + E (14)
When using regular data types, the limitations of the Further,
accuracy of double-precision floating data type mean that
the identity matrix E will be submerged in addition opera- ⎧ ∑Su � �
⎪ dv (i − k)dv (j − k) Su ≥ Sd
tions if the weight factor r is too large. In the following sec- T
A A(i, j) = ⎨ k=Sd (20)
tions, this issue will be discussed further and the relationship ⎪0 other

between r and the bandwidth of the filter in the steady state
will be considered.
If AT A(i, j) is nonzero, then Su ≥ Sd , that is, |i − j| ≤ nd ,
2.2 Frequency Response of VK Filter in Steady State which means each row of the matrix AT A has at most 2nd + 1
nonzero elements on the diagonal.
In this section, the basic principles of the VK filter are Let us exploit the structure of AT A and go a step fur-
described from the perspective of the frequency domain, ther. As AT A is symmetric, the case i ≥ j is first considered.
which contributes to a deeper understanding of the filter Assuming that i ≥ nd + 1 and j ≤ N − nd , then
and provides a reference for setting reasonable weight coef-
ficients in engineering practice. Before giving the exact

13
L. Ge et al.

( ) (
⎧ ∑ j � � y� ej𝜔 = bnd e−nd j𝜔 + bnd −1 e−(nd −1)j𝜔 + ⋯
⎪ dv (i − k)dv (j − k) �i − j� ≤ nd ) ( ) (29)
(21)
T
A A(i, j) = ⎨ k=i−nd +b0 + b1 ej𝜔 + ⋯ + bnd end j𝜔 x ej𝜔
⎪0 other

Through Euler’s formula, the following mathematical
In the same way, when i < j , assuming that j ≥ nd + 1 relations are obtained:
and i ≤ N − nd,
e−kj𝜔 + ekj𝜔 = cos (k𝜔) − j sin (k𝜔)
⎧ ∑ (30)
i � � + cos (k𝜔) + j sin (k𝜔) = 2 cos (k𝜔)
⎪ dv (i − k)dv (j − k) �i − j� ≤ nd
(22)
T
A A(i, j) = ⎨ k=j−nd
⎪0 other Substituting (30) into (29), the final frequency response
⎩ function of the filter is:
� �
From (21) and (22), it can be seen that the 2nd + 1 � � x ej𝜔 1
nonzero diagonal elements of each row of the matrix are H e j𝜔
= � �=
y� ej𝜔 ∑
nd (31)
the same, except for the first nd rows and the last nd rows of b0 + 2 bk cos (k𝜔)
the matrix. Because AT A is symmetric, B = (r2 AT A + E ) has k=1

the same structure as AT A . Abbreviate the diagonal elements


The pseudocode for calculating the frequency response
of each row and nd elements after the diagonal element of
of the VK filter in the steady state is given in Algorithm 1.
matrix B as the vector b. The elements of b can be calculated
as follows:

( ) ∑
nd −ib
( )
bib = r2 AT A i, i + ib = r2 dv (k)dv ib + k
k=0 (23)
(ib = 1, 2 … nd )

( )

nd

(24)
2
bib = r dv (k)dv (k) + 1(ib = 0)
k=0

As mentioned above, B has the same structure as AT A ,


which means B is a sparse symmetric matrix with 2nd + 1
nonzero diagonal elements. According to the following
relations:
( 2 T )
r A A + E x = CH y (25)

Bx = y� (26)
we have that


k+nd
y� (k) = B(k, m)x(m) (27)
m=k−nd

After performing a Z transformation, the following for-


mulas are obtained:
( In the following deduction process, both AT A and B play
y� (z) = bnd Z −nd + bnd −1 Z −(nd −1) + ⋯ + b0
(28) an important role, but because both matrices are N × N
)
+b1 Z 1 + … + bnd Z nd x(z) dimensional, the number of elements in these matrices
increases sharply with the signal dimension N, resulting in
Substituting z = ej𝜔 into the above, the frequency a dramatic increase in memory requirements. Thus, the ele-
response of the filter is obtained as ments of these two matrices are not all stored but are instead

13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…

calculated when they are needed. The method of calculating � � 1


AT A and B is given in Algorithm 2. H ej𝜔 =

nd
(35)
r2 ata[0] + 1 + 2r2 ata[k] cos (k𝜔)
k=1

The cutoff frequency satisfies the following relationship:


� �
�nd
� � √
(36)
2
r ata[0] + 2 ata[k] cos k𝜔c +1= 2
k=1

By specifying the bandwidth of the filter, the weight coef-


ficient can be calculated as
� √

� 2−1
r=� �
� ∑
n d � � (37)
ata[0] + 2 ata[k] cos k𝜔c
k=1

The above formula describes the relationship between the


weight coefficient and the bandwidth, and gives the physical
meaning of the weight coefficient. That is, the bandwidth of
the filter depends directly on the value of the weight coeffi-
cient. The larger the weight coefficient, the smaller the band-
width of the filter. This relationship is established when the
signal enters the steady state, but this does not mean that the
VK filter is only suitable for steady-state systems; in fact, it
is highly suitable for the unsteady state. When the bandwidth
is known, the weight coefficients are computed as described
in Algorithm 3.
2.3 Relationship Between the Filter Bandwidth
and the Weighting Coefficient

On the basis of the frequency response function derived


in the previous section, the relationship between the filter
bandwidth and the weighting coefficient r is now discussed.
Finally, an analytical solution for the weight coefficients
is obtained for a certain bandwidth. For convenience, a
new vector ata is introduced, which satisfies the following
relations:

[ ] ∑
nd −ib
( )
ata ib = dv (k)dv ib + k
k=0 (32)
(ib = 0, 1, 2 … nd )

Substituting this into (23) and (24) yields


[ ]
bib = r2 ata ib (ib = 1, 2 … nd ) (33)

b0 = r2 ata[0] + 1 (34)
Substituting this into (31) gives
Once the order and bandwidth of the filter have been
determined, the weight coefficient of the filter can be

13
L. Ge et al.

2.4 Maximum of Weight Coefficient

The results in the previous section indicate that higher-order


filters produce flatter passband bandwidths and faster tran-
sition band changes. The higher order also means that the
diagonal elements of AT A are larger. A smaller bandwidth
ensures better frequency selectivity and a greater weight
factor r. Both these factors increase the value of the diago-
nal elements of r2 AT A . If the diagonal elements of r2 AT A
are too large, the limitations of double-precision floating-
point accuracy imply that, when the diagonal elements of
r2 AT A are added to 1, the value 1 is ignored, and the solution
will fail. In this section, the minimum bandwidth, i.e., the
Fig. 1  Frequency response of VK filter under double-precision float- maximum weight coefficient, is derived under different filter
ing data type orders. Firstly, the double-precision data type is examined,
and then arbitrary-precision numbers are explored.
Firstly, the method of measuring the precision of arbi-
trary-precision floating-point numbers is introduced. There
are two terms involved, referred to as prec and dps. The
term prec denotes the binary precision (measured in bits),
whereas dps denotes the decimal precision. Binary and deci-
mal precisions are approximately related through the for-
mula prec = 3.33 × dps. For example, a precision of roughly
333 bits is required to hold an approximation of dps, that
is, accurate to 100 decimal places (actually, slightly more
than 333 bits are used). Double-precision floating-point
numbers, on most systems, correspond to 53 bits of pre-
cision. For double-precision floating-point numbers, the
maximum number that can be accurately represented is
253 = 9,007,199,254,740,992.
Fig. 2  Frequency response of VK filter under 50-decimal-place float- However, approaching this number should be avoided,
ing data type because the missing decimal part will affect the accuracy
of the result.
Assuming that a 10-bit binary number is reserved to
obtained. The frequency response function of the filter ensure the accuracy of the calculation, the maximum value
is then given by (35). As shown in Fig. 1, the frequency of the diagonal element of a matrix should be less than
response of the filter varies with the difference order. The 243 = 8,796,093,022,208.
higher the order, the better the flatness of the passband and The maximum element value of AT A is found on the
the narrower the transition band. In other words, filters with diagonal of the matrix. More accurately, it will be the first
high differential orders offer better frequency selection. Note element of the ata vector, that is, ata[0] . To ensure the accu-
that, when the difference order is 7, the response curve fluc- racy of the calculation results, the following equation should
tuates at the passband. For difference orders of 8 or more, be satisfied:
the filter cannot be designed at this bandwidth. Of course,
this phenomenon is the result using double-precision float- r2 ata[0] ≤ 243 (38)
ing-point numbers. The weight coefficients corresponding to different orders
As shown Fig. 2, there is no such problem for an algo- of difference are shown in Fig. 3.
rithm using arbitrary-precision floating-point numbers. The relation between the cutoff frequency and the
After using a high-precision floating-point number, the filter weight coefficient of the filter is given by (35). Using
passband response fluctuation at difference order 7 disap- this formula, the minimum bandwidth, corresponding to
pears, and filters with a differential order of 8 or more can the maximum weight coefficient, can be calculated. How-
be designed without fluctuation. ever, from the point of view of the equation, solving the

13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…

that the bandwidth is known. The minimum bandwidth


under the dps = 53 floating data type is shown in Fig. 4.
The following describes an extension to arbitrary-preci-
sion floating-point numbers, based on which the maximum
allowable weight coefficients under the corresponding accu-
racy can be calculated (or parameters with more practical
physical significance, i.e., the minimum bandwidth). Simi-
lar to double-precision data, two parameters are required,
dps , which again denotes the number of decimal places, and
dpsre , which denotes the number of reserved decimal places
needed to ensure the accuracy of the calculation. The maxi-
mum weight coefficient can be calculated by the following
formula:
Fig. 3  Maximum weight coefficients under double-precision floating r2 ata[0] ≤ 2dps−dpsre (39)
data type
2.5 Numerical Implementation of VK Filter

This section describes how a numerical method can be used


to solve the analytic solution of the filter. Although various
numerical methods have been developed to solve the above
equation, the relevant numerical algorithms should be dis-
cussed for two main reasons. The first, and most important,
reason is that an arbitrary-precision floating-point arithmetic
library is used to implement the filter. The second reason is
that full use should be made of the structural characteristics
of sparse matrices to accelerate the calculation. Thus, the
problem is not whether the problem can be solved, but how
to solve it efficiently and how to embed it into the arbitrary-
precision floating-point arithmetic library.
The filter solution can be obtained by solving the lin-
ear equation Bx = y� using Cholesky factorization. In this
Fig. 4  Minimum bandwidth under dps = 53 floating data type
method, the matrix is decomposed into the product of a
lower-triangular and an upper-triangular matrix, which can
weight coefficient is fairly straightforward, assuming that be expressed as B = LLT  . The Cholesky–Banachiewicz and
the bandwidth, namely, the cutoff frequency, is known. Cholesky–Crout algorithms can be expressed as follows:
However, the reverse process is quite complicated. Obvi- √
ously, it is necessary to solve nonlinear equations. The L1,1 = B1,1 (40)
analytical solution cannot be obtained but can only be
realized through some numerical algorithm. At the same
Li,1 = Bi,1 ∕L1,1 (41)
time, to realize an algorithm for an arbitrary difference
order and avoid the inaccuracy of double-precision float- √

1 √ √B − ∑ L 2
j−1
ing-point numbers, an algorithm for solving nonlinear (42)
Lj,j =
equations based on arbitrary-precision numbers will be Lj,j j,j
k=1
j,k

needed. For this purpose, intersection-based solvers such


as ‘anderson’ or ‘ridder’ are recommended. Usually, they √

converge quickly and are very reliable. These solvers are 1 √ ∑
j−1
√ (43)
especially suitable for cases where only one solution is Li,j =
Lj,j
Bi,j − Li,k Lj,k (i > j)
available and the interval of the solution is known, which k=1

is the case for determining the cutoff frequency, assuming


The lower-triangular matrix L has only nd + 1 nonzero
diagonal elements (this is proved below).

13
L. Ge et al.

Bi,j = 0 if |i − j| > nd (44)


For the first column of L,

Bi,1
Li,1 = = 0 if i − 1 > nd (45)
L1,1

For the second column of L


1 ( )
Li,2 = B − Li,1 L2,k = 0 if
L1,1 i,2
i − 2 > nd (46)

and so on. It can be inferred that


( )
1 ∑
m−1
Li,m = Bi,2 − Li,k Lm,k = 0 i − m > nd (47)
L1,1 k=1

From a rigorous point of view, mathematical induction


can be used to prove that the above equation holds. Through
the above method, it can be proved that L is a lower-trian-
gular matrix with nd + 1 nonzero diagonal elements. This
structural feature greatly reduces the computational com-
plexity of Cholesky factorization. Equations (40)–(43) can
be rewritten as follows:

L1,1 = B1,1 (48)

{ Bi,1
(i ≤ nd + 1)
Li,1 = L1,1 (49)
0 else



√ ∑
j−1
1 √
Lj,j = √Bj,j − 2
Lj,k (50)
Lj,j
k=max(1,j−nd )


⎧ � � ∑
j−1
⎪ 1 �Bi,j − Li,k Lj,k (0 < i − j ≤ nd )
Li,j = ⎨ Lj,j k=max(1,max(1,j−nd ))

⎩0 other
(51)
As L is diagonally sparse, the memory requirements can
be reduced by storing only the nonzero elements of L. This
matrix is called Ls . L is a N × N dimensional matrix, but Ls
is N × nd dimensional.

13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…

After LU factorization, the solution of the VK filter can amplitude and phase fluctuations. It does not represent the
be obtained by forward reduction and backward substitution: time-domain solution of the filter. In fact, the time-domain
solution of the filter can be calculated as follows:
Bx = LUx = LLT x = y� (52) (( ) )
Let xk = 2real xk exp (j𝜃(k)) (59)
where real represents the real part of the complex number.
LT x = z (53)
Equations (55)–(59) can be represented by the pseudocode
Then, in Algorithm 6.
Lz = y� (54)
Equations (53) and (54) can be solved using a row-by-
row method. Firstly, y′ is obtained; this is equal to CH y . The
pseudocode for this process is given in Algorithm 5.

The process of solving (52) is forward reduction using the


following equations:
z1 = y�1 ∕L1,1 (55)
� �

k−1
y�k − Lki zi
i=max(1,k−nd ) (56)
zk = k = 2, 3, … , N
Lk,k

The process of solving (53) is backward substitution


using the following equations:
xN = zN ∕LNN (57) 3 Validation of VK Filter Algorithm
min(∑
N,nd +k)
This section presents three test cases that verify the effec-
zk − Li,k xi
i=k (58) tiveness of the proposed algorithm. In the first test case,
xk = k = N − 1, … , 2, 1 the filter effectiveness is tested under different intensities of
Lk,k
background white noise by adding white noise to a sine wave
Ultimately, the filter solution is obtained. As mentioned signal. The second test case is similar to the first, but another
above, the complex envelope xk represents the signal sine wave signal with a different frequency is added. In the

13
L. Ge et al.

Fig. 6  Extracted single sine waveform with bandwidth of 2 Hz


Fig. 5  Single sine waveform signal with white noise

second test case, the two sine wave signals with different
frequencies are accurately extracted and the noise is isolated.
In the third case, actual measurement data are used. This is
a MATLAB example, and so the MATLAB algorithm is
compared with the algorithm presented in this paper.

3.1 Extraction of a Signal from Background White


Noise

In this section, the VK filter is used to extract a sine wave-


form signal from background white noise. The data for test-
ing the algorithm are shown in Fig. 5. The added noise obeys
a Gaussian probability distribution. Three sets of noise with
different expectations are added to the sine wave signal with
Fig. 7  Extracted single sine waveform with bandwidth of 0.8 Hz
an amplitude of 1 and frequency of 2 Hz. The expectations
of the noise signals are 0.5, 1, and 1.5, respectively. As can
be seen from Fig. 5, the greater the expected white noise, 3.2 Extraction of a Multi‑component Signal
the more violent the fluctuation is. Note that the sampling from Background White Noise
frequency of the signal is 800 Hz.
A 4th order VK filter with bandwidth of 2Hz is designed. In this section, two sine waveform signals of different fre-
Note that the arbitrary-precision arithmetic capability allows quencies are extracted from background white noise. The
an arbitrary bandwidth and order to be allocated. The filter- frequencies of these two signals are 2 Hz and 4 Hz, respec-
ing effect is shown in Fig. 6. More noise is introduced when tively, and both have an amplitude of 1. Similarly, the added
the bandwidth is 2 Hz, and the greater the noise, the greater noise obeys a Gaussian probability distribution and has an
the distortion of the result. expectation of 1.5. The signals with and without noise are
As a contrast, a 4th order VK filter with bandwidth of shown in Fig. 8. The signal without noise is obtained by
0.8 Hz is designed. As shown in Fig. 7, although the greater adding two sine wave signals. This signal, with added white
noise results in greater distortion of the waveform from a noise, yields the signal with noise.
microscopic point of view, from a macroscale point of view, A 4th order VK filter with bandwidth of 1 Hz is designed.
the filtering results almost coincide with the sine wave sig- As shown in Fig. 9, the amplitude and frequency of the two
nal. This shows that a narrower bandwidth can better isolate extracted signals are basically 2 Hz and 4 Hz, respectively, the
the influence of noise. Note that the design parameters of the same as the original signal. The two sine wave signals can be
filter are beyond the range of double-precision data. With extracted from the noise, and there is no interference between
the help of an arbitrary-precision arithmetic library, a nar- them. There is a slight fluctuation in the amplitude, and a
rowband signal can be extracted from the full signal with smaller bandwidth could be set to suppress this fluctuation.
high sampling frequency. This is the advantage of arbitrary- However, without using the algorithm based on arbitrary-pre-
precision floating-point arithmetic algorithms. cision floating-point arithmetic, this cannot be achieved, which

13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…

Fig. 10  Real helicopter vibration signal


Fig. 8  Two added sine waveform signals with white noise

Fig. 11  Extracted orders of 0.0520 and 0.0660 from the helicopter


vibration signal
Fig. 9  Two sine waveform signals extracted from white noise

example has four blades in both the main and the tail rotors.
demonstrates the advantages of the arbitrary-precision algo- Important components of vibration from a helicopter rotor
rithm. Obviously, test cases with more than two signals could may be found at integer multiples of the rotational frequency
be considered, but this would make the figure appear very clut- of the rotor when the vibration is generated by the rotor
tered. Two signals are sufficient to verify the feasibility of the blades. The signal in this test case is a time-dependent volt-
algorithm and are easier to understand and demonstrate. age, vib, sampled at a rate of 500 Hz. The data include the
angular speed of the turbine engine, and a vector t of time
3.3 Extraction from Real Measurement Signal instants. The ratios of rotor speed to engine speed for each
rotor are stored in the variables main Rotor Engine Ratio
The data processed in this section are derived from actual and tail Rotor Engine Ratio and have values of 0.0520 and
measurement signals, namely, vibration data from an accel- 0.0660, respectively. The signal is shown in Fig. 10.
erometer in the cabin of a helicopter during a run-up and A filter with a difference order of 4 and bandwidth of
coast-down of the main motor. The data are taken from the 1 Hz was designed. The orders to be extracted are 0.0520
MATLAB Signal Processing Toolbox. and 0.0660, which have the two largest amplitudes of all the
A helicopter has several rotating components, including orders. The filtering result is shown in Fig. 11. In contrast,
the engine, gearbox, and the main and tail rotors. Each com- Fig. 12 shows the filtering result of the 3rd order filter using
ponent rotates at a known, fixed rate with respect to the main the MATLAB algorithm. From these figures, it can be seen
motor, and each may contribute some unwanted vibrations. that the envelope fluctuation is obviously more violent than
The frequency of the dominant vibration components can be that given by the algorithm proposed in this paper. Because
related to the rotational speed of the motor to investigate the the graphs are also drawn in MATLAB, they are slightly
source of high-amplitude vibrations. The helicopter in this different from those given by the Python code.

13
L. Ge et al.

Order Waveforms for Peak Orders Conflict of interest  The authors declare that they have no conflict of
12
Order 0.052
interest.
10
Order 0.066

4
References
2
1. Brandt, A., Lagö, T.L., Ahlin, K., et al.: Main principles and limi-
Amplitude

0
tations of current order tracking methods. Sound Vib. 39, 19–22
-2
(2005)
-4
2. Vold, H., Leuridan, J.: High resolution order tracking at extreme
-6 slew rates, using Kalman tracking filters. SAE Paper Number
-8 931288 (1993)
-10 3. Vold, H., Mains, M., Blough, J.: Theoretical foundations for high
-12
performance order tracking with the Vold–Kalman tracking filter.
0 1 2 3 4 5 6 7 8 9 10 SAE Paper Number 972007 (1997)
Time (s) 4. Vold, H., Deel, J.: Vold–Kalman order tracking: new methods
for vehicle sound quality and drive train NVH applications. SAE
Fig. 12  Order signals extracted in MATLAB Paper Number 972033 (1997)
5. Vold, H., Mains, M., Corwin-Renner, D.: Multiple axle order
tracking with the Vold–Kalman tracking filter. Sound Vib. Mag.
31, 30–34 (1997)
4 Conclusions 6. Herlufsen, H., Gade, S., Konstantin-Hansen, H., et al.: Character-
istics of the Vold–Kalman order tracking filter. In: Proceedings
This paper has presented the relevant theoretical and numeri- of the IEEE International Conference on Acoustics, Speech and
cal implementations of a VK filter in detail. Using the pseu- Signal Process 6, 3895–3898 (2000)
7. Pelant, P., Tuma, J., Benes, T.: Vold–Kalman order tracking filtra-
docode given in this paper, the VK filter algorithm based on
tion in car noise and vibration measurements. In: Proceedings of
arbitrary-precision floating-point numbers can be easily real- Internoise, Prague (2004)
ized. The main body of this paper is Sect. 2, where the ana- 8. Tuma, J.: Setting the passband width in the Vold–Kalman order
lytical solution of an arbitrary-order VK filter was given and tracking filter. In: 12th International Congress on Sound and
Vibration, (ICSV12), Paper 719, Lisabon (2005)
the relationship between the filter bandwidth and the weight-
9. Blough, J.R.: Understanding the Kalman/Vold–Kalman order
ing coefficient r was obtained. The frequency response of tracking filters formulation and behavior. In: Proceedings of the
various difference orders was also derived. In this process, SAE Noise and Vibration Conference, SAE paper No. 2007-01-
the use of arbitrary-precision floating-point numbers suc- 2221 (2007)
10. Čala, M., Beneš, P.: Implementation of the Vold–Kalman order
cessfully avoids the problem of high-order filter passband
tracking filters for online analysis. In: 23rd International Congress
fluctuations. Finally, the proposed numerical method was on Sound and Vibration 2016 (ICSV 23) 1, 367–374 (2016)
used to determine the VK filter with reduced computational 11. Vold, H., Miller, B., Reinbrecht, C., et al.: The Vold–Kalman order
complexity by facilitating the use of arbitrary-precision tracking filter implementation and application. In: 2017 Interna-
tional Operational Modal Analysis Conference
algorithms.
12. Amadou, A., Julien, R., Edgard, S., et al.: A new approach to tune
Three test cases show that the proposed algorithm has bet- the Vold–Kalman estimator for order tracking. Ciba-Geigy A-G,
ter filtering effect, better frequency selectivity, and stronger Switz (2016)
anti-interference ability compared with double-precision 13. Feldbauer, C., Holdrich, R.: Realisation of a Vold–Kalman track-
ing filter—a least square problem. In: Proceedings of the COST
data type algorithm. The main contribution of this paper is
G-6 Conference on Digital Audio Effects (DAFX-000), Verona,
to overcome the problem whereby the bandwidth of the VK Italy (2000)
filter cannot be too narrow by using an arbitrary-precision 14. Pan, M.C., Chu, W.C., Le, D.D.: Adaptive angular-velocity
floating-point arithmetic library. Based on this library, a fil- Vold–Kalman filter order tracking–theoretical basis, numerical
implementation and parameter investigation. Mech. Syst. Signal.
ter with arbitrary bandwidth and arbitrary difference order
Process. 81, 148–161 (2016)
can be implemented whenever necessary. From the practical 15. Zhao, D., Li, J.Y., Cheng, W.D., et al.: Vold-Kalman generalized
application point of view, the numerical implementation of demodulation for multi-faults detection of gear and bearing under
the algorithm is also given in detail, so that according to the variable speeds. Procedia Manuf. 26, 1213–1220 (2018)
16. Feng, Z.P., Zhu, W.Y., Zhang, D.: Time-frequency demodulation
ideas and methods of this paper, using Python to implement
analysis via Vold-Kalman filter for wind turbine planetary gearbox
related algorithms is a brisk job. fault diagnosis under nonstationary speeds. Mech. Syst. Signal.
Process. 128, 93–109 (2019)
Acknowledgements  The paper is supported by the National Science
Foundation for Young Scientists of China, Intelligent collaboration
control of all-terrain vehicle via active attitude, and four-wheel steering
control systems (Grant No. 51705185).

13

You might also like