# FIR filter

Filtering out certain frequency bands in a time series can be useful to smooth a curve, remove slow variation, or emphasize certain periodicities (e.g. Milankovitch cycles). One column of evenly spaced data is expected. For most applications in data analysis, it is crucial that the filter has linear phase response. Past therefore uses FIR (Finite Impulse Response) filters, which are designed using the Parks-McClellan algorithm. The following filter types are available: Lowpass, highpass, bandpass and bandstop.

#### Filter parameters

To design an optimal filter takes a little effort. Frequencies are specified in the range 0-0.5, i.e. *T _{0}/T* where

*T*is the sampling interval (not specified to the computer) and

_{0}*T*is the required period. For example, if your real sampling interval is 1,000 years, a frequency corresponding to a period of 23,000 years is specified as 1,000/23,000=0.043.

After setting the filter type, you should select a transition width (or leave the default of 0.02). Decreasing the transition width will make a sharper filter, at the cost of larger ripple (“waves” in the frequency response).

Note that the values in text fields are not updated until you press Enter. Also, if an invalid combination is entered (e.g. a transition band crossing 0 or 0.5, or upper limit less than lower limit) the program will reset some value to avoid errors. It is therefore required to enter the numbers in an order so that the filter is always valid.

The filter types are as follows:

**Lowpass**. The*From*frequency is forced to zero. Frequencies up to the*To*frequency pass the filter. Frequencies from*To*+*Transition*to 0.5 are blocked.**Highpass**. The*To*frequency is forced to 0.5. Frequencies above the*From*frequency pass the filter. Frequencies from 0 to*From*-*Transition*are blocked.**Bandpass**. Frequencies from*From*to*To*pass the filter. Frequencies below*From*-*Transition*and above*To*+*Transition*are blocked.**Bandstop**. Frequencies from*From*to*To*are blocked. Frequencies from 0 to*From*-*Transition*and from*To*+*Transition*to 0.5 pass the filter.

#### Filter order

The filter order should be large enough to give an acceptably sharp filter with low ripple. However, a filter of length *n* will give less accurate results in the first and last *n*/2 samples of the time series, which puts a practical limit on filter order for short series.

The Parks-McClellan algorithm will not always converge. This gives an obviously incorrect frequency response, and attempting to apply such a filter to the data will give a warning message. Try to change the filter order (usually increase it) to fix the problem.

Missing values are filled in using linear interpolation before analysis.