DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


KFilterSignal

Declaration: KFilterSignal(var Signal: TDoubleArray; FilterKernel: TDoubleArray): integer;
Applies a filter to the signal stored in the array Signal. 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 applying the functions CalcSincLPKernel and CalcSincHPKernel.

Please note that this moving kernel filter creates possibly unwanted edge effects at both ends of the signal range. In order to minimize this effect you should consider to use the function KFilterSignalEdgeSpecial.

The function returns the following error codes:

 0 ... everything is OK
-1 ... FilterKernel is larger than the range of the time series

Hint: Although this type of filter can be used with any number of filter kernel coefficients, it is strongly recommended to use only filter kernels with an odd number of coefficients to avoid minute shifts of the filtered signal.