| Signal Processing Blockset™ | ![]() |
dspobslib
Note The Digital FIR Filter Design block is still supported but is likely to be obsoleted in a future release. We strongly recommend replacing this block with the Digital Filter block. |
The Digital FIR Filter Design block designs a discrete-time (digital) FIR filter in one of several different band configurations using a window method. Most of these filters are designed using the Signal Processing Toolbox fir1 function, and are real with linear phase response. The block applies the filter to a discrete-time input using the Direct-Form II Transpose Filter (Obsolete) block.
An M-by-N sample-based matrix input is treated as M*N independent channels, and an M-by-N frame-based matrix input is treated as N independent channels. In both cases, the block filters each channel independently over time, and the output has the same size and frame status as the input.
For complete details on the classical FIR filter design algorithm, see the description of the fir1 and fir2 functions in the Signal Processing Toolbox documentation.
The band configuration for the filter is set from the Filter type pop-up menu. The band configuration parameters below this pop-up menu adapt appropriately to match the Filter type selection.
Lowpass and Highpass
In lowpass and highpass configurations, the Filter order and Cutoff frequency parameters specify the filter design. Frequencies are normalized to half the sample frequency. The figure below shows the frequency response of the default order-22 filter with cutoff at 0.4.

Bandpass and Bandstop
In bandpass and bandstop configurations, the Filter order, Lower cutoff frequency, and Upper cutoff frequency parameters specify the filter design. Frequencies are normalized to half the sample frequency, and the actual filter order is twice the Filter order parameter value. The figure below shows the frequency response of the default order-22 filter with lower cutoff at 0.4, and upper cutoff at 0.6.

Multiband
In the multiband configuration, the Filter order, Cutoff frequency vector, and Gain in the first band parameters specify the filter design. The Cutoff frequency vector contains frequency points in the range 0 to 1, where 1 corresponds to half the sample frequency. Frequency points must appear in ascending order. The Gain in the first band parameter specifies the gain in the first band: 0 indicates a stopband, and 1 indicates a passband. Additional bands alternate between passband and stopband. The figure below shows the frequency response of the default order-22 filter with five bands, the first a passband.

Arbitrary shape
In the arbitrary shape configuration, the Filter order, Frequency vector, and Gains at these frequencies parameters specify the filter design. The Frequency vector, fn, contains frequency points in the range 0 to 1 (inclusive) in ascending order, where 1 corresponds to half the sample frequency. The Gains at these frequencies parameter, mn, is a vector containing the desired magnitude response at the corresponding points in the Frequency vector. (Note that the specifications for the Arbitrary shape configuration are similar to those for the Yule-Walker IIR Filter Design block. Arbitrary-shape filters are designed using the Signal Processing Toolbox fir2 function.)
The desired magnitude response of the design can be displayed by typing
plot(fn,mn)
Duplicate frequencies can be used to specify a step in the response (such as band 2 below). The figure shows an order-100 filter with five bands.

The Window type parameter allows you to select from a variety of different windows. See the Window Function block reference for a complete description of the available options.

The parameters displayed in the dialog box vary for different design/band combinations. Only some of the parameters listed below are visible in the dialog box at any one time.
The type of filter to design: Lowpass, Highpass, Bandpass, Bandstop, Multiband, or Arbitrary Shape. Tunable.
The order of the filter. The filter length is one more than this value. For the Bandpass and Bandstop configurations, the order of the final filter is twice this value.
The normalized cutoff frequency for the Highpass and Lowpass filter configurations. A value of 1 specifies half the sample frequency. Tunable.
The lower passband or stopband frequency for the Bandpass and Bandstop filter configurations. A value of 1 specifies half the sample frequency. Tunable.
The upper passband or stopband frequency for the Bandpass and Bandstop filter configurations. A value of 1 specifies half the sample frequency. Tunable.
A vector of ascending frequency points defining the cutoff edges for the Multiband filter. A value of 1 specifies half the sample frequency. Tunable.
The gain in the first band of the Multiband filter: 0 specifies a stopband, 1 specifies a passband. Additional bands alternate between passband and stopband. Tunable.
A vector of ascending frequency points defining the frequency bands of the Arbitrary shape filter. The frequency range is 0 to 1 including the endpoints, where 1 corresponds to half the sample frequency. Tunable.
A vector containing the desired magnitude response for the Arbitrary shape filter at the corresponding points in the Frequency vector. Tunable.
The type of window to apply. See the Window Function block reference. Tunable.
The level (dB) of stopband ripple, Rs, for the Chebyshev window. Tunable.
The Kaiser window β parameter. Increasing Beta widens the mainlobe and decreases the amplitude of the window sidelobes in the window's frequency magnitude response. Tunable.
Antoniou, A. Digital Filters: Analysis, Design, and Applications. 2nd ed. New York, NY: McGraw-Hill, 1993.
Oppenheim, A. V. and R. W. Schafer. Discrete-Time Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.
Proakis, J. and D. Manolakis. Digital Signal Processing. 3rd ed. Englewood Cliffs, NJ: Prentice-Hall, 1996.
![]() | Digital Filter Design | Digital FIR Raised Cosine Filter Design (Obsolete) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |