Low-Complexity Piecewise-Affine virtual sensors: theory and design