Ge2019 - Numerical Implementation of High Order Vold-Kalman Filter Using Python Arbitrary-Precision Arithmetic Library
Ge2019 - Numerical Implementation of High Order Vold-Kalman Filter Using Python Arbitrary-Precision Arithmetic Library
https://doi.org/10.1007/s42154-019-00065-1
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.
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
13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…
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:
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
( ) ∑
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
Bx = y� (26)
we have that
∑
k+nd
y� (k) = B(k, m)x(m) (27)
m=k−nd
13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…
[ ] ∑
nd −ib
( )
ata ib = dv (k)dv ib + k
k=0 (32)
(ib = 0, 1, 2 … nd )
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.
13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…
13
L. Ge et al.
Bi,1
Li,1 = = 0 if i − 1 > nd (45)
L1,1
{ 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.
13
L. Ge et al.
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.
13
Numerical Implementation of High-Order Vold–Kalman Filter Using Python Arbitrary-Precision…
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