Fuzzy Sets and Systems 59 (1993) 259-270 North-Holland
259
Fuzzy rule-based simple interpolation algorithm for discrete signal Eiji Uchino*, Takeshi Yamakawa*, Tsutomu Miki* and Shin Nakamura Department of Computer Science and Control Engineering, Kyushu Institute of Technology, Kawatsu, lizuka 820, Japan Received September 1992 Revised February 1993
Abstract." This paper describes a fuzzy rule-based simple interpolation algorithm for discrete data. A simple interpolation algorithm between two noise-free points in the Euclidean space is proposed by taking into account the fuzzy effects of the surrounding points. The advanced algorithm for the noisy points is proposed, where interpolation is done by classifying the neighboring noisy points into some groups. The validity and the effectiveness of these methods have been verified by computer simulations and by applications to the actual time series noisy data. The experimental results have provided substantial proofs for practical use.
Keywords: Interpolation; fuzzy inference of C" class; identification; noise elimination; fuzzy filtering; 'patch'.
1. Introduction A characteristic of a practical system can be described by a pair of cause and result, or action and reaction. In the field of systems engineering, the relationship between cause and result can be described by an input-output function. Of course, the more pairs of data we have, the clearer the mechanism of the system becomes. That is, the input-output function can be exactly determined by getting the input-output data for all the points in the dynamic range. However, it requires much time and efforts. If this function could be approximately determined by a small amount of data, it could save time and efforts, and facilitate data compression. The efficient representation of an uncertain system is achieved by a small amount of data and is one of the main objectives of this study. When sampled data are acquired in a practical system, those are necessarily disturbed by an observation noise, and they may be defective. Thus, the interpolation algorithm for finding a continuous signal that passes exactly through the observation data is nonsense, because the data do not represent the true values. The development of an interpolation algorithm for noisy and defective data based on fuzzy inference is another main objective of this study. This algorithm is verified by applications to a practical road traffic noise signal and a defective voice signal with background noise.
2. Fuzzy rule-based interpolation algorithm for discrete noise-free data A fuzzy rule-based simple interpolation algorithm for discrete noise-free data is discussed. Let us consider the following input-output system:
y =f(x~,
(1)
Correspondence to: Dr. E. Uchino, Dept. of Computer Science and Control Engineering, Kyushu Institute of Technology, Kawatsu, Iizuka 820, Japan. * The authors are also with the Fuzzy Logic Systems Institute (FLSI), Kawatsu, lizuka 820, Japan. 0165-0114/93/$06.00 © 1993--Elsevier Science Publishers B.V. All rights reserved
260
E. Uchino et al. / Interpolation f o r discrete signal
where x and y are an input and an output of the system, respectively. This input-output function f(x) is supposed to be unknown. The identification of f(x) is very important in the field of control engineering. This input-output function can be experimentally identified by measuring the outputs for the applied inputs. These input-output data are represented by the pairs of (x, y)'s. If we have these pairs in a data base, e.g., contents in ROM (Read Only Memory), we can predict to some extent the output of the system for an arbitary input. It is obvious that the more pairs of these input-output data we have, the more precise output we can predict. However, it needs much time and much experimental efforts. The problem here is to describe this input-output function by using a small amount as possible of fuzzy data. Let us consider a set of pairs {(xi, yi) li--1,..., n}. (xi, yi) is a pair of the input-output data measured, and it can be regarded as a point in the 2-D Euclidean space. In what follows, discussions are made for a single variate case, which can be easily extended to the multi-variate case.
2.1. Theoretical considerations Consider an interpolation in the interval [xi, Xi+a]. Let [xi-1, xi] and [xi+l, xi+2] be the adjoining intervals, and f(x) be the straight line that passes through the successive two points of (xi, Yi) and (x~+l, y;+l), where xi-i < xi < Xi+l < xi÷2. The proposed interpolation algorithm in the interval [xi, x~+l] is briefly described in the following: (i) Assign a membership function wi(x) to each function fi(x) as shown in Figure 1. (ii) The interpolation in the inverval [xi, xi+l] is done according to the following rules; Rule 1: ifx is
Ai_ 1
then u = fi-l(X),
Rule 2; ifx is A i then u = f ( x ) , Rule 3: ifx is A i +
1
(2)
then u =f+~(x),
N~
xi. 1
fi ¢x)
x~
xi+2
xi+ 1
then u =~-I (x)
Rule 1: if x is
,
Rule 2: if x is
. then u =fi(x)
i Rule 3: if x is
1~
w i+1 then u=fi+l(X)
Fig. 1. Membership functions assigned to each function f~(x), and the fuzzy rules for interpolation in the interval [xi, xi+ ~].
E. Uchino et al. / Interpolation for discrete signal
261
where Aj is a fuzzy set whose membership function is w~. Then, the interpolated value )~(x) is given as follows [1]: y(x)
142i__l(X)fii__l(X) 4- Wi(X)fii(X ) 4- Wi+l(X)fii+l(X ) w,_,(x) + w,(x) + w,+,(x) : I(W,. l(X)fii_l(X) Jr- Wi(x)fii(X ) 4- Wi+l(X)fii+l(X)). -
(3)
If the membership functions wi-1 and wi+l were not taken into account, the interpolation curve would become a straight line that passes through the given points (xi, yi) and (xi+~, Yi+~). This matches with our common sense. That is, if the adjoining points (x~_~, yi_~) and (xi+z, Yi+2) were not given, everyone would admit that the best interpolated curve would be the straight line that connects the two points (xi, y~) and (x,+l, Y~+I)The first derivative of the interpolated curve obtained by the above algorithm ((i) and (ii)) may become discontinuous at the given points, i.e., the resulting interpolated curve will not belong to the C ~ class. Smooth interpolation of C n class* is for future study. 2.2. S i m u l a t i o n e x p e r i m e n t s
In order to verify the effectiveness of the proposed interpolation method, computer simulations were performed for several intput-output functions. The input-output functions employed for simulation experimens are (i) y = x 2 and (ii) y = sin x. Figures 2 and 3 show the interpolated results for the cases of (i) and (ii), respectively. These results show that this interpolation algorithm is effective in spite of its simplicity. It is also verified that the interpolation method in this paper does not give the fluttering as Lagrange's method [2], which sometimes provides a heavily oscillating curve. Simulation results for other models are described in [3].
3. Fuzzy rule-based interpolation algorithm for discrete noisy data In general, the actual sampled signal is always disturbed by noise. The signal and noise are, in many cases, non-stationary, and thus the signal-to-noise ratio (SNR) changes frequently. Furthermore, the Y
7 6 5
,
-3
,
-2
,
-1
Fig. 2. Interpolated results for a curve y = x 2. - - - ,
-
,
,
,
0
1
2
3
True curve; . . . .
t
X
, interpolated curve; ©, given point.
* When all the n-th derivatives of the interpolated curve are continuous, the authors refer to this interpolation or fuzzy inference as 'interpolation of C" class' or 'fuzzy inference of C" class', respectively.
E. Uchino et al. / Interpolation for discrete signal
262
Y
1.0 0.5
"0 ' ~~ j 2 hi2
n
X
n
-0.5 -1.0 Fig. 3. I n t e r p o l a t e d results for a c u r v e y = sin x. - - , T r u e curve; . . . . , c u r v e i n t e r p o l a t e d o n l y with use of the p o i n t s O; . . . . . . , c u r v e i n t e r p o l a t e d w i t h use of b o t h p o i n t s O a n d O.
signal and nose distribution properties are often of non-Gaussian type. The Kalman filter [4, 5] is well-known in the field of noise elimination. However, in applying the Kalman filter, the dynamics of its objective signal must be known or formulated in advance. Linear and Gaussian properties of the dynamics are also strongly required. Many works have been done in order to overcome these idealized conditions. Some new digital filters were proposed for a general case and have good estimation performance [6, 7]. However, the algorithms involved are complicated. In this section, considering hardware implementation in the future, a fuzzy rule-based simple interpolation algorithm for sampled noisy data is discussed. The algorithm eventually results in the elimination of noise without knowing its system dynamics [8]. Now, let the observation mechanism be described by y(t) = x(t) + v(t),
(4)
where x(t) is the time series signal of concern, v(t) is the additive noise whose statistics are unknown, and y(t) is the observation disturbed by the noise v(t). The problem here is to get the estimate of the signal pattern x(t) based on a fuzzy inference by using the successive observation y(t). 3.1. Theoretical considerations
The basic interpolation principle here is based on the fact that even if the signal pattern is buried in noise, one can somewhow guess the rough sketch of its true noise-free signal pattern. The original signal is estimated based on a fuzzy inference by using the sampled noisy data without knowing the mechanism of its dynamics. The proposed interpolation algorithm starts with grasping the outline of the target signal and then adopts the interpolation policy similar to the one applied to the noise-free data described in the previous section. The following is the brief description of the algorithm: (i) Divide the sampled noisy signal y(t) into some partitions and enclose them by rectangles so that the maximum and minimum values of each partition are at the top and bottom edges of each rectangle, respectively. Figure 4 shows an example of this enclosing process. The enclosing process for a time series signal by the rectangle seems to be a kind of patch work, and thus we call it a 'patch'. The patch is composed of 3 sampled points in case of Figure 4. (ii) Let P, be a rectangle or a 'patch' and Gi be the center of gravity of P~ (see Figure 5). (iii) Let F~(t) be the straight line that passes through the successive points of Gi and Gi+l. This shows a slow and steady drift of signal at ti <~t < t~+~, and then, we call this line a main-line. (iv) The sub-line f(t) is determined according to the positional relation among the successive three
263
E. Uchino et al. / Interpolation for discrete signal I
4.0--
I
I
I
I
3.0 I o
2.0 l
1.0 I 0.0 -1.0 l o
i
I
2
4
i
I
i
6
8
10
t
Fig. 4. Sampled noisy signal pattern and its enclosures. O, Sampled point of noisy observation; 15],enclosure (or 'patch').
patches of P,-1, P~, and e/+l, as follows: fi(t) =
di -- Ci
bi - ai
fi(t)-
(t - ti) + g~,
di - - C i - (t-ti)+g,, bi - ai
fi( t ) = gi,
w h e n gi-1 < g i < gi+l,
(5)
when g~_]>g~>g~+l,
(6)
otherwise,
(7)
where ai, bi, ci, di, and g~ are parameters that characterize P/, as shown in Figure 5. This sub-line is used to catch the trend of fluctuation of time series signal from the previous stage to the next stage.
Pi di
Gi( t i, gi ) ~.~
"
gi
...........................................
•
c i .............................
t D
ai
ti
bi
Fig. 5. Parameters for P/.
E. Uchino et al. / Interpolation for discrete signal
264
Fiq(t)
FW) / ~'- Fi+l(tt /
'.
~
fi+2(t)
fi+l(t) 'fi(t) fi.l (t)
/ i
i1 l--
Rule l: if t is
I
Rule 4: if t is
t
?
~ l (0
Rule 2: if t is Rule 3: if t is
iw~wi
~ [ i/~:,
Rule 5: if t is ti.3 ti.2 ti.l
[ E
ti
li
then
u =Fi (t)
then
u =fi-I (t)
then
u =~ (t)
then
u ='f/+l (t)
:,
:
: I÷l !
i
E
i
~ ! then u =fi+z(t) ti+l ti+2 ti+3 ti+4
Fig. 6. Membership functions assigned to main- and sub-lines, and the fuzzy rules for interpolation in the interval ti ~
(v) Assign a membership function to each of these main- and sub-lines. Wi(t) and We(t) are the membership functions assigned to F~(t) and fi(t), respectively as shown in Figure 6. (vi) Then, the interpolation of x ( t ) in the interval ti <- t < ti+a is carried out according to the following rules: Rule 1: if t is A~ then u = F~(t), Rule 2: if t is Ai-1 then u = f _ l ( t ) , Rule 3: if t is Ai then u = f(t),
(8)
Rule 4: if t is mi+ 1 then u =f+a(t), Rule 5: if t is Ai+2 then u --fi+2(t), where A[ and Aj are fuzzy sets with respective membership functions (see Figure 6). Thus, the interpolated value of x ( t ) in the interval ti <~ t < ti+l is given by [1]: Y(t) =
W i - l ( t ) f i - l ( t ) + w i ( t ) f ( t ) + 2F/(t) + W i + l ( t ) f + l ( t ) + wi+2(t)f+2(t ) Wi_l(t ) + wi(t ) + 2 + wi+l(l ) + wi+2(t)
= ](Wi-l(t)fi-l(t)
+ wi(t)fi(t) + 2 F / ( t ) + W i + l ( t ) f + l ( t ) + wi+2(t)fii+e(t)).
(9)
In (9), the weight of the main-line is assigned twice of sub-lines. This is to balance the effect of the main-line (i.e., Rule 1) with hose of the remaining sub-lines (i.e., from Rule 2 to Rule 5), because Wi_l(t) + wi(t ) + Wi+l(t ) + Wi+2(t ) = 2.
The present method may be considered to be a kind of non-linear low-pass filter, where the cut-off frequency is determined by the width of patch P/. In this method, the patch width is not necessarily constant through the time domain, but can be variable according to the frequency characteristics of the signal under measurement. For example, it may be wide for a low signal frequency, or may be narrow for the signal with higher frequency components. One patch is also allowed to be overlapping with two neighboring patches with a slight modification of the present algorithm.
E, Uchino et al. / Interpolation for discrete signal
265
Here, we have employed 5 rules for fuzzy inference for the reason described in Section 3.2 One could, of course, further consider the effects of P~-2 and P~+3, or even more, for an interpolation at ti<~t
3.2. Simulation experiments In order to confirm the validity of the proposed algorithm computer simulation was conducted to the following model: y(t) = x(t) + v(t),
(10)
x(t) = sin 0)1t + 2 sin 0)2t + sin 0)3t
(11)
with 0)1 = 0.32 (rad/sec), 0 ) 2 : 0.64 (rad/sec), and 0)3 -- 0.96 (rad/sec). v(t) is a non-stationary noise that was generated artificially as:
P(v(t)) = N(v(t); mi, ~),
when ti ~< t < ti+~,
(12)
where N(x;m, c r 2 ) - - - ( 1 / V ~ t r ) e x p { - ( x - m ) 2 / 2 o "2} is a Gaussian distribution with mean m and variance o-2. The parameter mi is assigned to be 0, and the other parameter ~ is changed as follows; ~ = 1 . 0 at 0 ~ < t < l (sec); ~ = 0 . 4 at 1 ~ < t < 3 (see); ~ = 1 . 0 at 3 ~ < t < 5 (see); ~ = 0 . 4 at 5 ~ < t < 7 (sec); ~ = 1.0 at 7 ~
40
f
I
I
I
~
I
4.C
T = 10 ( sec )
3,(
~• ~
3£
e" ~ • . T = 0.5•( sec e)
2.(
~
2.C
<~ 1o
1.£
O.C
0.13
-10
10
'
t ( sec )
(a)
'2
'4
t
~
~
~o
(see)
(b)
40
4.0 I
3.0
3.0
!
~
2.0
<~ ~
10
~
00
~.0
o.c
1.0
•
t (--sec ~)
~
,'o
t ( sec )
lo
(d/ Fig. 7. Interpolated results for the simulation model. - - , True curve; . . . . . . , interpolated curve; O, sampled point of noisy observation; ( a ) T = 0.5 ( s e c ) ; ( b ) T = 1.0 ( s e e ) ; (e) T = 1.5 (sec); ( d ) T = 2 . 0 (see).
266
E. Uchino et al. / Interpolation for discrete signal 4.0
I
I
/!
I
t~
I
I
i
+it
i
I -
3.0 ~.
2.0
~.
1.0
il
l i
--+j
ii
/ii
!
!
-
0.0 /
~ .
-1.0 I
0
2
• t.v~ [ _j
,
,
i+ji,/
4
6
8
t ( see )
10
Fig. 8. Interpolated results by using the conventional methods. , True curve; . . . . . . , curve interpolated by the Lagrange's method; . . . . , curve interpolated by the cubic spline method; O, sampled point of noisy observation.
the above model with several patch widths. When the patch width is narrow, the effect of noise cannot be suppressed. When the patch width is wide, the signal to be squeezed out tends to be reduced. A patch width of T = 1.0 (sec) exhibits the best characteristics in this simulation (Figure 7(b)). The interpolation results shown in Figure 8 for the above model were derived by using the conventional methods [2], e.g., Lagrange's method or a cubic spline method. Direct comparison of these methods has no meanings, because the interpolated curves obtained by using these conventional methods are so calculated that they pass exactly through the given noisy points. The main purpose of this comparison is only to show that the conventional interpolation methods cannot be applied directly to this type of noisy data. The algorithm proposed here is a lowpass filter implemented by patching and interpolation with fuzzy inference. Thus the authors refer to this algorithm as a 'fuzzy filtering'. In order to get experimentally the filtering characteristics, sinusoidal w a v e Xin(t) = sin 2gft is applied to this filter and then the output Your(t) is observed. Figure 9 shows the frequency characteristics of this fuzzy filter for the gain (=-10 loglo((y2ut)/(X2n))). The wider the patch width is, the lower the cut-off frequency becomes. The relation between the patch width T and the cut-off frequency fc (defined by the 3 dB attenuation point) is shown in Figure 10. The empirical relationship between T and fc is found as: k
r~-. f~
(13)
In order to effectively restore the defect in the signal, the patch width is to be designed wider. One can see from (13) that the coefficient k is preferably bigger in order to get the wider patch width for the specific cut-off frequency. Figure 10 shows that the case of 5 rules (n = 5) exhibits the biggest coefficient and thus n = 5 is adopted in this paper. When n = 5, k is approximately 0.2. The output of the proposed filter has a constant delay of 3.5T (sec) independent of frequency. It means that this filter exhibits low phase distortion.
3.3. Application to actual data The proposed method was applied to the actual acoustic data to confirm its effectiveness. Figure 11 shows the interpolated results for a road traffic noise signal disturbed by an artificially generated non-stationary background noise. The sampling interval is 0.2 (sec). Each patch is composed of 4 sampled data.
Interpolation for discrete signal
E. Uchino et al. /
I
I
n=
i .
267
~ .
.
.
I
-5
T =0.2(x103 ~ _ r =o .4( x I o ~ ~,,o~ ~ J k " ~
~-10
e(xlO ~ ~ o c ) / ~ T=1.6(x10 sec)
N
\
/
T=O
-15
i
T = I 6(x10
,
sec)
/
i
,slI
~
I
30
it
100 300 f (Hz)
i
t
-20
10
5
'\
T =0 2(x 0 see) - - 10 ~-T=0 4(X10 3 s e c ) ~
-\
In=
.
I
J
10
lk
30
i
~
ii
100 300 f(Hz)
I
(b) I
I
I
p
In= 7
i -5 ~-10 -15
r = o . ~ x~ o -~ ~ o ~ J . , . \
T =1.6(x10"3 sec) /
\
!
I
f
0
i
I
"T _-_--018(x 10"3 sec~'~ " T = l . 6 ( x 1 0 sec)-~ i
~20 10
30
100
f
300
lk
10
30
(Hz)
(c)
100
f
300
I
(Hz)
(d)
Fig. 9. Frequency response of the fuzzy filter for patch width T and the number of rules employed. (a) 3 rules (n = 3); (b) 5 rules (n = 5); (c) 7 rules (n = 7 ) ; (d) 9 rules (n = 9.)
Experiments were also made for voice signal. Figure 12 shows a noisy signal pattern of voice /u/ sampled at 50 KHz, which is disturbed by an artificially generated non-stationary noise. Figure 13 shows the interpolated results for the noisy voice signal of Figure 12 by the proposed method. Each patch is composed of 10 sampled data. Finally, we applied this method to the restoration of the intermittent or damaged noisy signal data. Figure 14 shows the intermittent noisy voice signal of /u/. Figure 15 shows the results interpolated (restored) for its intermittent signal by the proposed method. The interpolated curve is similar to the original voice signal without noise. I
1.5
1.0
I
•% .,,. \ ~ ". x~ "
02~} 0 . 8 O 0.6 ~.
i
r
•..%. "-.,
n= 3 n=9
O.5
0.4 0.3
0.2
I
1 00
I
200
I
fc
(Hz)
500
I
I k
Fig. 10. Relation between the patch width T and the cut-off frequency fc- n means the number of rules employed.
268
E. Uchino et al. / Interpolation f o r discrete signal I
90.0
I
r
I
f
88.0
rn 86.0 O
84.0
~' 82.0 <~
80.0 78.0
76.0
I
6 t ( sec )
I
I
8
10
Fig. 11. Interpolated results for a road traffic noise signal disturbed by an artificial non-stationary noise. - - -, Road traffic noise signal; . . . . . . , interpolation by the proposed method; O, sampled point of noisy observation. I
1.5
/k
1.0 O
>
0.5
~'
o.o
I
-0.5 -1.0 -1.5
I
k
6
8
I
t ( msec )
10
12
Fig. 12. Noisy signal pattern of v o i c e / u / .
[
I
I
I
t
,5 I 1.0
o
0.5 0.0
~ " -0.5 -1.0 -1.5 [
I
5
6
Fig. 13. Interpolated results for the noisy voice signal. - - ,
4"
7
I
I
8 9 t ( msec )
1
10
I
11
I
12
Original voice signal o f / u ] ; . . . . . . method.
, interpolation by the proposed
Jbr discrete
E. Uchino et al. / Interpolation
269
signal
10 t 0,5
o
~. o ol~
-0"5F~ -1.0 -1.5~I
I
12
8 10 t ( msec )
Fig. 14. Intermittent noisy voice signal of/u/. I
f
I
t
1
I
I
;
]
I
11
12
1.5 1.0 o
0.5
<~ o.o
,~ -0.5 -1.0 -1.5 1
5
I
6
I
7
8 9 t (msec )
Fig. 15. Interpolated results for the intermittent noisy voice signal of/u/.
10 - -
-, Original voice signal; . . . . . . , interpolation by
the proposed method
4. Conclusions In this paper, with a hardware implementation in mind, we have proposed a fuzzy rule-based simple interpolation algorithm for noisy discrete data. The algorithm is very simple and has been verified by computer simulations and by applications to the actual acoustic data. This interpolation algorithm is now under implementation on LSI chip for practical applications and will be reported in the near future.
Acknowledgment The authors would like to thank Prof. M. Ohta of the Kinki University, Japan and his colleagues for providing the road traffic noise data, and Prof. H.-N. Teodorescu of the Polytechnic Institute of Iasi, Romania for his helpful discussions.
270
E. Uchino et al. / Interpolation for discrete signal
References [1] M. Sugeno, Fuzzy Control (Nikkan Kogyo, Tokyo, 1988). [2] M. Iri and Y. Fujino, Common Sense in Numerical Calculation (Kyoritsu, Tokyo, 1991). [3] E. Uchino, T. Yamakawa and T. Yanaru, How to find out the supplementary rules representing an uncertain system, Proc. of 1990 Int. Conf. on Fuzzy Logic and Neural Networks (Iizuka, July 1990) 533-536. [4] R.E. Kalman, A new approach to linear filtering and prediction problems, Trans. ASME, Ser. D. J. Basic Eng. 82 (1960) 35-45. [5] R.E. Kalman and R.S. Bucy, New results in linear filtering and prediction theory, Trans. ASME, Ser. D. J. Basic Eng. 83 (1961) 95-108. [6] M. Ohta, K. Hatakeyama and M. Nishimura, Some unified methods in multivariable linear filtering and prediction problems by use of the expansion form of Bayes' theorem, Proc. of 26th Japan. Nat. Cong. for AppL Mech. 26 (1976) 383-398. [7] M. Ohta and E. Uchino, A design for a general digital filter for state estimation of an arbitrary stochastic sound system. J. Acoust. Soc. of America 80 (1986) 804-812. [8] E. Uchino, T. Yamakawa, T. Miki and S. Nakamura, Interpolation of noisy signal data by using fuzzy inference, Proc. of 1992 Int. Conf. on Fuzzy Logic and Neural Networks (Iizuka, July 1992) 341-344. [9] A. Kandel, Fuzzy Mathematical Techniques with Applications (Addison-Wesley, California, 1986). [10] G.J. Klir and T.A. Folger, Fuzzy Sets, Uncertainty, and Information (Prentice Hall, New Jersey, 1988).