I am working on an application where I use gaussian filtering (convolution) to smooth a signal and at the same time get the 1st and 2nd derivative in real time. The signal is an equidistant sampling of a time series which is not equidistant.
I am using the GNU scientific library to generate the kernels I am convolving with. I am using the gsl_filter_gaussian_kernel function, with parameters vector length 1001, alpha 3.0, with normalization, to generate kernels for order 0, 1 and 2.
The sum of the kernel values for order 1 and 2 does not equal 1 while for order 0 it does. When I convolve my data (only positive values with a value typically roughly around 9500.0 and with unknown range) with the kernels for order 1 and 2, I get a signal that has a DC offset on it rather than being centered around zero, making it hard to know whether the derivatives cross through zero or not and whether they are negative or positive. I need to know this to be able to determine local maxima and minima.
Looking at the source code of the GSL I have the impression kernels for order 0 are normalized, but not for higher orders. What would be the best solution to get a signal for orders > 0 that is centered around zero?