Preprint
Article

Generalized Approach to Optimal Polylinearization for Smart Sensors and IoT Devices

This version is not peer-reviewed.

Submitted:

25 February 2024

Posted:

26 February 2024

You are already at the latest version

A peer-reviewed article of this preprint also exists.

Abstract
In this work, an innovative numerical approach for polylinear approximation (polylinearization) of non-self-intersecting compact sensor characteristics (transfer functions) specified either pointwise or analytically is introduced. The goal is to optimally partition the sensor characteristic, i.e. to select the vertices of the approximating polyline (approximant) along with their positions on, the sensor characteristics so that the distance (i.e. the separation) between the approximant and the characteristic is rendered below a certain problem-specific tolerance. To achieve this goal, two alternative non-linear optimization problems are solved, whose essential difference is in the adopted quantitative measure of the separation between the transfer function and the approximant. In the first problem, which relates to absolutely integrable sensor characteristics (their energy is not necessarily finite, but they can be represented in terms of convergent Fourier series), the polylinearization is constructed by numerical minimization of the L^1--metric (a distance-based separation measure), concerning the number of polyline vertices and their locations. In the second problem which covers the quadratically integrable sensor characteristics (whose energy is finite, but they do not necessarily admit a representation in terms of convergent Fourier series), the polylinearization is constructed by minimizing numerically the L^2-metric (area-, or energy-based separation measure) for the same set of optimization variables –the locations, and the number of polyline vertices.
Keywords: 
approximation; IoT; linearization techniques; piecewise approximation; polylinearization; recourse-constrained devices; smart sensors
Subject: 
Engineering  -   Electrical and Electronic Engineering

1. Introduction and Motivation

Linearization is a fundamental step in the initial processing of sensor input data. The presence of nonlinearities in the sensors can be mitigated by using electronic linearization schemes or algorithms [1,2]. These linearization methods can be categorized into three main classes, based on the type of their realization in the sensor devices:
  • Hardware-based linearization methods,
  • Software-based linearization methods,
  • Hybrid (hardware- and software-based) methods [3].
Hardware-based linearization methods, predominantly intended for analog sensor devices are usually implemented by including an analog circuit between the sensor and the analog-to-digital converter (ADC) [4,5].
Software-based linearization techniques require the use of (micro)computers or digital signal processors (DSPs) equipped with significant processing capabilities [6,7]. Applying these techniques in cost-effective controllers with limited computational resources poses significant challenges. Various software linearization methods have been considered in the literature, one of the most common being look-up table (LUT)-based linearization, which can be conveniently implemented on virtually any microcontroller [3,8].
The identification of the inverse sensor transfer function is often complex, mainly due to the challenge of choosing the appropriate analytical form of the function and the constraints on its parameterization. Such challenges can lead to inaccurate linearization of sensor characteristics. Typically, a sensor's inverse sensor transfer function is modeled using nonlinear regression techniques (e.g., polynomial, exponential, etc.), which are determined by minimizing the least squares error using statistically representative data sets [9,10].
Linearization approaches can also be viewed as dimensionality reduction methods while preserving shape [11]. In such methods, the inverse characteristic of the sensor is transformed into a polygonal form using techniques such as distance minimization or, when applicable, factorization of nonnegative matrices based on range and accuracy requirements as proposed in [12].
A common approach to mitigate the uncertainty inherent in nonlinear regression identification of sensor feedback is to segment its transfer function. This essentially involves approximating x = x ( y ) using a polygonal approximation with controlled approximation error. The algorithmic control proposed here plays a key role in supporting adaptive resource allocation.
This study is based on the methodology outlined in [13,14], which is used to adaptively linearize sensor transfer functions. This approach simplifies the design and improves the measurement accuracy of sensors and Internet of Things (IoT) devices, especially those with limited resources.
Piecewise linear approximation (PLA) for sensor data is a typical software approach used in data compression. Although various data compression methods exist, such as discrete wavelet transform [15], discrete Fourier transform [16], Chebyshev polynomials [17], piecewise aggregate approximation [18,19], and others, PLA remains one of the most widely used data compression methods, as confirmed in [20,21].
Although the origin of this approach dates to the mid-20th century, it has gained new relevance in recent years due to the widespread adoption of smart sensors and IoT devices. PLA is increasingly used in scenarios where data acquisition devices have limited local buffer space and communication bandwidth [22].
Due to the inherent resource limitations of data acquisition devices such as memory and communication capabilities, the need for data compression arises. The main criteria for assessing the quality of compression include the approximation error rate and the number of line segments [23].
PLA optimization typically involves two commonly used methods:
1. Introduction of an upper error bound ( Δ x ) and subsequent minimization of the number of line segments.
2. Determination of the number of line segments ( k ) required to construct a PLA with no more than k segments while minimizing the error ( Δ x ) .
The purpose of this paper is to explain how non-self-intersecting planar curves of finite length can be optimally polylinearized by connecting certain points on them by straight line segments (Figure 1).
It will be shown below that this problem can be solved as a series of distance/area minimization problems in which the same problem is solved repeatedly, namely: for a fixed pair of points (vertices) c i and c i + 2 on the curve (Figure 2a), determine the vertices c i + 1 , so that the polyline (in red) connecting c i , c i + 1 and c i + 2 is controllably far from the curve.
Crucial here is the choice of the measure of controllable remoteness between a polyline and a curve. The remoteness between two such objects can be estimated in different ways: for example, it can be calculated for each line segment separately, and then consider the polyline to be as far away from the curve as its furthest line segment (Figure 2b). Alternatively, remoteness can be measured in terms of the areas (energies) under the polyline and the curve. The smaller the area values, the closer the curve to the polyline (Figure 2c).

2. Materials and Methods

The approximation of given sensor transfer functions by polylines called in the following polylinearization, rests upon three central concepts: the curve segment, the (poly)line segment, and the measure of the remoteness between them. While the curve segment is a differential geometric concept, the polyline segment arises from a much more mundane issue: the need to approximate “in the best possible way” the curve segment by a compact straight line. Conceptually the process of polylinearization of a given sensor characteristic consists of three algebraic stages. The first (not a subject of the present work) is the representation of the sensor transfer function, i.e. the derivation of its algebraic equations from the physical principles. The second stage is the quantification of the remoteness between the curve and each of its approximating polyline segments. Finally, the third, and in many ways the most important one, is how to construct the polyline best fitting the entire curve, based on the measurement of the remoteness between the curve and the line segments building that polyline.
In this context, this section is an introduction to the instrumentation we will use later on with the following key notions and procedures covered:
  • Rectifiable simple curve; curve segment and its approximating (poly)line segment.
  • Measure the remoteness between a curve segment and the corresponding line segment.
  • Measure the remoteness between the curve and the entire polyline.
  • Fitting a polyline to a curve by solving a proximity-controlled area-minimization problem for the vertices of the polyline.
Adhering to this list, we organize the text of that section as follows:
  • First, we introduce the concepts of a simple rectifiable curve and a curve segment between any two distinct points (also called nodes) on it.
  • Second, we characterize in parametric form the polyline segment between the same two points and introduce the measure of its remoteness from the curve.
  • An open chain of connected line segments builds a polyline (a broken line graph), whose proximity to the curve we estimate next in terms of the corresponding distance- and area-related measures. These are nothing but measures of remoteness that non-smoothly tend to zero as the polyline approaches the curve.
  • Finally, we formulate the area-minimization problem with a constraint expressed in terms of a particular remoteness measure; its solution, within the margin of the user-specified tolerance, provides us with the controllable polylinearization of the curve.
At the end of the section, the details of a concrete application of the above general scheme to the practical problem of polylinearization of plane curves are discussed. Here, instead of solving analytically the constrained minimization problem - which was an active topic of research in the 1980s - its (stable and consistent) discrete approximation is solved [24].

2.1. Linearization and Polylinearization Costs

The position (point) in space is indicated by bold lowercase italic letters, such as c , b , y , etc.
Let's start with the concepts of curve and curve segment: also, given the subset S R and the natural number, n 2 . For s S , we call the vector-valued map,
c ^ : S R n , a parametrized curve immersed in R n and write c = c ^ ( s ) for the points c on the curve. A curve, c = c ^ ( s ) is called simple if it does not intersect itself, and rectifiable if it has a finite length. Furthermore, if c ^ ( s ) is rectifiable then it is at least of class C 1 ( S ) and hence regular. In the following, we deal with simple, rectifiable curves. Set next S = [ T l w , T u p ] and focus on a particular segment S ( i ) = s i , s i + 1 S with i P . The image,
c ( i ) : c ^ ( s ) R n ,         s S ( i )
is called the curve segment, starting at c i = c ^ ( s i ) and ending at c i + 1 = c ^ ( s i + 1 ) . Let’s clarify next what we mean by a line segment, attached to a curve segment c ( i ) . For this purpose, we introduce the affine map,
λ = λ ^ s = s s i s i + 1 s i ,
with domain s S ( i ) and image λ [ 0,1 ] . Clearly at s = s i , λ = 0 , and at s = s i + 1 we have λ = 1 .
The line segment, l ( i ) , attached to c ( i ) at c i and c i + 1 is defined by,
l ( i ) : l ^ ( s ) R n ,         s S ( i )   ,
where
l ^ ( s ) = ( 1 λ ^ ( s ) ) c i + λ ^ ( s ) c i + 1   .
How close are l ^ ( s ) and c ^ ( s ) to each other on [ s i , s i + 1 ] ? To estimate their proximity we introduce the measure,
E ( i ) = E ^ S ( i ) = c ^ ( s ) l ^ ( s ) L 2 S ( i )   ,
and refer to it as the linearization cost on S ( i ) . In this expression, the L 2 -norm, of the difference, Δ ^ ( s ) = c ^ ( s ) l ^ ( s )   , is,
E ( i ) = Δ ^ ( s ) L 2 S ( i ) = S ( i ) c ^ ( s ) l ^ ( s ) 2 d s 1 / 2 = s i s i + 1 c ^ ( s ) l ^ ( s ) 2 d s 1 / 2   ,
with | x | = x x , for x R n .
The notion of linearization cost - essentially localized in S ( i ) - allows easy extension to the entire domain S . Accordingly, let P = s i i = 1 n P be an ascendant partition of S , furnished by the nodes s i i = 1 n P , and such that s i < s i + 1 for i = 1,2 , 3 , . . . , n P 1 . We call mesh the union,
S = i = 1 n S S ( i ) ¯ = S ,           S ( i ) = s i , s i + 1 ,           n S = n P 1 ,
of subdomains, S ( i ) , i.e. the union of bounded, closed sets, with nonempty interior. Extending, the concept of linearization cost from a single line to a polyline we introduce the L 2 -norm,
E = i = 1 n S S ( i ) c ^ ( s ) l ^ ( s ) 2 d s 1 / 2 = c ^ ( s ) l ^ ( s ) L 2 S ,
on S , which shall be referred to in the following as the polylinearization cost. Here,
l ^ S ( 1 ) l ^ S n S = ,         l ^ S ( i ) l ^ S ( i + 1 ) = l ^ s i ,         i = 1,2 , 3 , . . . , n S 1   .
In other words, l ^ ( s ) is the polyline on S , consisting of an open chain of line segments, l ( i ) , with the end of each previous segment serving as the beginning of the next.
Consider further the question of the existence of an optimal polylinearization. Focus first on the case of fixed n P (and hence n S ). To answer that question, beginning from the observation,
E = i = 1 n S Δ ^ ( s ) L 2 ( S ( i ) ) 2 1 / 2 = Δ ^ ( s ) L 2 S   ,
and notice, that
Δ ^ ( s ) L 1 ( S ( i ) ) h S Δ ^ ( s ) L 2 ( S ( i ) ) h S Δ ^ ( s ) L 2 ( S ( i ) ) 2   ,
with h S = m a x i { | S ( i ) | } called the characteristic size of the mesh. On another side, the inequality
Δ ^ ( s ) L 2 ( S ( i ) ) Δ ^ ( s ) L 1 ( S ( i ) )  
implies the estimate
Δ ^ ( s ) L 2 ( S ) Δ ^ ( s ) L 1 ( S )   , w i t h         Δ ^ ( s ) L 1 ( S ) = i = 1 n S Δ ^ ( s ) L 1 ( S ( i ) )
Hence, the area error Δ ^ ( s ) L 1 ( S ) is constrained to lie between the following two bounds:
E Δ ^ ( s ) L 1 ( S ) n S h S E 2 ,
expressed in terms of the polylinearization cost E , the fixed number of line segments n S and the characteristic mesh size h S . Since the curve is simple and rectifiable, this inequality expresses mathematically the two conditions for the existence of an optimal polylinearization, viz:
a)
For a fixed domain S , there exists such n S , that E and the total area error attain their minima.
b)
For a fixed domain S , there exists such h S , that E and the total area error attain their minima.
Regarding a), indeed, an increase of n S decreases h S and E , which in turn, due to the above inequality, implies a decrease in the total area error Δ ^ ( s ) L 1 ( S ) . Analogously, for b), a decrease of h S increases n S and decreases E , which in turn implies a decrease in the total area error Δ ^ ( s ) L 1 ( S ) .
Therefore, among all admissible nodal locations P = s i i = 1 n P , and their associated meshes S there exists at least one, which we designate by P P * , which minimizes the polylinearization cost E and consequently reduces the total area error. Designate next, the mesh associated with this partitioning by S P * , and notice that if S P * minimizes E ^ ( S ) it will be also the minimizer of the squared polylinearization cost
P = P ^ S = 1 2 E ^ S 2 = 1 2 E ^ 2 S ,
which constitutes a quadratic objective function in the nonlinear problem for optimal polylinearization of rectifiable, planar curves, formulated in the next section. Furthermore, for the range of the total area error we now have the estimate
Δ ^ ( s ) L 1 ( S P * ) 2 P * ,         2 n S P * h S P * P *   ,         P * = P ^ ( S P * ) .
Alternatively, let P A * and S A * be the partition and the associated mesh minimizing the total squared area error
A ( S ) = 1 2 Δ ^ ( s ) L 1 ( S ) 2   .
In general, P A * P P * , and hence S A * S P * . Furthermore, for the range of the associated polylinearization cost we analogously have the estimate,
E S A * 1 2 n S A * h S A * A * ,         A * ,         A * = A ^ ( S A * ) .
In other words, whichever error we choose to minimize, the other one will be minimized too.

2.2. Remoteness Measures

If n P is fixed, we will not get controllably close to the polyline by node reallocation alone, as we also need a mechanism to introduce ("inject") more nodes where it is most necessary. For that to happen, we need one more concept, or more precisely, an n P -dependent, generalized measure of distance, which we call remoteness measure. Why introduce yet another measure? The reason is primarily epistemological. The optimal polylinearization of a curve consists of two sub-problems: the first is related to "injecting" nodes where they are needed, and the second is related to reallocating these nodes to the positions where they are needed. The latter of these problems has already been addressed. Below we discuss the former.
Intuitively, an object is as close to another object as its farthest parts are. When the objects are a curve and a polyline, it is natural to ask whether there is a way to estimate how close the farthest segments of the curve and polyline are to each other. The answer to this question is affirmative, and below we present (with its purpose and merits) a quantitative measure of the distance between a curve and a polyline based on the largest distance between their building components. As it will become also clear, the remoteness is an upper bound on E ^ ( S ) , and depends on the number of nodes, n P . The latter is crucial as it provides us with the tool to directly influence E ^ ( S ) by modifying its upper bound, or equivalently, by modifying n P . Furthermore, since the remoteness operates on the line segments furthest from the curve, it will also serve as an identifier of these S ( i ) in which it is feasible to "inject" more nodes.
Under remoteness measure of order p , associated with the mesh S , we will understand the limit
R ( p ) ( S ) = s u p S { E ^ ( p ) ( S ) }   ,
and shall be interested in calculating it for two particular choices of p , corresponding to:
- the surface remoteness, determined for p = 1 , as the least upper bound,
R ( 1 ) ( S ) = s u p S { E ^ ( 1 ) ( S ) } = m a x S ( i ) S Δ ^ ( s ) L 1 ( S ( i ) ) = m a x i = 1,2 , 3 , . . . , n S E 1 ( i ) ,
with geometric interpretation assisted by Figure 3a, and E 1 ( i ) = Δ ^ ( s ) L 1 ( S ( i ) ) .
the gap, determined for p = , and calculated as the largest distance,
R ( ) ( S ) = s u p S { E ^ ( ) ( S ) } = m a x S ( i ) S Δ ^ ( s ) L ( S ( i ) ) = m a x i = 1,2 , 3 , . . . , n S E ( i ) , E ( i ) = e s s   s u p s S ( i ) Δ ^ ( s )   ,
with geometric interpretation assisted by Figure 3b, and E ( i ) = Δ ^ ( s ) L ( S ( i ) ) .
For the mesh path S = S ( i ) S ( i + 1 ) in Figure 3, the surface remoteness is
R 1 ( S ) = max Δ ^ ( s ) L 1 ( S ( i ) ) ,   Δ ^ ( s ) L 1 ( S ( i + 1 ) )
Alternatively, the gap satisfies
R ( S ) = max Δ ^ ( s ) L ( S ( i ) ) ,   Δ ^ ( s ) L ( S ( i + 1 ) )
Whatever the choice of p , however, the behavior of either R ( ) or R ( 1 ) is always the same, namely: the smaller the remoteness measure for a given mesh S , the closer l ^ s is to c ^ ( s ) . Locally Euclidean manifolds, to which our rectifiable simple curves belong, are better polylinearizable by finer meshes. In the following, we justify this intuitive understanding as deductively correct and show that the remoteness measures (objects inversely proportional to the number of nodes n P ) provide upper bounds on, E ^ ( S ) (an object dependent on node locations). Increasing n P will decrease the remoteness between l ^ s and c ^ ( s ) . In turn, since the remoteness is an upper bound on E ^ ( S ) , by increasing n P we will further reduce the cost of polylinearization. Let us show this for R ( 1 ) ( S ) . Analogous argumentation can be followed for R ( ) ( S ) . Recall from the previous section that
  E Δ ^ ( s ) L 1 ( S )
but
Δ ^ ( s ) L 1 ( S ) n S m a x S i S Δ ^ s L 1 S i = n S R 1 S ,
and hence,
E n S R ( 1 ) ( S )   .
Since R ( 1 ) ( S ) tends to 0 at a rate proportional to 1 / n P and n P = n S + 1 it therefore follows, that E tends to 0 at a rate proportional to 1 / n S , and hence increasing n S decreases E as well, which was necessary to show.

2.3. Optimal Polylinearization of Curves

From all possible meshes S , we are interested in calculating the one, say S * , which minimizes the squared polylinearization cost P ( S ) and decreases R ( p ) ( S ) , below certain user-defined, tolerance, T O L . Such an objective is therefore twofold: on the one hand, it is related to computing the optimal node locations (topology) P * in S * , and on the other hand, it is related to determining the optimal number of nodes, n P * in P * . A possible formulation of the problem targeting this objective is:
Given c = c ^ ( s ) on S = [ T l w , T u p ] and the initial mesh S 0 = [ T l w , T u p ] , determine the optimal mesh S * by solving the minimization problem,
S * A R G M I N S A c ^ ( p ) ( S )   P ( S )   ,
Subject to the remoteness-control, S A c ^ ( p ) ( S ) , with
A c ^ ( p ) ( S ) = S     R ( p ) ( S ) T O L   ,         R ( p ) ( S ) = s u p S { E ^ ( p ) ( S ) }   .
for p = 1 or p = .
Remarks:
a)
This problem will be denoted as the optimal polylinearization.
b)
Control over the nodal locations is enforced by an essential minimization problem for the polylinearization cost, while control over the number of nodes is realized by the corresponding remoteness measure.
c)
The minimization problem is quadratic, while the remoteness control is not, defined by the corresponding L p -norm, in which p is not equal to 2 . Although qualitatively the remoteness measures behave in the same way - the larger the measure, the more distant the polyline and the curve - quantitatively they differ. Thus, different choices for p , will result in different optimal solutions S * .
d)
We, therefore, propose the polyline to be always calculated by minimization of polylinearization cost but to interpret particular solutions as optimal only in the context of the imposed remoteness measure.
e)
The constrained minimization problem admits vectorial interpretation, because P * which corresponds to S * , is a vector, whose cardinality n P = n P * and nodal locations, { s i * } i = 1 n P * are its solutions, as well.
There are cases where solving the vector minimization problem from the previous section can be effectively reduced to solving a sequence of scalar minimization problems. In this subsection, we consider just such a situation - the polylinearization of rectifiable planar curves. At the onset, fix the origin 0 and introduce the canonical basis e k k = 1 2 in R 2 . Let
c ^ ( s ) = c ^ 1 ( s ) e 1 + c ^ 2 ( s ) e 2   ,         | e k | = 1 ,   e k e k = 0 ,   k , m = 1,2 ;
be the equation of the curve for s S = [ 0 , T ] . Set next, c ^ 1 ( s ) = s and c ^ 2 ( s ) = y = y ^ ( s ) , with y ^ ( s ) C 1 ( S ) known. For naturally parametrized planar curves alike, the minimization problem from the previous section reads.
Given y = y ^ ( s ) on S = [ T l w , T u p ] and the initial mesh S 0 = [ T l w , T u p ] , determine the optimal mesh S * by solving the optimization problem of planar polylinearization,
S * A R G M I N S A y ^ ( p ) ( S )   1 2 P ^ ( S )   ,         P ^ ( S ) = E ^ ( S ) 2   ,
with constraint
A c ^ ( p ) ( S ) = S     R ( p ) ( S ) T O L   ,         R ( p ) ( S ) = s u p S { E ^ ( p ) ( S ) }   .
In what follows, we will be interested in calculating S * for p = 1 .
The separate contributions to this minimization problem are as follows,
-
typical, planar line segment, l ^ s , on S ( i ) = [ s i , s i + 1 ] , has the representation
l ( i ) = l ^ s = s i + 1 s s i + 1 s i y i s s i s i + 1 s i y i + 1 ,         y i = y ^ ( s i ) , y i + 1 = y ^ ( s i + 1 ) . ,         s S ( i ) = [ s i , s i + 1 ] ,
-
the linearization cost of l ( i ) , denoted by E ( i ) , is
E ( i ) = E ^ S ( i ) = Δ ^ ( s ) L 2 ( S ( i ) ) = s i s i + 1 Δ ^ ( s ) 2 d s 1 / 2   ,         Δ ^ ( s ) = y ^ ( s ) l ^ s   .
the polylinearization cost, E ^ ( S ) , is E ^ ( S ) = i = 1 n S E ( i ) 2 1 / 2   ,
the surface remoteness is, R ( 1 ) ( S ) = m a x S ( i ) S Δ ^ ( s ) L 1 ( S ( i ) ) .
Instead of readily using Lagrangian multiplier to enforce the proximity control on P ( S ) we will approach the solution in a slightly different way. Initialize first the optimal partition P * and the optimal mesh S * by accordingly setting: P * { } , S * [ ] . The initial partition, P 0 = s i ( 0 ) i = 1 2 = { T l w , T u p } with, s 1 ( 0 ) T l w and s 2 ( 0 ) T u p is known and fixed. Consider next a nodal patch, P ~ = { s i } i = 1 3 , obtained from P 0 by adding a node, s 2 , of yet unknown location, but between s 1 ( 0 ) and s 2 ( 0 ) so that, s 1 s 1 ( 0 ) , s 3 s 2 ( 0 ) and s 1 s 2 s 3 . With the mesh patch, S ~ , instilled by P ~ , the vector minimization problem with the objective function, P ^ ( S ~ ) , transforms into a scalar minimization problem for s 2 with objective function P ^ ( s 2 ) , and constraints, s 1 s 2 s 3 .
Designate the solution of this minimization problem by s 2 * and the corresponding optimal nodal patch by P ~ * = { s 1 , s 2 * , s 3 } . The optimal partition, P * , is next updated with this patch so that, P * P ~ * . The split node, s 2 * , now divides S into two subdomains: S ( 1 ) = [ s 1 , s 2 * ] and S ( 2 ) = [ s 2 * , s 3 ] , so that the current mesh instilled by P * is analogously calculated through the update S * S ~ * , and consists of S * = S ( 1 ) S ( 2 ) . Furthermore, once determined, the mesh S * allows us to compute E ^ ( S * ) and compare it with TOL. If E ^ ( S * ) < T O L , we are done, otherwise if E ^ ( S * ) > T O L , we need to add more nodes between T l w   and T u p , and compute their location by constrained minimization. Suppose the latter happened.
In which of the subdomains S ( 1 ) or S ( 2 ) to add new split node(s)? On the one hand, we do not want to add unnecessarily many nodes, on the other we do not want to add too few. The former requires more storage space while the latter requires more computational time. Let’s agree to add no more than one node per interval and focus on how to select the appropriate interval. The reliable selection criterion is provided by the largest surface remoteness, determined over the current set of subdomains in the mesh, i.e. the candidate subdomains for splitting are those whose surface remoteness is the largest, or
S ( k ) k = 1 n s p l i t = a r g   m a x i = 1,2 , 3 , . . . , n S * Δ ^ ( s ) L 1 ( S ( i ) )   .
In our particular case, P * splits S into two subdomains with surface remotenesses
R 1 1 = y ^ s l ^ s L 1 S 1   , s S 1   , R 2 ( 1 ) = y ^ ( s ) l ^ s L 1 S ( 2 )   , s S ( 2 )   .
Assume for the sake of clarity that the S ( i ) whose R i ( 1 ) is the largest corresponds to S ( 2 ) , and overwrite P 0 = s i ( 0 ) i = 1 2 , by s 1 ( 0 ) s 2 * and s 2 ( 0 ) s 3 .
Analogous to what we did before, construct P ~ from P 0 by allocating a node, s 2 between s 1 ( 0 ) and s 2 ( 0 ) so that for P ~ = { s i } i = 1 3 , we again have s 1 s 1 ( 0 ) , s 3 s 2 ( 0 ) , and s 1 s 2 s 3 . Consider s 2 unknown and determine it by constrained minimization of P ^ ( s 2 ) , thus updating the optimal nodal patch
P ~ * = { s 1 , s 2 * , s 3 }
and the mesh patch,
S ~ * = [ s 1 , s 2 * ] [ s 2 * , s 3 ] .
Further, with P ~ * and S ~ * yet updated, we update the optimal partition and the optimal mesh: P * P ~ * , S * S ~ * , so that
P ~ * = { s 1 * , s 2 * , s 3 * , s 4 * } = { s i * } i = 1 4   , S ~ * = i = 1 3 [ s i * , s i + 1 * ] .
Once we have S * , we compute again E ^ ( S * ) and compare it with T O L . If E ^ ( S * ) < T O L we stop the computation, otherwise we repeat again the surface-remoteness-based approach for the selection of the next candidate subdomain for splitting. In the above procedure, it is easy to notice that: first, the sequence of points s * is generated as a solution to the corresponding sequence of constrained minimization problems for the unknown s 2 ; and second, each minimization problem in this sequence is solved over a subdomain with fixed ends.
The main steps of the developed algorithm are shown in Figure 4.

3. Results

The polylinearization of typical nonlinear sensor transfer functions concerning L 2 and L   norm is discussed:
- second-degree polynomials that are often used in approximating the transfer functions of resistive sensors;
- third-degree polynomials with inflection points;
- the Callender - van Dusen equation;
- higher degree polynomials, which are used in the approximation of thermocouples.
Along with the polylinearization of sensor transfer functions, the polylinearization of functions and distributions commonly used in scientific research is considered. Examples are given here:
- Dirac function;
- Weibull distribution.
Figure 5. Polylinearization of y = a 2 s 2 + a 1 s + a 0 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition     P 1 *
Figure 5. Polylinearization of y = a 2 s 2 + a 1 s + a 0 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition     P 1 *
Preprints 99803 g005
Figure 6. Polylinearization of y = a 2 s 2 + a 1 s + a 0 with respect to L norm. (a) First partition P 1 ; (b) Final partition     P 1 * .
Figure 6. Polylinearization of y = a 2 s 2 + a 1 s + a 0 with respect to L norm. (a) First partition P 1 ; (b) Final partition     P 1 * .
Preprints 99803 g006
Figure 7. Polylinearization of y = a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 50 * .
Figure 7. Polylinearization of y = a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 50 * .
Preprints 99803 g007
Figure 8. Polylinearization of y = a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 7 * .
Figure 8. Polylinearization of y = a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 7 * .
Preprints 99803 g008
Figure 9. Polylinearization of y = a 1 1 + a 2 s + a 3 s 2 + a 4 s 100 s 3 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 4 * .
Figure 9. Polylinearization of y = a 1 1 + a 2 s + a 3 s 2 + a 4 s 100 s 3 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 4 * .
Preprints 99803 g009
Figure 10. Polylinearization of y = a 1 1 + a 2 s + a 3 s 2 + a 4 s 100 s 3 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 3 * .
Figure 10. Polylinearization of y = a 1 1 + a 2 s + a 3 s 2 + a 4 s 100 s 3 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 3 * .
Preprints 99803 g010
Figure 11. Polylinearization of y = a 5 s 5 + a 4 s 4 + a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 11 * .
Figure 11. Polylinearization of y = a 5 s 5 + a 4 s 4 + a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 11 * .
Preprints 99803 g011
Figure 12. Polylinearization of y = a 5 s 5 + a 4 s 4 + a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 5 * .
Figure 12. Polylinearization of y = a 5 s 5 + a 4 s 4 + a 3 s 3 + a 2 s 2 + a 1 s + a 0 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 5 * .
Preprints 99803 g012
Figure 13. Polylinearization of y = a 1 π s 2 + a 1 2 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 9 * .
Figure 13. Polylinearization of y = a 1 π s 2 + a 1 2 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 9 * .
Preprints 99803 g013
Figure 14. Polylinearization of y = a 1 π s 2 + a 1 2 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 6 * .
Figure 14. Polylinearization of y = a 1 π s 2 + a 1 2 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 6 * .
Preprints 99803 g014
Figure 15. Polylinearization of y = a 1 a 2 s a 2 a 1 1 exp s a 2 a 1 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 6 * .
Figure 15. Polylinearization of y = a 1 a 2 s a 2 a 1 1 exp s a 2 a 1 with respect to L 2 norm. (a) First partition P 1 ; (b) Final partition P 6 * .
Preprints 99803 g015
Figure 16. Polylinearization of y = a 1 a 2 s a 2 a 1 1 exp s a 2 a 1 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 4 * .
Figure 16. Polylinearization of y = a 1 a 2 s a 2 a 1 1 exp s a 2 a 1 with respect to L norm. (a) First partition P 1 ; (b) Final partition P 4 * .
Preprints 99803 g016

4. Conclusions

Generally, the term "polylinearization" suggests a mathematical process used to model and compensate for non-linear behavior in sensors or devices. When sensors or IoT devices produce non-linear responses, it can be challenging to obtain accurate measurements and data. Polylinearization techniques involve the application of mathematical functions to transform the sensor's output into a linear relationship with the input, thus significantly improving the measurement accuracy.
This paper discusses the optimal polylinearization of non-self-intersecting planar curves of finite length by connecting certain points on them by straight line segments. The problem can be solved as a series of constrained distance/area minimization problems, where the same issue is resolved repeatedly. The choice of the measure of controllable remoteness between a polyline and a curve is crucial, as it can be estimated in different ways. The polylinearization process consists of three algebraic stages: representing the sensor transfer function, quantifying the remoteness between the curve and its approximating polyline segments, and constructing the polyline best fitting the entire curve based on the measurement of the remoteness between the curve and the line segments building that polyline. The work introduces the concepts of a simple rectifiable curve and a curve segment between any two distinct points, characterizes the polyline segment in parametric form, builds a polyline, and estimates its proximity to the curve in terms of distance- and area-related measures. The area-minimization problem is solved with a constraint expressed in terms of a particular remoteness measure, providing the controllable polylinearization of the curve.
This work discusses a new concept of linearization and polylinearization costs in the context of curves and curve segments. It begins with the definition of a vector-valued map, a parametrized curve, and its properties. Line segments attached to a curve segment are defined by the affine map with domain and image. The linearization cost on a line segment is used to estimate their proximity. The concept of linearization cost extends to the entire domain, allowing easy extension to the union of subdomains. The polylinearization cost is the linearization cost from a single line to a polyline, consisting of an open chain of line segments. The text also discusses the existence of an optimal polylinearization, focusing on fixed domains and the characteristic mesh size. The inequality expresses the conditions for an optimal polylinearization, stating that for a fixed domain, the total area error attains its minima.

Author Contributions

conceptualization, M.B.M., and S.D.; methodology, S.D. and M.B.M., software, S.D.; investigation, S.D.; resources, S.D. and M.B.M.; writing—original draft preparation, M.B.M., and S.D.; writing—review and editing, M.B.M.; visualization, S.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research is supported by the Bulgarian National Science Fund in the scope of the project “Exploration of the application of statistics and machine learning in electronics” under contract number KП-06-H42/1.

Acknowledgments

The authors would like to thank the Research and Development sector at the Technical University of Sofia for the financial support.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. M. Attari, "Methods for linearization of non-linear sensors," in Proceedings of CMMNI-4, 1993.
  2. J. M. D. Pereira, O. Postolache and P. M. B. S. Girao, "PDF-Based Progressive Polynomial Calibration Method for Smart Sensors Linearization," IEEE Transactions on Instrumentation and Measurement, vol. 58, no. 9, pp. 3245-3252, Sept. 2009. [CrossRef]
  3. H. Erdem, "Implementation of software-based sensor linearization algorithms on low-cost microcontrollers," ISA Transactions, vol. 49, no. 4, pp. 552-558, 2010. [CrossRef]
  4. C. Johnson, Process control instrumentation technology 8th ed., Pearson Education Limited, 2013.
  5. H. Lundström and M. Mattsson, "Modified Thermocouple Sensor and External Reference Junction Enhance Accuracy in Indoor Air Temperature Measurements," Sensors, 2021. [CrossRef]
  6. M. Marinov, S. Dimitrov, T. Djamiykov and M. Dontscheva, "An Adaptive Approach for Linearization of Temperature Sensor Characteristics," in Proceedings of the 27th International Spring Seminar on Electronics Technology, ISSE 2004, Bankya, Bulgaria, 2004.
  7. J. Šturcel and M. & Kamenský, "Function approximation and digital linearization in sensor systems," AT&P journal, pp. 13-17, 2006.
  8. Flammini, D. Marioli and A. Taroni, "Transducer output signal processing using an optimal look-up table in microcontroller-based systems," Electronics Letters, vol. 33, no. 14, pp. 552-558, 2010. [CrossRef]
  9. T. Islam and S. Mukhopadhyay, "Linearization of the sensors characteristics: a review," International Journal on Smart Sensing and Intelligent Systems, vol. 12, no. 1, pp. 1-21, 2019.
  10. G. van der Horn and J. Huijsing, Integrated Smart Sensors: Design and Calibration, New York: Springer, 2012.
  11. K. Berahmand, M. Mohammadi, F. Saberi-Movahed, Y. Li and Y. Xu, "Graph Regularized Nonnegative Matrix Factorization for Community Detection in Attributed Networks," IEEE Transactions on Network Science and Engineering, vol. 10, no. 1, pp. 372-385, Jan.-Feb. 2023. [CrossRef]
  12. E. Nasiri, K. Berahmand and Y. Li, "Robust graph regularization nonnegative matrix factorization for link prediction in attributed networks," Multimed Tools Appl, vol. 82, no. 3, p. 3745–3768, 2023. [CrossRef]
  13. M. Marinov, N. Nikolov, S. Dimitrov, T. Todorov, Y. Stoyanova and G. Nikolov, "Linear Interval Approximation for Smart Sensors and IoT Devices," Sensors, vol. 22, no. 3, February-1, 2022. [CrossRef]
  14. F. Grützmacher, B. Beichler, A. Hein, T. Kirste and C. Haubelt, "Time and Memory Efficient Online Piecewise Linear Approximation of Sensor Signals," Sensors, vol. 18, no. 1672, 2018. [CrossRef]
  15. Popivanov and R. J. Miller, "Similarity search over time series data using wavelets," in Proc. IEEE International Conference on Data Engineering, 2002.
  16. D. Rafiei, "On similarity-based queries for time series data," in Proc. IEEE International Conference on Data Engineering, 1999.
  17. Y. Cai and R. Ng, "Indexing spatio-temporal trajectories with Chebyshev polynomials," in Proc. ACM SIGMOD International Conference on Management of Data, 2004.
  18. B. Yi and C. Faloutsos, "Fast time sequence indexing for arbitrary lp norms," in Proc. International Conference on Very Large Data Bases, 2000.
  19. G. Luo, K. Yi, S. Cheng, Z. Li, W. Fan, C. He and Y. Mu, "Piecewise linear approximation of streaming time-series data with max-error guarantees," in Proceedings of the 2015 IEEE 31st International Conference on Data Engineering (ICDE), Seoul, Korea, 2015.
  20. T. Palpanas, M. Vlachos, E. Keogh, D. Gunopulos and W. Truppel, "Online amnesic approximation of streaming time series," in Proc. IEEE International Conference on Data Engineering, 2004.
  21. Q. Chen, L. Chen, X. Lian, Y. Liu and J. X. Yu, "Indexable PLA for efficient similarity search," in Proc. International Conference on Very Large Data Bases, 2007.
  22. S. H. Cameron, "Piece-wise linear approximations, DTIC Document, Tech. Rep.," 1966.
  23. M. Marinov, N. Nikolov, S. Dimitrov, B. Ganev, G. Nikolov, Y. Stoyanova, T. Todorov and L. Kochev, "Linear Interval Approximation of Sensor Characteristics with Inflection Points," Sensors, vol. 23, no. 2933, pp. 1-16, 2023. [CrossRef]
  24. E. Fuchs, T. Gruber, J. Nitschke and B. Sick, "Online segmentation of time series based on polynomial least-squares approximations," IEEE Trans. Pattern Anal. Mach. Intell., vol. 32, p. 2232–2245, 2010. [CrossRef]
Figure 1. (a) Smooth sensor transfer function; (b) Polylinearization of the sensor transfer function, the approximating polyline, together with its vertices shown in red.
Figure 1. (a) Smooth sensor transfer function; (b) Polylinearization of the sensor transfer function, the approximating polyline, together with its vertices shown in red.
Preprints 99803 g001
Figure 2. (a) Polyline through c i ,   c i + 1 and c i + 2 ; (b) Distance-based remoteness - a sensor transfer characteristics and a polyline are as far away from each other, as the largest projected distance, d = m a x { d i ,   d i + 1 } ; (c) Area-based remoteness – polyline is as far away from the sensor curve as the area is close to the area (overlapped by in ? is the most, and therefore not fully visible).
Figure 2. (a) Polyline through c i ,   c i + 1 and c i + 2 ; (b) Distance-based remoteness - a sensor transfer characteristics and a polyline are as far away from each other, as the largest projected distance, d = m a x { d i ,   d i + 1 } ; (c) Area-based remoteness – polyline is as far away from the sensor curve as the area is close to the area (overlapped by in ? is the most, and therefore not fully visible).
Preprints 99803 g002
Figure 3. (a) Illustrations of the concept of remoteness measure for mesh patch S = S ( i ) S ( i + 1 ) : (a) R 2 S equals the largest of the differences in the areas under the curve segments and their approximating linear segments; (b) R ( ) ( S ) equals the largest of the distances between the curve segments and their approximating linear segments.
Figure 3. (a) Illustrations of the concept of remoteness measure for mesh patch S = S ( i ) S ( i + 1 ) : (a) R 2 S equals the largest of the differences in the areas under the curve segments and their approximating linear segments; (b) R ( ) ( S ) equals the largest of the distances between the curve segments and their approximating linear segments.
Preprints 99803 g003
Figure 4. Flow chart of the developed algorithm.
Figure 4. Flow chart of the developed algorithm.
Preprints 99803 g004
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.

Downloads

77

Views

22

Comments

0

Subscription

Notify me about updates to this article or when a peer-reviewed version is published.

Email

Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2025 MDPI (Basel, Switzerland) unless otherwise stated