Kernel based filters as implemented by the function KFilterSpectrum exhibit the drawback of creating edge effects at the end of the filtering range (due to a decreasing number of data points when the moving kernel approaches the edge). The function KFilterSpectraEdgeSpecial tries to minimize this effect by extrapolating the data at the edges using a polynomial of order ExtPolOrder (valid range: 1 to 4).
The spectral filter is applied to the signal contained in the variable parameter Spectrum. The filter function is controlled by the coefficients stored in the array parameter FilterKernel. The filter coefficients for a weighted sinc lowpass/highpass filter can be calculated by means of the functions CalcSincLPKernel and CalcSincHPKernel.
The function returns the following error codes:
0 ... everything is OK
1 ... FilterKernel is larger than the spectral range
2 ... invalid PolyOrder (1..4 are valid)
