Standard Library function that constructs finite impulse response digitalfilters for signal processing.
fhigh The value of the upper frequency of the filter, expressed as a fraction of the Nyquist frequency. Must be between 0 and 1.
gibbs The size of the Gibbs Phenomenon variations. Expressed in units of -db (decibels).
nterm The number of terms in the filter formula used. Determines the order of the filter.
Desired Effect | Value |
---|---|
No filtering | flow = 0, fhigh = 1 |
Lowpass filter | flow = 0, 0 fhigh 1 |
Highpass filter | 0 flow 1, fhigh = 1 |
Bandpass filter | 0 flow fhigh 1 |
Bandstop filter | 0 fhigh flow 1 |
The Gibbs Phenomenon variations are oscillations which result from the abrupt truncation of the infinite FFT series. Setting the gibbs parameter either too high or too low may yield unacceptable results.
TIP: A value of 50 for gibbs is a good choice for most filters.
To evaluate the coefficients of a digital filter and then apply them to a signal, use the following sequence of equations:
Filtered_Signal = CONVOL(input_signal, coeff)
NOTE: Two or more filters created by DIGITAL_FILTER can be combined by addition, subtraction, or averaging to create multiple filtering effects with one filter.
av_temp = FLTARR(140) OPENR, unit, !Data_dir + 'example_air_q.dat', /Get_lun READF, unit, av_temp, Format='(5X,F9.4)'
FREE_LUN, unit PLOT, av_temp
filter = DIGITAL_FILTER(0.0, 0.1, 50, 10)
filt_temp = CONVOL(av_temp, filter)
OPLOT, filt_temp, Linestyle=2
mandril = BYTARR(512,512) OPENR, unit, !Data_dir + 'mandril.img', /Get_lun READU, unit, mandril
FREE_LUN, unit WINDOW, XSize=512, YSize=512 TV, mandril
mandril = FLOAT(mandril)
filter = DIGITAL_FILTER(0.0, 0.1, 50, 10)
filt_image = CONVOL(mandril, filter)
TV, filt_image