A Realtime Quadratic Sliding Mode Filter for Removing Noise
Shanhai Jin, Ryo Kikuuwe and Motoji Yamamoto
Department of Mechanical Engineering, Kyushu University
Motooka 744, Nishi-ku, Fukuoka 819-0395, JAPAN
jin@ctrl.mech.kyushu-u.ac.jp and {kikuuwe, yama}@mech.kyushu-u.ac.jp

Abstract
This paper presents a sliding mode ﬁlter for removing noise. It eﬀectively removes impulsive
noise and high-frequency noise with producing smaller phase lag than linear ﬁlters. In addition, it
is less prone to overshoot than previous sliding mode ﬁlters and it does not produce chattering. It
is computationally inexpensive, and thus suitable for realtime applications. The proposed sliding
mode ﬁlter employs a quadratic surface as its sliding surface, which is designed so that the output
converges to the input in ﬁnite time when the input value is constant. Its algorithm is derived byusing the backward Euler discretization, which can be used to prevent chattering. The eﬀectivenessof the ﬁlter was shown by experiments by using an ultrasonic sensor and an optical encoder.

keywords: Quadratic Sliding Mode Filter, Finite Time Convergence, Backward Euler Discretization,
Chattering Avoidance, Overshoot Reduction

1

Introduction

In many robotics applications, sensor signals are corrupted by high-frequency noise. The use of a linear
ﬁlter is often the ﬁrst choice for removing such noise because of its simplicity, but it is also known
to have some drawbacks. One is that a linear ﬁlter proportionally transfers any noise component into
the output and thus it cannot remove high-amplitude impulses such as those considered as outliers.
Another drawback is that it produces a phase lag in the output and thus the original shape of the input
is distorted. These problems cannot be ignored in such cases where the noise has high amplitude (i.e.,
it is impulsive) and where the frequency range of the original signal is slightly below that of the noise
signal. For example, the distance measurement obtained through an ultrasonic sensor often contains
impulsive noise. As another example, the velocity signal obtained through the numerical diﬀerentiationof the position reading from an optical encoder is corrupted by high-frequency noise, while instantaneous
velocity information is demanded for injecting damping into a position-controlled mechatronic system.
Some classes of nonlinear ﬁlters have been studied in order to avoid drawbacks of linear ﬁlters. For
example, the median ﬁlter [1] is known to be useful for removing impulsive noise. It is, however, pointed1

out that its computational cost is high [2]. The peak-and-valley ﬁlter [3], which is also for removing
impulsive noise, is faster but less eﬀective than the median ﬁlter, as pointed out by [4]. An adaptive
windowing ﬁlter [5], as another example, is used for removing high-frequency noise caused by numericaldiﬀerentiation, but its window size should not be too large for preventing unacceptable computational
cost.
Some researchers study the use of sliding mode techniques for ﬁltering [6, 7, 8, 9, 10, 11, 12, 13, 14, 15].
One of the major problems raised in implementing sliding mode techniques is chattering, which is
high-frequency oscillation in the output value. In order to reduce chattering, some remedies such as
adaptive switching gain [6], boundary layer [7] and low-pass ﬁltering [8] are used. However, with these
remedies, the ﬁnite time convergence to the sliding mode cannot be realized in a strictly mathematicalsense and the parameters must be carefully chosen considering the trade-oﬀ between the chattering
attenuation and the convergence precision. It is known that sliding mode observers based on the supertwisting algorithm [9, 10, 11, 12, 13, 14, 15] realize ﬁnite time convergence in continuous-time analysis.
However, the accuracy of convergence in discrete-time implementation, typically with the forward Euler
discretization [13, 14, 15], depends on the sampling interval, as pointed out in [9]. In addition, they areprone to overshoot during the convergence.
The use of a quadratic sliding surface has also been studied in the ﬁeld of ﬁltering [16, 17, 18]. One
of its advantages is that, by using it, the output converges to the input in ﬁnite time when the input
is constant. In particular, Emaru and Tsuchiya [17, 18] named their quadratic sliding mode ﬁlter as
ESDS1 and they used it for removing impulsive noise. A problem of their ﬁlter is that it is prone toovershoot. Another problem is that the numerical error caused by their discrete-time implementation[19] produces chattering, as will be demonstrated in Section 2.2.
This paper presents a sliding mode ﬁlter that employs a quadratic surface as its sliding surface.
The proposed ﬁlter eﬀectively removes impulsive noise and high-frequency noise with producing smaller
phase lag than linear ﬁlters. In addition, it is less prone to overshoot than previous sliding mode ﬁlters.
Its algorithm is derived by using the backward Euler discretization, which can be used to prevent
chattering. This algorithm is computationally inexpensive, and thus suitable for realtime applications.
The rest of this paper is organized as follows. Section 2 discusses previous work on quadratic sliding
mode ﬁlters and clariﬁes their problems. Section 3 presents a new quadratic sliding mode ﬁlter, which
performs better than previous methods. In section 4, experimental results are shown to demonstrate
the advantages of the proposed ﬁlter, and in section 5, conclusions are drawn.
1 According to Emaru and Tsuchiya [17, 18], the full form of ESDS is “the system which estimate the smoothed value

and the diﬀerential value by using sliding mode system”.

22

Quadratic sliding mode filters

2.1

Continuous-time expression of quadratic sliding mode filters

Let us consider the system described in the following expression:
ẋ1

= x2

(1a)

ẋ2

= −F sgn(σ)(1b)σ , 2F (x1 − u) + |x2 |x2 .

(2)

where

Here, u ∈ R is an input, x1 ∈ R and x2 ∈ R are the system states, F > 0 is a constant, and sgn is the
signum function deﬁned as follows:
1
if z > 0sgn(z) , [−1, 1] if z = 0





−1
if z < 0.

(3)Here, note that the return value of the sgn function is a set of values instead of a single value. Therefore,
strictly speaking, “=” in (1b) should be replaced by “∈”, but “=” is used throughout this paper fornotational simplicity. Equation (1b) should be interpreted to be equivalent to the following logicalexpression:(ẋ2 = −F sgn(σ) ∧ σ ̸= 0) ∨ (ẋ2 ∈ [−F, F ] ∧ σ = 0).

(4)

The system (1) can act as a ﬁlter with the input u and the output x1 . Han and Wang [16] used
this ﬁlter for removing white noise contained in u, and Emaru and Tsuchiya [17, 18] used it to remove
impulsive noise contained in u. The sliding surface of the ﬁlter (1) is a quadratic surface, which is theset of states (x1 , x2 ) that satisfy the quadratic equation 2F (x1 − u) + |x2 |x2 = 0, as illustrated by thesolid curve in Fig. 1.
In the ﬁlter (1), when σ ̸= 0, according to (1b), ẋ2 satisﬁesẋ2 = −F sgn(σ).

(5)

In this period, the state (x1 , x2 ) moves along quadratic curves in the state space, as illustrated by dashedcurves in Fig. 1. On the other hand, when σ = 0, i.e.,
2F (x1 − u) + |x2 |x2 = 0(6)

is satisﬁed, the state (x1 , x2 ) moves along the quadratic curve in the state space, as illustrated by thesolid curve in Fig. 1.
In particular, when u̇ = 0 and σ = 0, diﬀerentiating the both sides of (6) yields
ẋ2 = −F sgn(x2 ).
3

(7)

x2
Sliding surface

x1(u , 0)Sliding surface

σ =0
Figure 1: Quadratic sliding surface (solid curve) and trajectories of the state (x1 , x2 ) for σ ̸= 0 (dashedcurves) in the ﬁlter (1).

u, x1Input u

R

}
}

R
2

0

x2

Output x1

Sliding surface
Analytical solution

Sliding mode

Reaching mode

2 R/F

Reaching mode

Sliding mode

t

R

x1

R/F

(b) x1 - x2 space.

(a) Time domain.

Figure 2: Analytical solution of (1) with a step change in u.

Therefore, when u̇ = 0, ẋ2 takes the value of either −F or F , according to (5) and (7). Such a behaviorof the system (1) is similar to that of a system under bang-bang control [20, Chapter 5], which drives
the state (x1 , x2 ) from arbitrary initial states to the target state (u, 0) in the minimum time under theconstraint |ẋ2 | ≤ F . Fig. 2 shows the analytical solution of (1) with a step change in u of which initialstate is (0, 0). In Fig. 2(b), we can observe that the trajectory of the state is symmetric in the x1 -x2
space. For the former half, the ﬁlter (1) is in reaching mode, and the latter half, it is in sliding mode.
This symmetry is due to the fact that the output x1 reaches the half-amplitude of the input u withẋ2 = F from its initial value, and then it reaches the input u with ẋ2 = −F , as shown in Fig. 2(a).
A problem of the ﬁlter (1) is that it is prone to overshoot. Fig. 3 shows the analytical solution of(1) with a step change in u that is temporarily corrupted by a disturbance. As the solid curve shown in
Fig. 3(b), the state (x1 , x2 ) deviates from the sliding surface σ = 0∧x2 > 0 into the region σ > 0∧x2 > 0
by the inﬂuence of the disturbance. After the disturbance disappears, the deviated state moves parallelto the sliding surface. This is because, in the region σ > 0 ∧ x2 > 0, ẋ2 takes the same value as thatis taken on the sliding surface σ = 0 ∧ x2 > 0 (i.e., ẋ2 = −F ). Thus, the state returns to the sliding
surface after an overshoot, i.e., after crossing the line x1 = u. As a whole, if the state is in the region4

u, x1

x2

Input uOutput x1

x1 = uDisturbance

R

0

x1

Sliding surface
Analytical solution of (1)

t

0

R

(b) x1 - x2 space.

(a) Time domain.

Figure 3: Analytical solution of (1) with a step change in u that is temporarily corrupted by a disturbance (F = 200).

σx2 > 0, it does not reach the sliding surface before crossing the line x1 = u.

2.2

Discrete-time algorithm of quadratic sliding mode filters

According to Emaru et al. [19], they originally implemented the ﬁlter (1) by using 4th-order Runge-Kutta
method as the discrete-time integrator. To make the computation fast, they further proposed anotherintegration method, which they call “fast calculating method (FCM)” [19]. As to the authors’ knowledge,
these two are only explicitly-reported discrete-time algorithms of the ﬁlter (1) in the literature. A
problem of FCM is that the state (x1 , x2 ) cannot exactly reach the sliding surface σ = 0 due to numericalerrors, and thus there occurs chattering. Fig. 4 shows the numerical solution of (1) with a step change
in u obtained by FCM. We can observe that the state (x1 , x2 ) slightly crosses the sliding surface andthus there occurs small overshoot, as shown by the dashed curves in Fig. 4(c) and Fig. 4(d). Because
the state (x1 , x2 ) never exactly reaches the sliding surface, chattering continues around x1 = u as shownin Fig. 4(e) and Fig. 4(f).

3Proposed Filter

3.1

Motivation for the proposed filter

The motivation for proposing a new ﬁlter comes from the observation that there are two sources of
the ﬁlter (1)’s tendency to overshoot. One is that the value of ẋ2 in the region σx2 > 0 does notforce the state (x1 , x2 ) to reach the sliding surface before crossing the line x1 = u. The second one isthat numerical error and chattering are caused by improper discretization. Toward these problems, ourcontribution is twofold. First, we propose a modiﬁcation of (1) to attract the state (x1 , x2 ) toward thesliding surface even when σx2 > 0. Second, we present a discrete-time algorithm for integrating themodiﬁed version of (1) by using the backward Euler discretization, which can be used to realize exact
reaching to the sliding surface.

5

u, x1

Input uOutput x1 : analytical solution
Output x1 : numerical solution (FCM)

120

x2

x1 = u

150

100
80

100
100.5

60
40

Sliding surface
Analytical solution
Numerical solution (FCM)

50

100.0
99.5
99.0

20

20
2.30

0.0

0.5

1.0

1.5

2.35

2.0

2.5

2.40

2.45

3.0

40

60

80

x1

100

2.50

-50

t

(b) x1 - x2 space.

(a) Time domain.

x2

x2

144

Sliding surface
Analytical solution
Numerical solution (FCM)

30

142

x1 = u

20

140
138

10

136

Sliding surface
Analytical solution
Numerical solution (FCM)

134
132
46

48

50

52

0

54

x1

x2

100.0

100.5

101.0

x1

-10

(c) Enlarged view of (b).

(d) Enlarged view of (b).

u, x1

Sliding surface
Analytical solution
Numerical solution (FCM)

2

99.5

100.002100.000

0

99.99299.996100

100.004x1

99.99899.996x1 = u-2

Input uOutput x1 : analytical solution
Output x1 : numerical solution (FCM)
2.6(e) Enlarged view of (d).

2.8

3

t

(f) Enlarged view of (a).

Figure 4: Numerical solution of (1) with a step change in u obtained by FCM (F = 200, T = 0.001 s).

3.2

Continuous-time expression of the proposed filter

In order to force the state to be attracted by the sliding surface even when σx2 > 0, let us consider thefollowing modiﬁcation of (1):
ẋ1
ẋ2

= x2


−αF sgn(σ) if σx2 > 0=−F sgn(σ)
if σx2 < 0

(8a)
(8b)

where α > 1 is a constant andσ , 2F (x1 − u) + |x2 |x2 .

6(9)

gsgn( A, z , B)max( A ∪ B )B
A
0min( A ∪ B)z

Figure 5: Behavior of gsgn(A, z, B).

In the ﬁlter (8), the value of |ẋ2 | in the case of σx2 > 0 is modiﬁed from F to αF . Because of this
modiﬁcation, in the region σx2 > 0, the state moves toward the sliding surface instead of moving
parallel to it. The idea of changing the gain according to diﬀerent conditions can also be found in theliterature (e.g., [21, 22]).
A ﬂaw of the expression (8) is that it does not deﬁne the value of ẋ2 when σx2 = 0. A more strict
expression of (8) can be written as follows:
ẋ1

= x2

(10a)

ẋ2

= −F gsgn(gsgn(−α, x2 , −1), σ, gsgn(1, x2 , α))

(10b)

where
σ , 2F (x1 − u) + |x2 |x2 .
Here, gsgn is the generalized signum function deﬁned as follows:B
if z > 0
gsgn(A, z, B) , [min(A ∪ B), max(A ∪ B)] if z = 0




A
if z < 0

(11)

(12)

where A ⊂ R and B ⊂ R are closed intervals (which can be scalars as a special case) and z ∈ R. This
generalized signum function (12) is a set-valued function as sgn in (3) is. Fig. 5 illustrates the behaviorof gsgn(A, z, B). It is worth noting that, when z = 0, (12) return the union of A, B, and all values in
between. In addition, (12) reduces to (3) when A = [−1, −1] and B = [1, 1].
Fig. 6 shows the quadratic sliding surface (solid curve) and trajectories of the state (x1 , x2 ) forσ ̸= 0 (dashed curves) in the ﬁlter (10), and Fig. 7 shows the relation among x1 , x2 and ẋ2 . Whenσx2 ̸= 0, (10) is equivalent to (8), and ẋ2 takes a single value (−αF , −F , F or αF ), as shown by thehorizontal surfaces in Fig. 7. When σx2 = 0, on the other hand, ẋ2 takes a value between the values ofẋ2 in adjoining regions, as shown by the vertical surfaces in Fig. 7. It is clear that (10) reduces to (1) inthe case of α = 1 considering the properties of gsgn such as gsgn(−1, x2 , −1) = −1, gsgn(1, x2 , 1) = 1,
and gsgn(−1, σ, 1) = sgn(σ).
7x2

Sliding surface

x1(u , 0)Sliding surface

σ =0

Figure 6: Quadratic sliding surface (solid curve) and trajectories of the state (x1 , x2 ) for σ ̸= 0 (dashedcurves) in the ﬁlter (10).

Fig. 8 shows analytical solutions of the ﬁlters (10) and (1) under step-like disturbances. These results
can be obtained by using simple algebra considering the fact that every solution trajectory of (10) and(1) is a sequence of parabola arcs in the state space. First, Fig. 8(a) and Fig. 8(b) show the case wherea rightward sliding motion is disturbed by a positive pulse-like disturbance. The state deviates from thesliding surface due to the disturbance, and after the disturbance, it converges to the sliding surface again
in the new ﬁlter (10) but does not in the conventional ﬁlter (1). In both ﬁlters, the deviation is caused by
the attraction toward a temporarily displaced sliding surface with a constant acceleration ẍ1 = ẋ2 = F .
Therefore, the magnitude of the deviation increases as the disturbance magnitude increases, but only
up to a particular level that is determined by the duration of the disturbance.
Second, Fig. 8(c) and Fig. 8(d) show another set of solutions in cases where negative disturbances
are applied during a rightward sliding motion. The new ﬁlter (10) is inﬂuenced by the disturbance,
exhibiting slower convergence, while the conventional ﬁlter (1) is not. This is because a large α value
can result in a stronger attraction (i.e., a larger |ẍ1 |) to the displaced sliding surface, which would beundesirable in some cases. This implies that an appropriate guideline should be sought for the choiceof α considering this eﬀect.
Third, Fig. 8(e) and Fig. 8(f) show the eﬀect of disturbances in the steady state. It is shown thatthe new ﬁlter (10) produces a faster resuming than the conventional ﬁlter (1). After the disturbancedisappears, the x2 value of the ﬁlter (10) changes toward x2 = 0 faster than that of the ﬁlter (1) becauseof α > 1.

3.3

Discrete-time algorithm of the proposed filter

We derive the discrete-time algorithm for integrating (10) by using the backward Euler discretization,
which can be used to realize exact reaching to the sliding surface.

8

x& 2

αF
F

−F
− αF

x1

x2
Figure 7: Relation among x1 , x2 and ẋ2 .
Based on the backward Euler discretization, (10) can be approximated as follows:
x1 (k) − x1 (k − 1)T
x2 (k) − x2 (k − 1)Tσ(k)= x2 (k)(13a)= −F gsgn(gsgn(−α, x2 (k), −1), σ(k), gsgn(1, x2 (k), α))

(13b)

=

2F (x1 (k) − u(k)) + |x2 (k)|x2 (k)(13c)

where k denotes the discrete time index. By using (13a), we can remove x1 (k) as follows:x2 (k) − x2 (k − 1)Tσ(k)= −F gsgn(gsgn(−α, x2 (k), −1), σ(k), gsgn(1, x2 (k), α))(14a)= |x2 (k)|x2 (k) + 2F T x2 (k) + 2F (x1 (k − 1) − u(k)).

(14b)

This can be seen as a set of simultaneous equations that determines x2 (k) by using u(k), x1 (k − 1) andx2 (k − 1).
Now, the solution of (14) with respect to x2 (k) is derived. First, we can simplify (14) as follows:x2 (k) − x2 (k − 1)
= −F gsgn(gsgn(−α, x2 (k), −1), x2 (k) − x∗2 (k), gsgn(1, x2 (k), α))Twherex∗2 (k) = sgn(x1 (k − 1) − u(k))(F T −√F 2 T 2 + 2F |x1 (k − 1) − u(k)|).

(15)

(16)

Here, x∗2 (k) is the value of x2 (k) that satisﬁes σ(k) = 0. Equation (15) is equivalent to (14) because
σ(k) is a monotonously increasing function with respect to x2 (k).
Furthermore, (15) can be rewritten as follows:−(x2 (k) − x2 (k − 1)) = gsgn(gsgn(−αT F, x2 (k), −T F ), x2 (k) − x∗2 (k), gsgn(T F, x2 (k), αT F )). (17)By applying the proposition that is shown in the appendix, x2 (k) can be moved out from the right-handside of (17) as follows:−(x2 (k)−x2 (k−1)) = gsat(gsat(−αT F, x2 (k−1), −T F ), x2 (k−1)−x∗2 (k), gsat(T F, x2 (k−1), αT F )).
(18)

9

x2

u , x1Da

Disturbances

Db
Dc

t

0

0

Input 1: u with disturbance of magnitude Da
Input 2: u with disturbance of magnitude Db
Input 3: u with disturbance of magnitude Dc
Outputs x1 of (10) with inputs 1 and 2 (overlapping)
Output x1 of (10) with input 3
Outputs x1 of (1) with inputs 1 and 2 (overlapping)
Output x1 of (1) with input 3

Db Da

x1

Sliding surface
Displaced sliding surfaces
Solutions of (10) with inputs 1 and 2 (overlapping)
Solution of (10) with input 3
Solutions of (1) with inputs 1 and 2 (overlapping)
Solution of (1) with input 3(b) Positive disturbances in the sliding motion(x1 - x2 space).

(a) Positive disturbances in the sliding motion(time domain).

u , x1

x2
t

0
-Dc

Dc

Disturbances-Db-Da -Db

-Dc 0

x1

-Da
Input 1: u with disturbance of magnitude Da
Input 2: u with disturbance of magnitude Db
Input 3: u with disturbance of magnitude Dc
Outputs x1 of (10) with inputs 1 and 2 (overlapping)
Outputs x1 of (10) with input 3
Outputs x1 of (1) with inputs 1, 2 and 3 (overlapping)

Sliding surface
Displaced sliding surfaces
Solutions of (10) with inputs 1 and 2 (overlapping)
Solution of (10) with input 3
Solutions of (1) with inputs 1, 2 and 3 (overlapping)(c) Negative disturbances in the sliding motion(time domain).

(d) Negative disturbances in the sliding motion(x1 - x2 space).

u , x1

Dd

x2

Input 1: u with disturbance of magnitude Dd
Input 2: u with disturbance of magnitude De

Disturbances

De

0

x1

Outputs x1 of (10) with inputs 1 and 2 (overlapping)
Outputs x1 of (1) with inputs 1and 2 (overlapping)0

Sliding surface
Solutions of (10) with inputs 1 and 2 (overlapping)
Solutions of (1) with inputs 1 and 2 (overlapping)t(f) Disturbances in the steady state (x1 - x2 space).

(e) Disturbances in the steady state (time domain).

Figure 8: Analytical solutions of (10) and (1) with constant inputs temporarily corrupted by pulse-likedisturbances (F = 200, α = 4).

Here, gsat is a generalized saturation function [23] deﬁned as follows:
b if z > bgsat(a, z, b) , z if z ∈ [a, b]a if z < a
10

(19)

x2 (k ) − x2 (k − 1)x2 (k ) − x2 (k − 1)x2 (k − 1)x2 (k ) − x2* (k − 1)

x1 (k − 1)x2 (k − 1)
(a)

(b)

Figure 9: (a) Relation among x2 (k − 1) − x∗2 (k), x2 (k − 1) and x2 (k) − x2 (k − 1); (b) Relation amongx1 (k − 1), x2 (k − 1) and x2 (k) − x2 (k − 1).

where a ≤ b. Fig. 9(a) shows the relation among x2 (k − 1) − x∗2 (k), x2 (k − 1) and x2 (k) − x2 (k − 1),
and Fig. 9(b) shows the relation among x1 (k − 1), x2 (k − 1) and x2 (k) − x2 (k − 1). Then, we can obtainx2 (k) from (18) as follows:x2 (k) = x2 (k − 1) − gsat(gsat(−αT F, x2 (k − 1), −T F ), x2 (k − 1) − x∗2 (k), gsat(T F, x2 (k − 1), αT F )).
(20)
In conclusion, the complete discrete-time algorithm of the proposed ﬁlter is as follows:√
F 2 T 2 + 2F |x1 (k − 1) − u(k)|)

x∗2 (k):=x2 (k):= x2 (k − 1) − gsat(gsat(−αT F, x2 (k − 1), −T F ), x2 (k − 1) − x∗2 (k),sgn(x1 (k − 1) − u(k))(F T −gsat(T F, x2 (k − 1), αT F ))x1 (k)

(21a)

(21b)

:= T x2 (k) + x1 (k − 1).

(21c)Fig. 10 shows the numerical solution of (10) with a step change in u obtained by algorithm (21). Notethat the state exactly reaches the sliding surface and the target state (u, 0). It is also worth noting that
there is no chattering in sliding mode. This kind of ways of avoiding chattering by using the backward
Euler discretization is also reported in [23, 24, 25].
In addition, by setting α = 1, (21) reduces to the following:√
F 2 T 2 + 2F |x1 (k − 1) − u(k)|)

x∗2 (k):=x2 (k):= x2 (k − 1) − gsat(−T F, x2 (k − 1) − x∗2 (k), T F )(22b)

x1 (k):= T x2 (k) + x1 (k − 1).

(22c)sgn(x1 (k − 1) − u(k))(F T −(22a)This algorithm can be viewed as another discrete-time algorithm of ESDS (1). In Section 4, thisalgorithm will be compared with (21) to demonstrate the advantage of using α > 1, and it also will becompared with FCM to demonstrate the advantage of backward Euler discretization.
Fig. 11 demonstrates the tracking performances of the proposed ﬁlter (21), the second-order Butterworth low-pass ﬁlter (BWF), and ESDS implemented with the backward Euler method (ESDS-BE),11

u, x1120
100

Input uOutput x1 : analytical solution
Output x1 : numerical solution(proposed algorithm)

x2
x1 = u

150

80

100

60

100.5

40

Sliding surface
Analytical solution
Numerical solution(proposed algorithm)

50

100.0
99.5
99.0

20

2.30

0.0

0.5

1.0

1.5

2.35

2.0

2.40

2.45

2.5

20

2.50

t

3.0

40

60

80

x1

100

-50

(b) x1 - x2 space.

(a) Time domain.

x2

x2

144

30

Input uOutput x1 : analytical solution
Output x1 : numerical solution(proposed algorithm)

20

x1 = u

142
140
138
136
134
132
130
46

10

Input uOutput x1 : analytical solution
Output x1 : numerical solution(proposed algorithm)
48

50

0

99.5

100.0

100.5

x
54 1

52

101.0

x1

-10

(c) Enlarged view of (b).

(d) Enlarged view of (b).

Figure 10: Numerical solution of (10) with a step change in u (F = 200, α = 4, T = 0.001 s).

Input, Output

1.0
0.5
0.0

3.2

3.4

3.6

3.8

4.0 t

Input
Proposed: F=200, α=4
ESDS-BE: F=200
BWF-Cutoff freq.: 4.1Hz

-0.5
-1.0

Figure 11: Tracking performances of the proposed ﬁlter (21), BWF and ESDS-BE (T = 0.001 s).

i.e., algorithm (22). Here, the input u is a sinusoidal signal starting from u = 0 at t = 0 s, and the initialstates of all ﬁlters are zeros at t = 0 s. Fig. 11 only shows the data after t = 3 s, where the outputs
are in the steady state. It is observed that, ESDS-BE produces the largest phase lag among the threeﬁlters, and BWF produces larger phase lag than the propose ﬁlter.

4

Experiments

The proposed ﬁlter (21) was experimentally tested by using data from an ultrasonic sensor and an opticalencoder. The output of the proposed ﬁlter was compared with those of the second-order Butterworth
low-pass ﬁlter (BWF), ESDS implemented with FCM (ESDS-FCM), and ESDS implemented with the12Manipulator

UltrasonicsensorMove

Joint 6(a) Experiment by using an ultrasonic sensor.

(b) Experiment by using an optical encoder.

Figure 12: Experimental setups.

backward Euler method (ESDS-BE), i.e., algorithm (22).
In both experiments, α and F of the proposed ﬁlter were chosen to make the output as smooth as
possible while restricting the phase lag in an acceptable range. In BWF, its cutoﬀ frequency was chosen
to make its output as close as possible to that of the proposed ﬁlter. The parameter F of ESDS-FCM
and ESDS-BE was chosen equal to that of the proposed ﬁlter.

4.1

Ultrasonic sensor

In the ﬁrst set of experiments, an ultrasonic sensor system (transmitter: PT40-18, receiver: PR40-18,
Nippon Ceramic Co., Ltd.) was ﬁxed on a desk, and the distance between the sensor and the arc-shapedback of a chair was measured as shown in Fig. 12(a).
First, the chair was in its initial position, and then it was moved toward the desk slowly. This motion
was performed twice with two diﬀerent conﬁgurations of the sensor system. Speciﬁcally, the system was
conﬁgured so that, when no reﬂection was detected within the sampling period T = 0.01 s, it recorded
the minimum value (0 cm) for the ﬁrst motion, or the maximum value (80 cm) for the second motion.
These minimum and maximum values are the sources of impulsive noise in this experiment.
Fig. 13(a) shows the data obtained from the ﬁrst motion, which is corrupted by negative impulsive
noise, and Fig. 14(a) shows the data obtained from the second motion, which is corrupted by positive
impulsive noise. Fig. 13(b) - Fig. 13(e) and Fig. 14(b) - Fig. 14(e) show the ﬁltered outputs of the four
ﬁlters for the data obtained from the ﬁrst and second motions, respectively. In each ﬁgure, the graphs(b) to (d) are for comparing the proposed ﬁlter to conventional ﬁlters, and the graph (e) is for exhibiting
the eﬀect of backward Euler discretization.
The ﬁgures show that, in the steady state, BWF produced the most oscillatory result among the four
ﬁlters, ESDS-FCM and ESDS-BE were less oscillatory, and the proposed ﬁlter was the least oscillatory.
It can also be seen that, in the transient period, overshoots were suppressed by using the proposed ﬁlter.
The advantage of using α > 1 instead of using α = 1 can be observed in Fig. 13(d) and Fig. 14(d), in
which the proposed ﬁlter produces smaller overshoots and oscillation. Fig. 13(e) and Fig. 14(e) showthat backward Euler method produced slightly smaller overshoots than FCM.
In the transient period (t = 0 s to 5 s) of Fig 13, it can be seen that the proposed ﬁlter exhibited13

Distance [cm]

80
60
40
20
0

10

20
Time [s]

30

40

80

80

60

60

Distance [cm]Distance [cm](a) Input signal (negative impulsive noise).

40
20
0

Proposed: F=100, α=5
BWF-Cutoff freq.: 0.5Hz

1020Time [s]

30

40
20
0

40

(b) BWF vs proposed filter.

Distance [cm]Distance [cm]20Time [s]

80

60
40

0

10

Proposed: F=100, α=5ESDS-BE: F=1001020Time [s]3040(c) ESDS-FCM vs proposed filter.

80

20

Proposed: F=100, α=5ESDS-FCM: F=100

ESDS-FCM: F=100
ESDS-BE : F=100

60
40

65
60

20

55
50
45
1.5

30

0

40

2.0

2.5

10

3.0

3.5

4.0

20
Time [s]3040(e) ESDS-FCM vs ESDS-BE.

(d) ESDS-BE vs proposed filter.

Figure 13: Experiment by using an ultrasonic sensor (T = 0.01 s): the ﬁrst motion.

slower convergence to the correct value (about 56 cm) than the ESDS ﬁlters did. This is because theoutput x1 was attracted to the corrupted value (u = 0 cm) with ẍ1 = −αF < −F < 0 in the case of
the proposed ﬁlter while it was with ẍ1 = −F in the case of the ESDS ﬁlters. A similar behavior canbe observed in the early period of Fig 14, in which the output of the proposed ﬁlter stayed stationary
between the corrected and corrupted values while those of ESDS ﬁlters exhibited overshoots. Thus, it
should be noted that the proposed ﬁlter produces a biased output or slow convergence when the input
contains dense impulsive noise, although it is still advantageous over ESDS ﬁlters in that it is less prone
to overshoot and oscillation.

4.2

Optical Encoder

In the second set of experiments, a 6-DOF industrial manipulator (MOTOMAN-UPJ, Yaskawa Electric
Corporation) shown in Fig. 12(b) was used. The input signal provided to the ﬁlters was the angularvelocity signal (the numerical derivative of the angle signal) from the optical encoder attached to the14Distance [cm]

80
60
40
20
0

10

20
Time [s]

30

40

80

80

60

60

Distance [cm]Distance [cm](a) Input signal (positive impulsive noise).

40
20
0

Proposed: F=100, α=5
BWF-Cutoff freq.: 0.5Hz

1020Time [s]

30

40
20

Proposed: F=100, α=5ESDS-FCM: F=100

0

40

10

80

80

60

60

40
20
0

Proposed: F=100, α=5ESDS-BE: F=1001020Time [s]3040(c) ESDS-FCM vs proposed filter.

Distance [cm]Distance [cm](b) BWF vs proposed filter.

20
Time [s]40

ESDS-FCM: F=100
ESDS-BE : F=100

80
70

20

60
50
40
1

30

0

40

2

3

10

4

5

6

7

20
Time [s]3040(e) ESDS-FCM vs ESDS-BE.

(d) ESDS-BE vs proposed filter.

Figure 14: Experiment by using an ultrasonic sensor (T = 0.01 s): the second motion.

sixth joint of the manipulator. A smooth desired trajectory from 80 degree to −80 degree was provided
to a position controller [24] to control the angle of the joint. Fig. 15(a) shows the obtained angle signal,and Fig. 15(b) shows the velocity signal obtained by the numerical diﬀerentiation. In Fig. 15(b), one canobserve that the signal was corrupted by high-frequency noise and there was an impulse at t = 1.554 s.
The ﬁltered results are shown in Fig. 15(c) to Fig. 15(j), which are the enlarged views of Fig. 15(b).
The results in Fig. 15(c) to Fig. 15(f) show that BWF failed to remove the eﬀect of the impulse,
whereas ESDS-FCM, ESDS-BE and the proposed ﬁlter succeeded. It is clear that, even in the case of
BWF, the eﬀect of the impulse can be reduced by using a lower cutoﬀ frequency, but it would cause larger
phase lag. Figs. 15(d)(e)(h)(i) show that the proposed ﬁlter tracks the input signal rather smoothly andaccurately compared to the ESDS ﬁlters. This can be attributed to the use of α > 1, which provides
smaller overshoot. The diﬀerence between ESDS-FCM and ESDS-BE is distinct in Figs. 15(f) and (j),which implies the advantage of the use of backward Euler discretization.

15

Velocity [degree/s]

Angle [degree]

80
40
1

2

3

4

-40

1

2

3

4

-20
-40
-60

(c)-(f) (g)-(j)-80-80Time [s]Time [s](a) Angle signal.

-84
-86
-88
-90
-92
1.50

1.52

1.54
1.56
Time [s]

1.58

-84
-86
-88
-90
-92
1.50

1.60

Velocity [degree/s]

-86
-88
-90
-92
1.50

1.52

1.54
1.56
Time [s]

1.58

-84

-90

Velocity [degree/s]

Velocity [degree/s]

-86
-88
2.32

2.34
2.36
Time [s]

2.38

-82

Proposed: F=50000, α=2
ESDS-FCM: F=50000

-84
-86
-88

Velocity [degree/s]

Velocity [degree/s]

-88
2.34
2.36
Time [s]

2.38

2.32

-80

-86

2.32

1.60

2.34
2.36
Time [s]

2.38

2.40

(h) ESDS-FCM vs proposed filter.

-84

-90
2.30

1.58

Input

-90
2.30

2.40

Input
Proposed: F=50000, α=2
ESDS-BE: F=50000

-82

1.54
1.56
Time [s]-80(g) BWF vs proposed filter.
-80

1.52

(f) ESDS-FCM vs ESDS-BE.

-84

-90
2.30

1.60

-88

-92
1.50

1.60

Input
Proposed: F=50000, α=2
BWF-Cutoff freq.: 100Hz

-82

1.58

-86

(e) ESDS-BE vs proposed filter.
-80

1.54
1.56
Time [s]Input
ESDS-FCM: F=50000
ESDS-BE : F=50000-82
Velocity [degree/s]

Input
Proposed: F=50000, α=2
ESDS-BE: F=50000

-84

1.52

(d) ESDS-FCM vs proposed filter.

(c) BWF vs proposed filter.
-82

Input
Proposed: F=50000, α=2
ESDS-FCM: F=50000-82
Velocity [degree/s]

Velocity [degree/s](b) Velocity signal.

Input
Proposed: F=50000, α=2
BWF-Cutoff freq.: 100Hz

-82

-84
-86
-88
-90
2.30

2.40

(i) ESDS-BE vs proposed filter.

Input
ESDS-FCM: F=50000
ESDS-BE : F=50000

-82

2.32

2.34
2.36
Time [s]

2.38

2.40

(j) ESDS-FCM vs ESDS-BE.

Figure 15: Experiment by using an encoder of an industrial manipulator (T = 0.001 s).

16

5Conclusion

In this paper, we have presented a quadratic sliding mode ﬁlter for removing impulsive noise and highfrequency noise with producing smaller phase lag than linear ﬁlters. The proposed ﬁlter does not produce
chattering, and it is less prone to overshoot than previous quadratic sliding mode ﬁlters. In addition,
its algorithm is computationally inexpensive, and thus suitable for realtime applications. Experimental
results showed the eﬀectiveness the proposed ﬁlter.
One issue that is not addressed here but remained as the future topic of research is to develop
guidelines for how to choose the the values of parameters F and α. As another issue, it is expectedthat the proposed ﬁlter can be further extended for smoothing the ﬁrst or higher order derivative of the
input signal.

Acknowledgment
This work was supported in part by Grant-in-Aid for Young Scientists (B), No. 22760321, from Japan
Society for the Promotion of Science.

REFERENCES[1] N. J. Gallagher and L. W. Gary, “A Theoretical Analysis of the Properties of Median Filters,” IEEE
Transactions on Acoustics, Speech and Signal Processing, vol. 29, no. 6, pp. 1136-1141, 1981.
[2] V. G. Moshnyaga and K. Hashimoto, “An Eﬃcient Implementation of 1-D Median Filter,” in Proceedings of 52nd IEEE International Midwest Symposium on Circuits and Systems, pp. 451-454,
Boise, USA, 2009.
[3] P. S. Windyga, “Fast Impulsive Noise Removal,” IEEE Transactions on Image Processing, vol. 10,
no. 1, pp. 173-179, 2001.
[4] N. Alajlan, M. Kamel and E. Jernigan, “Detail Preserving Impulsive Noise Removal,” Signal Processing: Image Communication, vol. 19, no. 10, pp. 993-1003, 2004.
[5] F. Janabi-Shariﬁ, V. Hayward and C-S. J. Chen, “Discrete-Time Adaptive Windowing for Velocity
Estimation,” IEEE Transactions on Control Systems Technology, vol. 8, no. 6, pp. 1003-1009 , 2000.
[6] F. Chen and M. W. Dunnigan, “Comparative Study of a Sliding-Mode Observer and Kalman Filters
for Full State Estimation in an Induction Machine,” IEE Proceedings on Electric Power Applications,vol. 149, no. 1, pp. 53-64, 2002.
[7] A. Alessandri, “Sliding-Mode Estimators for a Class of Non-Linear Systems Aﬀected by BoundedDisturbances,” International Journal of Control, vol. 76, no. 3, pp. 226-236, 2003.

17

[8] I. Haskara, A. Ozguner and V. Utkin, “On Sliding Mode Observers via Equivalent Control Approach,” International Journal of control, vol. 71, no. 6, pp. 1051-1067, 1998.
[9] A. Levant, “Robust Exact Diﬀerentiation via Sliding Mode Technique,” Automatica, vol. 34, no. 3,
pp. 379-384, 1998.
[10] J. A. Moreno and M. Osorio, “A Lyapunov Approach to Second-Order Sliding Mode Controllers
and Observers,” in Proceedings of 47th IEEE Conference on Decision and Control, pp. 2856-2861,
Cancun, Mexico, 2008.
[11] N. K. M’sirdi, A. Rabhi, L. Fridman, J. Davila and Y. Delanne, “Second Order Sliding Mode
Observer for Estimation of Velocities, Wheel Sleep, Radius and Stiﬀness,” in Proceedings of the2006 American Control Conference, pp. 3316-3321, Minneapolis, USA, 2006.
[12] J. Resendiz, W. Yu and L. Fridman, “Two-Stage Neural Observer for Mechanical Systems,” IEEE
Transactions on Circuits and Systems II: Express Briefs, vol. 55, no. 10, pp. 1076-1080, 2008.
[13] J. Davila, L. Fridman and A. Levant, “Second-Order Sliding-Mode Observer for Mechanical Systems,” IEEE Transactions on Automatic Control, vol. 50, no. 11, pp. 1785-1789, 2005.
[14] S. Solvar, V. Le, M. Ghanes, J. P. Barbot and G. Santomenna, “Sensorless Second Order Sliding
Mode Observer for Induction Motor,” in Proceedings of 2010 IEEE International Conference onControl Applications, pp. 1933-1938, Yokohama, Japan, 2010.
[15] N. K. M’Sirdi, A. Rabhi, L. Fridman, J. Davila and Y. Delanne, “Second-Order Sliding-ModeObserver for Estimation of Vehicle Dynamic Parameters,” International Journal of Vehicle Design,
vol. 48, no. 3-4, pp. 190-207, 2008.
[16] J. Q. Han and W. Wang, “Nonlinear Tracking-Diﬀerentiator,” Journal of Systems Science andMathematical Science, vol. 14, no. 2, pp. 177-183, 1994. (in Chinese)[17] T. Emaru and T. Tsuchiya, “Research on Estimating the Smoothed Value and the Diﬀerential of theSensor Inputs by Using Sliding Mode System (Application to Ultrasonic Wave Sensor),” Transactionsof the Japan Society of Mechanical Engineers, Series C, vol. 66, no. 652, pp. 3947-3954, 2000. (inJapanese)[18] T. Emaru and T. Tsuchiya, “Research on Estimating Smoothed Value and Diﬀerential Value byUsing Sliding Mode System,” IEEE Transactions on Robotics and Automation, vol. 19, no. 3, pp.
391-402, 2003.
[19] T. Emaru, T. Tsuchiya and K. Tanaka “Fast Calculating Method for Eliminating the Impulsive
Noise,” Transactions of the Japan Society of Mechanical Engineers, Series C, vol. 70, no. 689, pp.
62-68, 2004. (in Japanese)[20] D.E. Kirk. “Optimal Control Theory: an Introduction,” Prentice Hall, 1970.
18

[21] A. Levant, “Sliding Order and Sliding Accuracy in Sliding Mode Control,” International Journalof Control, vol. 58, no. 6, pp. 1247-1263, 1993.
[22] G. Bartolini, A. Ferrara and E. Usai, “Applications of a Sub-Optimal Discontinuous Control Algorithm for Uncertain Second Order Systems,” International Journal of Robust and Nonlinear Control,
vol. 7, no. 4, pp. 299-319, 1997.
[23] R. Kikuuwe, N. Takesue and H. Fujimoto, “A Control Framework to Generate Nonenergy-Storing
Virtual Fixtures: Use of Simulated Plasticity,” IEEE Transactions on Robotics, vol. 24, no. 4, pp.
781-793, 2008.
[24] R. Kikuuwe, S. Yasukouchi, H. Fujimoto and M. Yamamoto, “Proxy-Based Sliding Mode Control:a Safer Extension of PID Position Control,” IEEE Transactions on Robotics, vol. 26, no. 4, pp.
670-683, 2010.
[25] V. Acary and B. Brogliato, “Implicit Euler Numerical Scheme and Chattering-Free Implementationof Sliding Mode Systems,” Systems and Control Letters, vol. 59, no. 5, pp. 284-293, 2010.

19

Appendix:
Proposition: The following two equations are equivalent to each other:• z − y = gsgn(gsgn(a, −z, b), x − z, gsgn(c, −z, d)) and• z − y = gsat(gsat(a, −y, b), x − y, gsat(c, −y, d))where a ≤ b ≤ c ≤ d.
Proof:z − y = gsgn(gsgn(a, −z, b), x − z, gsgn(c, − z, d))⇔(x − z < 0 ∧ ((z − y = a∧ −z < 0) ∨ (z − y = b∧ −z > 0) ∨ (z − y ∈ [a, b] ∧ −z = 0)))∨(x − z > 0 ∧ ((z − y = c∧ −z < 0) ∨ (z − y = d∧ −z > 0) ∨ (z − y ∈ [c, d] ∧ −z = 0)))∨(x − z = 0 ∧ ((z − y ∈ [a, c] ∧ −z < 0) ∨ (z − y ∈ [b, d] ∧ −z > 0) ∨ (z − y ∈ [a, d] ∧ −z = 0)))⇔(x − z < 0 ∧ ((z − y = a∧ −y < a) ∨ (z − y = b∧ −y > b) ∨ (z − y = −y

∧ −y ∈ [a, b])))∨(x − z > 0 ∧ ((z − y = c∧ −y < c) ∨ (z − y = d∧ −y > d) ∨ (z − y = −y

∧ −y ∈ [c, d])))∨(x − z = 0 ∧ ((z − y ∈ [a, c] ∧ −z < 0) ∨ (z − y ∈ [b, d] ∧ −z > 0) ∨ (z − y ∈ [a, d] ∧ −z = 0)))⇔(x − z < 0 ∧ z − y = gsat(a, −y, b))∨(x − z > 0 ∧ z − y = gsat(c, −y, d))∨(x − z = 0 ∧ ((z − y ∈ [a, c] ∧ −z < 0) ∨ (z − y ∈ [b, d] ∧ −z > 0) ∨ (z − y ∈ [a, d] ∧ −z = 0)))⇔(z − y = gsat(a, −y, b) ∧ x − y < gsat(a, −y, b))∨(z − y = gsat(c, −y, d) ∧ x − y > gsat(c, −y, d))∨(z − y = x − y ∧ ((x − y ∈ [a, c] ∧ x > 0) ∨ (x − y ∈ [b, d] ∧ x < 0) ∨ (x − y ∈ [a, d] ∧ x = 0)))⇔(z − y = gsat(a, −y, b) ∧ x − y < gsat(a, −y, b))∨(z − y = gsat(c, −y, d) ∧ x − y > gsat(c, −y, d))∨(z − y = x − y⇔(z − y = gsat(a, −y, b) ∧ x − y < gsat(a, −y, b))∨(z − y = gsat(c, −y, d) ∧ x − y > gsat(c, −y, d))∨(z − y = x − y ∧ x − y ∈ [max(a, −y), c] ∪ [b, min(d, −y)] ∪ [max(a, −y), min(d, −y)])⇔(z − y = gsat(a, −y, b) ∧ x − y < gsat(a, −y, b))∨(z − y = gsat(c, −y, d) ∧ x − y > gsat(c, −y, d))∨(z − y = x − y⇔(z − y = gsat(a, −y, b) ∧ x − y < gsat(a, −y, b))∨(z − y = gsat(c, −y, d) ∧ x − y > gsat(c, −y, d))∨(z − y = x − y⇔

z − y = gsat(gsat(a, −y, b), x − y, gsat(c, −y, d))∧ x − y ∈ ([a, c] ∩ [−y, ∞)) ∪ ([b, d] ∩ (−∞, −y]) ∪ ([a, d] ∩ [−y, −y]))∧ x − y ∈ [min(b, max(a, −y)), max(c, min(d, −y))])∧ x − y ∈ [gsat(a, −y, b), gsat(c, −y, d)])20

(23)