We propose the construction of a mixing filter for the detection of analytic singularities and an auto-adaptive spectral approximation of piecewise analytic functions, given either spectral or pseudo-spectral data, without knowing the location of the singularities beforehand. We define a polynomial frame with the following properties. At each point on the interval, the behavior of the coefficients in our frame expansion reflects the regularity of the function at that point. The corresponding approximation operators yield an exponentially decreasing rate of approximation in the vicinity of points of analyticity and a near best approximation on the whole interval. Unlike previously known results on the construction of localized polynomial kernels, we suggest a very simple idea to obtain exponentially localized kernels based on a general system of orthogonal polynomials, for which the Cesàro means of some order are uniformly bounded. The boundedness of these means is known in a number of cases, where no special function properties are known.