# interpolating a periodic time series

I have a bunch of readings that run every 4 hours, however each sensor has a different offset. One sensor might read at $t = 0,4,8,12,16,20$ and another senor reads at $t = 1,5,9,13,17,21$. This makes it difficult to compare the reading.

It would be nice to put them all on equal footing - "normalization". To do this, I am considering the following problem:

Let $f(t)$ be a periodic function with $f(t+24) = f(t)$. We are given $f(4k)$ for $k = 0,1,\dots,5$. How can we estimate $f(1)$?

Really I want to estimate $f(t)$ for all $0 \leq t < 24$ but you get the idea.

One approach I considered is using Fourier Transform. Let $\omega = e^{\pi i /3}$ be a sixth root of unity and write:

$$f(n) = \hat{f}(0)\cdot 1 + \hat{f}(1)\cdot \omega^{n/6} + \hat{f}(2)\cdot \omega^{2n/6} + \hat{f}(3)\cdot \omega^{3n/6} + \hat{f}(4)\cdot \omega^{4n/6} + \hat{f}(5)\cdot \omega^{5n/6}$$

Then I am asking for $f(n+\tfrac{1}{4})$ which I can estimate using this Fourier transform. Not sure if my scaling is correct.

Is this correct or are there alternative ways like linear interpolation that work better?

Yes, you can interpolate periodic data using a Fourier transform like you have done. It works best if the periodic function you are trying to interpolate is smooth in the mathematical sense (i.e. all derivatives are continuous). However, this kind of interpolation can be poor if the sample points to do not form a smooth function (as might be true for experimental data). In this case, I think you can use something like Lanczos filtering to improve the result.

As far as alternatives, you could also use linear interpolation, cubic spline interpolation, etc. which could also work well depending on the nature of your data and your accuracy requirements. In your case, I think using a Fourier transform based interpolation might be most accurate as it takes advantage of the periodicity.