FFTFilter

Declaration: FFTFilter(FirstLayer, LastLayer, TimeSlot, FFTLength: integer; FiltCoeffsReal, FiltCoeffsImag: TDoubleArray; Padding: TFFTPadding; FeedBack: boolean): integer;
Applies a Fourier transform based filter to spectra specified by the parameters FirstLayer, LastLayer and TimeSlot. The parameter FFTLength determines the length of the data buffer used for the fast Fourier transform and has to be a power of 2. The open array FilterCoeffs controls the type of the resulting filter function and has to have a length which is half of FFTLength. The parameter Padding determines the type of the padding.

If FeedBack is set to TRUE a visual feedback is provided during processing of this command. Please note that unless the script progress bar is already visible you have to make it visible before calling FFTFilter, otherwise the feedback will not be displayed. You can activate the script progress bar by calling the function ScriptBar(0).

Please note that the FFTFilter function does not check whether the spectral data in the range between FirstLayer and LastLayer belong to the same spectral groups. Thus if the dataset contains more than one specral group you should use ObtainSpecRange to ensure that the proper layers are processed.

The function returns the following error codes:

 0 ... everything is OK
-1 ... FFTLength is not a power of 2
-2 ... length of FilterCoeffs does not match FFTLength div 2
-3 ... FirstLayer and/or LastLayer out of range
-4 ... FirstLayer and LastLayer do not belong to the same spectral group
-5 ... invalid TimeSlot (out of range)
-6 ... filter process aborted by the user