It looks to me like you have a granularity problem. Four dots as a sample can fit a lot of functions, with intermediate datapoints from increased sampling rates you could then use fft to get good sine waves, for example.
You can code fft.c then call it using the system() function in awk. I think your awk supports that call.
A google for 'fft.c' got me 10 first page hits that looked respectably good. There are sites with an array of algorithmic variants to meet differing needs.
fft is gold standard for fitting data sampling output.