A NEW APPROACH TO THE INTERPRETATION OF SIGNALS FROM TEMPERATURE SENSORS A NEW APPROACH TO THE INTERPRETATION OF SIGNALS FROM TEMPERATURE SENSORS

A basic approach in adaptive modeling of data acquisition is based on the comparison of real time data with the data previously predicted from the adequate numerical model. Our research was initiated to find a better algorithm for prediction of fire growth in enclosed spaces by means of interpretation of signals from fire sensors. The data obtained from temperature sensors are compared in a real time with predicted data and are used to adjust the numerical model for prediction so that it matches the reality. This adaptive approach has the following primary goals: early warning of fire growth, better alarm decision making, realization of an adaptive threshold (a threshold changing in the time according to the input signal), very small false alarm rate, etc. In this paper we introduce a method that uses smooth spline polynomials for approximation of the collected data and the time sliding window principle. The length of time sliding window varies in the real time and depends on the calculated error.


Introduction
In the context of data acquisition adaptive modeling uses the comparison of collected data with data predicted from a model to determine behavior of the system during sometime period. Minimization of differences between real and predicted data leads to more appropriate predictions of the system behavior like: system fault detection, detection of an accident situation in the early stage, adaptation of alarm threshold, etc.
In general, the problem of adaptive modeling requires solution of two related problems: 1) To define an adequate method for approximation and extrapolation (prediction) of the acquired data, and 2) To quantify the differences between collected and predicted data and by using this quantification to correct the adaptive model with the main purpose: to minimize those differences.
Functions for approximation can be constructed using the weighted residuals method, WRM. Some of the procedures are the least squares method, point matching method, etc. The simplest choice are the polynomials of arbitrary order which must be less or equal to the number of the remembered data for the current length of time sliding window. Quasi-stationary problems can be described with polynomials of any kind (specially splines of 2nd or 3rd) and prediction of the deterministic process is not a problem. However, the system faults demand a more detailed analysis (such as noise, fault peaks, etc.).
In systems where the collection of data is stationary (polling in equal time distance), the simplest method, which is satisfactorily accurate, is the least squares method with the polynomial approximation of the detected signal. With this approach, the model is represented by a curve which lies between the data, and produces the least sum of square error. According to the problem of adaptive modeling, an arithmetical mean obtained with the mentioned method has to be compared with the real data and the difference obtained in such a way is the condition for decision.

Time sliding window and real time reasoning
In real time systems data acquisition demands real time processing. Because of that, the method and corresponding software must provide time sliding. Consequently, it means that in the same program the loop contains the retarded and advanced instruction. Obviously, it is not possible and we have to simulate this algorithm using a sliding window principle.
Comparing the results obtained from extrapolation and data which the software accepts in real time, in every exact moment, the difference can be used to adopt the next extrapolation (the next time window). The extrapolation (prediction) has to be stated on the arbitrary set of previously acquired data. Because of the nature of a real time process, we must use the number of sensor data as small as possible. If we choose to view the set of data in the time window the length of which is constant, consequently we define the time sliding window with a constant length. In our approach the time sliding window has a variable length.
The time sliding window length is variable in time and depends on an error, i.e. the difference between the predicted data and the data that are acquired at every time instant. The measurement of time in every sliding window begins from the relative zero time. The method of variable length of the time sliding window includes feedback that corrects the errors in prediction.

A NEW APPROACH TO THE INTERPRETATION OF SIGNALS FROM TEMPERATURE SENSORS Milan Blagojevic -Dejan Petkovic *
A basic approach in adaptive modeling of data acquisition is based on the comparison of real time data with the data previously predicted from the adequate numerical model. Our research was initiated to find a better algorithm for prediction of fire growth in enclosed spaces by means of interpretation of signals from fire sensors. The data obtained from temperature sensors are compared in a real time with predicted data and are used to adjust the numerical model for prediction so that it matches the reality. This adaptive approach has the following primary goals: early warning of fire growth, better alarm decision making, realization of an adaptive threshold (a threshold changing in the time according to the input signal), very small false alarm rate, etc. In this paper we introduce a method that uses smooth spline polynomials for approximation of the collected data and the time sliding window principle. The length of time sliding window varies in the real time and depends on the calculated error.
Keywords: data acquisition, time sliding window, smoothing spline approximation, adaptive modeling.

Outline of the method
Our work is based on the approach which involves numerical signal processing. Data from sensor are used to obtain an acceptable extrapolation function. The next step is to compare the data from sensors to previously expected (predicted) values.
The length of the time sliding window is variable in real time and depends on the calculated error. This is the main problem, i.e. which length of the time sliding window has to be chosen in every time instant. Due to the equal time distance in data acquisition the number of acquired data and the length of the time sliding window are linearly interdependent. Of course, the number of predicted data is arbitrary, but the best results can be obtained with only one next time point. This approach demands that the borders of the time sliding window vary in real time simultaneously with the window. This approach also leads to the best fit between the real time and the predicted data when the difference between those two time series of data is used as a feedback.
The algorithm that uses the time sliding windows principle is described here on data from temperature sensors. In every time instant ( + ⌬) the algorithm has to compare new data with the previously predicted data and, depending on permitted difference, to expand the window backward until the satisfactory accurate approximation.
The algorithm for the data acquisition subroutine has to be as follows (detailed [2], [3]): Obviously, the described steps have to be repeated until the mathematical model that describes the real state of a system gives the results which are satisfactorily accurate.
A quantification of the difference between the new data and predicted data can be provided in several ways: through an absolute and relative difference or, better, through tools provided by functional analysis. The framework of functional analysis allows to treat time series as vectors and, consequently, various calculus in that sense through the norm which provides a definition of the length of the vector, inner product which provides the angle between two vector and, finally, minimizing the difference between two vectors by means of a projection coefficient.
The greatest advantage of this real time solution is a small number of iteration, which would have to be made before the best fit is established. Consequently, in buildings or environments with more sensors it should be possible to use information from a variety of systems to make decision.

Smoothing spline approximation in time sliding window
Spline functions are the category of very useful non analytic functions which consist of different polynomials on segments (and thereby segmental-analytic) linked in specific points which are called nodes.  The curve is piecewise cubic, that is, the coefficients of the polynomial are different on each interval (segment).

-do until (difference between new data and predicted data greater then permitted) if (maximum length of window not reached) then -expand window backward -approximation and prediction in current window endif endd
The curve passes through the given data (x i , y i ; i, …, n). The first and second derivatives are continuous at the node points. For natural spline, the second derivatives at end points equal to zero.
For signal identification and, more important, for prediction in the time sliding window, we used a smooth cubic spline approximation of Schoenberg and Reinch with the modification discussed in de Boor [5]. It is a natural cubic spline with knots at all the data abscissas (for uniformly spaced data points), but it does not interpolate the data (x i , f i ).
The smoothing spline is the unique function, which minimizes Minimization of (1) establishes a compromise between two conflicting goals: 1. to stay close to the given data, and 2. to obtain a smooth function.
These two conflicting goals may be expressed as where: w -weights, -smoothing parameter, and N -length of the time sliding window (number of obtained data in window) in every time instant.
The parameter has to be chosen somehow and depends on the weights. In [5] it is proposed to choose somewhere within ͙2N ෆ of N in case ͙2N ෆ is a good estimate for the standard deviation of the data. That is, Simply, represents a knob which one may set or turn to achieve a satisfactory approximation to the data. More sophisticated choice for is based on an estimation of the noise in the data obtained by a process called "cross validation".
The choice of weights depends on the question "have all the data the same importance for approximation" or "which data have more importance for prediction". For example, if we choose the pulse function as weighted function in the time sliding window all the data have the same importance for approximation, with triangle weighted function the "oldest" and the "newest" data have the least importance for approximation. Finally, the best choice for weighted function is the linear function because of the "newest" acquired data have the most importance for prediction.
In our approach, due to the quasistationary nature of temperature in fire phenomena, we have defined weights of f i in the window uniformly from 0 to 1, where the data on the right border of the window (the last acquired data) have w ϭ 1 .

Numerical experiments
In order to prove the proper choice of smooth spline approximation in the time sliding window, the described method built in simulation software and we made numerical experiments on the several sets of data. The data were chosen in the following way: most of the data have almost the same value except one, two or three data in the sliding window that have significant offset from the signal level (noise, disturbance, etc.). In the first phase of the experiment the comparative analysis between various interpolation and approximation methods was done. The results are shown in Fig. 4 (approximation with polynomial -least squares method, cubic spline interpolation and smoothing spline approximation).

R E V I E W S
It is obvious from Fig. 4 that for systems which have disturbances and noise it is not possible to use the least squares method to generate a satisfactorily accurate curve to the approximate system behavior. The length of the time sliding window in this example is eight data points, which is maximum for expanding in the algorithm shown in Fig. 2.
Already in this stage of investigation, the experiments show that smoothing spline approximation for various lengths of the time sliding window leads to almost identical predictions. In order to prove that fact a numerical experiment with the time sliding window length of 4, 5, 6, 7 and 8 data points is carried out.
The data for applying smoothing spline approximation for various lengths of the time sliding window and corresponding predictions are shown in table 1 and Fig. 4.
Obviously, the smoothing spline approximation is almost "insensitive" to non realistic oscillation in data and, the most important from the view of real time processing, the values of prediction practically do not depend on the time sliding window length.
The results of smoothing spline approximation based on the values from table 1 are shown in Fig. 5.

Conclusion
In this paper, the problem how to predict the development of signal from temperature sensors is realized using smoothing spline polynomial in the time sliding window. In this adaptive approach the difference between the predicted value from the model and the acquired value determines the length of the window for the best approximation and extrapolation (prediction). The greatest advantage of spline polynomials usage is that this method of prediction is totally independent of the time sliding window length. On the other hand, the application of functional analysis shows that all comparisons in the sense of vector calculus with various lengths of the time sliding window lead to almost identical values of parameters as relative difference, cosine, etc. Finally, the presented method is very fast and very convenient for real time programming.