In a project on which I am working, I have a computationally expensive process to calculate a value for a given point in time. As I am working with RF data at approximately 16MHz, this would be impractical to calculate for each and every sample.

What I would like to do is to use spline interpolation between each true calculation, but I wish to do this without having the full series of calculated knots as there may be thousands if not millions.

Is there a best method of calculating splines for such a situation? I can persist the first and second derivatives at the end of the previous spline to constrain the current spline, but how would I best constrain the end point? Is it simply a case of taking n future samples and finding an n large enough to give an accurate ending derivative, whilst small enough for practical use?


It appears that I was coming from a far too ignorant position and hadn't (still haven't really) quite grasped the intricacies of cubic splines. Having played with some data, I have explored the practical output and found that I was over-thinking it.

Taking an arbitrary signal with a number of samples:

Signal and samples

Then using Math.Net Numerics Cubic Spline interpolation in a few different ways I can compare the output. When zoomed in to the second local maxima, the subtle differences can be spotted.

Interpolated and zoomed

As I iterated through the x values, I used n control points either side of the current sample to generate a cubic spline. I then used this spline to interpolate the region between this and the next sample, whereupon I switched to the next n samples. I also compared this with the result of using a single spline calculated from all control points.

Visually, I cannot distinguish between the results of interpolating using the entire series of data, or only 5 control points either side of the current sample (i.e. half of the total 20 samples). The interpolation with three control points either side of the current sample actually gives a better approximation to the original signal, whilst 1 control point either side differs considerably.

Overall, for the current problem with which I am faced, I believe proceeding with generating new splines with each sample, three ahead and three behind, should give me adequate quality. I shall sit down at some point in the future to try to get my head around the actual proof of how many are required.

(Apparently I can't yet post images, sorry for the links).

  • $\begingroup$ What is the basis in which your spline is expressed ? From what I know of splines, depending on the degree of your spline, a polynomial piece is only influenced by a finite number of control points, and the value of the spline at any point of the polynomial piece can be computed through blossoming which only requires a local subsets of the control points $\endgroup$ – Vincent Nivoliers Nov 5 '12 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.