FIR filtering with optional endpoint padding using the FFT.
FPADFILT(series, h, pad, padlen)
series 
 
A series. 

h 
 
A series. The FIR filter coefficients (i.e. impulse response). 

pad 
 
Optional. An integer to specify start and end point padding method.


padlen 
 
Optional. An integer, the length of segment with which to pad. Defaults to 
A series.
W1: integ(gnorm(1000,.001))*10+1
W2: kwlpass(1000.0, 50.0, 60.0, 70.0)
W3: fpadfilt(W1, W2, 0);
W4: fpadfilt(W1, W2, 1); overp(W3, lred); overp(W1, lgreen)
W1 consists of simulated data with a low frequency trend. W2 contains an FIR lowpass filter with a cutoff frequency of 50 Hertz. The data is filtered without padding in W3.
Before filtering, the beginning and end points of the data are padded by flipping the end segments in time and amplitude in W4. The OVERPLOT of the original and convolution data provides a comparison of the effects of the padding on the rampup and rampdown transient implicit in the filtering process. Standard filtering assumes the data is zero prior to the start and after the end of the data.
W5: fpadfilt(W1, W2, 2)
Same as W4, except the start and end points are padded by flipping the start and end point segments about 0.0.
FPADFILT uses the FFT to perform FIR filtering in the frequency domain.
FPADFILT automatically sets the XOFFSET of the resulting data to the correct value. For noncausal filters of even length, the XOFFSET of the output may be larger (i.e. more positive) than the XOFFSET of the input data.
See PADFILT for a time domain implementation of FIR filter padding.