Spline smoothing algorithm in C
I work in Engineering in an industrial plant, for some of our online modeling we look at high frequency output data from thermocouples, sensors etc by nature this data is subject to a 'noise' effect, which makes live analysis of such time series data difficult.
We use the SAS statistical package for offline analysis, which includes its own smoothing routines. SAS's smoothing routines are based on Christian Reinsch's 1967 paper available here: http://www.cise.ufl.edu/class/cap5416fa10/resources/Reinsch_1967.pdf
As a proof of concept I was able to rewrite Reinsch's Algol 60 code in C (C being the programming Language I am most familiar with and also the langauge our plant control software is written in) and am satisfied with the output I'm getting testing my code with sample data sets.
I'd like to see this functionality added to our control room, we have custom written trending packages etc, where this functionality is highly desireable. I'm concerned about the performance of the algorithm especially on large datasets, I've searched for pre existing spline smoothing algorithms in C but there does not seem to be a large amount of choice.
I own the reasonably popular text book "numerical recipes in C", which has their own implementation of cubic spline interpolation but found this to be unsuitable due to use of custom headers and remapping of array indicies, use of c开发者_Python百科ustom 'vectors' etc, The GNU scientific library (GSL) also does similar.
Ideally I'd like to rely on external libraries as little as possible as people get uncomfortable with additional dependencies in our production environment. Are there any existing algorithms in "plain" C available? I should add that my background is in engineering and not computer science so any code I write myself will likely be less efficient then existing implementations.
精彩评论