Signal Processing Toolkit User Guide > Reference (A to F) > FILTDOWNDESIGN Function (PV-WAVE Extreme Advantage)
  

FILTDOWNDESIGN Function (PV-WAVE Extreme Advantage)
Designs a filter to be used with FILTDOWN.
Usage
result = FILTDOWNDESIGN(m, nx)
Input Parameters
m(scalar) The decimation factor indicating the increment between data values to be returned. This is the input parameter m that is passed into FILTDOWN with the returned filter.
nx—The number of samples of the signal to be used with FILTDOWN.
Returned Value
result—A filter structure to be used with FILTDOWN.
Keywords
None.
Discussion
FILTDOWNDESIGN uses FIRDESIGN to approximate an anti-aliasing filter with normalized cutoff frequency of 1/m. A Hamming window is used in the filter approximation.The order of this decimation filter is 1/5 the length of the signal, nx, but never smaller than 16 and never greater than 128.
You may want to use the REMEZ function directly to create your own anti-aliasing filter.
Example
In this example every other sample is removed from x. The results are shown in Figure 2-3: Decreasing Cutoff Frequency for Increasing Decimation Factor on page 49.
t = FINDGEN(100)/99
x = SIN(2*!Pi*t) + .4*RANDOM(100)
; Create a signal.
m = 2
; Removes every other point of the filtered signal.
nx = N_ELEMENTS(x)
; Create an anti-aliasing filter.
h = FILTDOWNDESIGN(m, nx)
; Filter and down-sample.
newx = FILTDOWN(h, x, m)
resp = ABS(FREQRESP_Z(h, Outfreq = f))
; Plot the response of this filter.
PLOT, f, resp, XTitle = '1/m', Title = $
'Filter Response for Various m'
; Plot the response of the filter for greater values of m to show
; how the cutoff frequency decreases as m increases.
OPLOT, f, ABS(FREQRESP_Z(FILTDOWNDESIGN(3, nx))), Linestyle = 1
OPLOT, f, ABS(FREQRESP_Z(FILTDOWNDESIGN(4, nx))), Linestyle = 2
OPLOT, f, ABS(FREQRESP_Z(FILTDOWNDESIGN(5, nx))), Linestyle = 3
OPLOT, f, ABS(FREQRESP_Z(FILTDOWNDESIGN(6, nx))), Linestyle = 4
 
Figure 2-3: Decreasing Cutoff Frequency for Increasing Decimation Factor
See Also
FILTDOWN,   FIRFILT,   REMEZ

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.