सवित्स्की-गोले फ़िल्टर को जिस तरह से व्युत्पन्न किया गया है (यानी स्थानीय कम-वर्ग बहुपद फिट बैठता है) के कारण, गैर-वर्दी नमूनाकरण के लिए एक प्राकृतिक सामान्यीकरण है - यह सिर्फ अधिक कम्प्यूटेशनल रूप से महंगा है।
सविट्ज़की-गॉले फिल्टर जनरल में
y0…y4Ac=y
⎡⎣⎢⎢⎢⎢⎢⎢⎢−20−10001020−21−11011121−22−12021222⎤⎦⎥⎥⎥⎥⎥⎥⎥⎡⎣⎢c0c1c2⎤⎦⎥=⎡⎣⎢⎢⎢⎢⎢⎢y0y1y2y3y4⎤⎦⎥⎥⎥⎥⎥⎥.
In the above, the c0…c2 are the unknown coefficients of the least squares polynomial c0+c1x+c2x2. Since the value of the polynomial at x=0 is just c0, computing the pseudoinverse of the design matrix (i.e. c=(ATA)−1ATy ) will yield the SG filter coefficients in the top row. In this case, they would be
⎡⎣⎢c0c1c2⎤⎦⎥=⎡⎣⎢−3−7512−4−3170−5124−3−375⎤⎦⎥⎡⎣⎢⎢⎢⎢⎢⎢y0y1y2y3y4⎤⎦⎥⎥⎥⎥⎥⎥.
Note that since the derivative of c0+c1x+c2x2 is c1+2c2x, the second row of the matrix (which evaluates c1) will be a smoothed derivative filter. The same argument applies for successive rows--they give smoothed higher-order derivatives. Note that I scaled the matrix by 35 so the first row would match the smoothing coefficients given on Wikipedia (above). The derivative filters each differ by other scaling factors.
Nonuniform Sampling
When the samples are evenly spaced, the filter coefficients are translation-invariant, so the result is just an FIR filter. For nonuniform samples, the coefficients will differ based on the local sample spacing, so the design matrix will need to be constructed and inverted at each sample. If the nonuniform sample times are xn, and we construct local coordinates tn with each center sample time fixed at 0, i.e.
t−2t−1t0t1t2=x−2−x0=x−1−x0=x0−x0=x1−x0=x2−x0
then each design matrix will be of the following form:
A=⎡⎣⎢⎢⎢⎢⎢⎢⎢t0−2t0−1t00t01t02t1−2t1−1t10t11t12t2−2t2−1t20t21t22⎤⎦⎥⎥⎥⎥⎥⎥⎥=⎡⎣⎢⎢⎢⎢⎢⎢⎢11111t−2t−10t1t2t2−2t2−10t21t22⎤⎦⎥⎥⎥⎥⎥⎥⎥.
The first row of the pseudoinverse of A dotted with the local sample values will yield c0, the smoothed value at that sample.