FIR Filter Implementation
The simplest FIR (Finite Impulse Response) filter to apply to a signal is the rectangular or boxcar filter, which is implemented with IDL's SMOOTH function, or the closely related MEDIAN function.
Applying other FIR filters to signals is straightforward since the filter is non-recursive. The filtered signal is simply the convolution of the impulse response of the filter with the original signal. The impulse response of the filter is computed with the DIGITAL_FILTER function or by the procedure in the previous section.
IDL's BLK_CON function provides a simple and efficient way to convolve a filter with a signal. Using u(k) from the previous example and the bandstop filter created above creates the plot shown in the figure below.
Example Code
Type @sigprc12 at the IDL prompt to run the batch file that creates this display. The source code is located in sigprc12, in the examples/doc/signal directory. See Running the Example Code if IDL does not find the batch file.
The frequency response of the filtered signal shows that the frequency component at 11.0 cycles / second has been filtered out, while the frequency components at 2.8 and 6.25 cycles / second, as well as the DC component, have been passed by the filter.
