Digital Signal Processing Reference
In-Depth Information
Step 3 Using the values of G ( m ) computed in step 2, sketch a line plot of
G ( ) as a function of by interpolating intermediate values of G ( ). Generally,
G ( ) is interpolated over a large grid of discrete frequencies within S .
Step 4 Using the line plot of G ( ) obtained in step 3, sketch the line plot of
ε ( ) as a function of using the following expression:
ε ( ) = W ( )[ H d ( ) G ( )] ,
derived from Eq. (15.50).
Step 5 Update the L + 2 extremal frequencies { 1 < 2 < < L + 2 S
by determining the L + 2 maxima and minima in ε ( ) plotted in step 4.
Step 6 Check if the L + 2 maxima and minima observed in step 5 have the
same value. If they do, then the alternation theorem is satisfied and the updated
frequencies { 1 < 2 < < L + 2 } can be used to solve Eq. (15.52) for the
filter coefficients. If not, then go back to step 1 and repeat steps 1-6.
The Parks-McClellan algorithm, highlighted in the aforementioned discus-
sion, designs a lowpass FIR filter. Extension to other types of FIR filters is
straightforward, provided that the required filter can be expressed in terms of
a lowpass filter. Equation (15.24) illustrates how the design of a highpass filter
can be transformed to the design of a lowpass filter. Similarly, Eqs. (15.32) and
(15.38), respectively, provide transformations for bandpass and bandstop filters.
Once the specifications of the required filter are expressed in terms of a low-
pass filter, the impulse response of the optimal lowpass FIR filter is computed
using the Parks-McClellan algorithm. The impulse response of the required FIR
filter is then calculated from the impulse response of the optimal lowpass FIR
filter.
15.6 M ATLAB exa mples
The design algorithms covered in this chapter are incorporated as library func-
tions in most signal processing software packages. In this section, we introduce
several M-files available in M ATLAB for the design of FIR filters. In par-
ticular, we cover rectwin , bartlett , hann , hamming , and blackman
functions, which are used to implement the elementary windows covered in
Section 15.1. In addition, we consider the fir1 function to derive the impulse
response of the FIR filter. The kaiser function used to design FIR filters
using the Kaiser window and the firpm function used to implement the Parks-
McClellan algorithm are also presented in this section. In each case, we write
the M ATLAB code for the design of the FIR filter specified in Example 15.2.
Search WWH ::




Custom Search