Routines (alphabetical) > Routines: D > DIGITAL_FILTER

# DIGITAL_FILTER

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.

## Examples

; Get coefficients:

Coeff = DIGITAL_FILTER(Flow, Fhigh, A, Nterms)

; Apply the filter:

Yout = CONVOL(Yin, Coeff)

## Syntax

Result = DIGITAL_FILTER( Flow, Fhigh, A, Nterms [, /DOUBLE] )

## Return Value

This function returns a vector of coefficients with (2 ∞Nterms + 1) elements.

## Arguments

### Flow

The lower frequency of the filter as a fraction of the Nyquist frequency

### Fhigh

The upper frequency of the filter as a fraction of the Nyquist frequency. The following conditions are necessary for various types of filters:

No Filtering | Flow = 0, Fhigh = 1
Low Pass | Flow = 0, 0 < Fhigh < 1
High Pass | 0 < Flow < 1, Fhigh =1
Band Pass | 0 < Flow < Fhigh < 1
Band Stop | 0 < Fhigh < Flow < 1

### A

The filter power relative to the Gibbs phenomenon wiggles in decibels. 50 is a good choice.

### Nterms

The number of terms used to construct the filter.

## Keywords

### DOUBLE

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.

## Version History

Original | Introduced
5.6 | Added DOUBLE keyword

## See Also

CONVOL, LEEFILT, MEDIAN, SMOOTH