Function | Description |
---|---|
FILTER(*) | Basic FIR and IIR filter realization |
FIRFILT (*) | Convolution and FFT-based filter realization of FIR filters |
IIRFILT (*) | Causal and anti-causal (forward-backward) IIR filter realization |
* function uses digital filter data structure |
!P.Multi = [0, 1, 1]
t = FINDGEN(1024)
; Generate two narrow band signals and combine them.
s1 = SIN(0.6*t)
s2 = SIN(1.2*t)
x = s1 + s2
; Generate the abscissa values for the normalized frequency.
f = FINDGEN(512)/511
; Plot magnitude frequency response of the combined signal.
PLOT, f, (ABS(FFTCOMP(x, /Complex)))(0:512), Title = 'Original'
; Approximate a bandpass filter to isolate the first signal.
h = FIRDESIGN(101, 0.1, 0.25, /Bandpass)
; Apply the filter to the signal.
y = FILTER(h, x)
; Plot the magnitude frequency response of the filtered signal.
PLOT, f, (ABS(FFTCOMP(y, /Complex)))(0:512), Title = 'Filtered'
!P.Multi = [0, 1, 2]
; Generate a square wave.
x = ((INDGEN(1024)+64) MOD 256) GT 128
; Design an elliptical lowpass filter.
h = IIRDESIGN(5, 0.25, 0.01, 0.01, /Ellip)
; Plot the causal filtering of the square wave.
PLOT, IIRFILT(h, x), Title = 'Causal Filtering'
; Plot the anti-causal (forward-backward) filtering of the
; square wave. Notice that the result is symmetric, and there
; is no phase distortion.
PLOT, IIRFILT(h, x, /Forward_back), $
Title = 'Anti-Causal Filtering'
Routine | Description |
---|---|
FILTDOWN (*) | Decimation filter |
FILTUP(*) | Interpolation filter |
QMF (*) | Quadrature mirror filter |
* routine uses digital filter data structure |