The DIGITAL_FILTER function returns the coefficients of a non-recursive, digital filter for evenly spaced data points. Frequencies are expressed in terms of the Nyquist frequency, 1/2T, where T is the time between data samples. Highpass, lowpass, bandpass and bandstop filters may be constructed with this function.
This routine is written in the IDL language. Its source code can be found in the file
digital_filter.pro in the
lib subdirectory of the IDL distribution.
Result = DIGITAL_FILTER( Flow, Fhigh, A, Nterms [, /DOUBLE] )
This function returns a vector of coefficients with (2 ´ Nterms + 1) elements.
The lower frequency of the filter as a fraction of the Nyquist frequency
The upper frequency of the filter as a fraction of the Nyquist frequency. The following conditions are necessary for various types of filters:
Flow = 0, Fhigh = 1
Flow = 0, 0 < Fhigh < 1
0 < Flow < 1, Fhigh =1
0 < Flow < Fhigh < 1
0 < Fhigh < Flow < 1
The filter power relative to the Gibbs phenomenon wiggles in decibels. 50 is a good choice.
The number of terms used to construct the filter.
Set this keyword to use double-precision for computations and to return a double-precision result. Set DOUBLE=0 to use single-precision for computations and to return a single-precision result. The default is /DOUBLE if the Flow input is double precision, otherwise the default is DOUBLE=0.
; Get coefficients: Coeff = DIGITAL_FILTER(Flow, Fhigh, A, Nterms) ; Apply the filter: Yout = CONVOL(Yin, Coeff)
DOUBLE keyword added: 5.6
CONVOL, LEEFILT, MEDIAN, SMOOTH