Savitzky-Golay smoothing filter for nonuniformly spaced data Implementation based on https://dsp.stackexchange.com/questions/1676/savitzky-golay-smoothing-filter-for-not-equally-spaced-data