DSP Blockset    

Arbitrary Shape Discrete-Time FIR Filters.   Arbitrary shape filters are the most flexible filter designs and are constructed by specifying a normalized band-edge frequency vector (instead of a normalized cutoff-frequency vector). The normalized frequency vector, fn, contains frequency points in the range 0 to 1 (inclusive) in ascending order. A magnitude vector, mn, specifies the desired normalized magnitude response at the corresponding points in the frequency vector.

The desired magnitude response of the design can therefore be displayed by typing

In the figure below, the normalized band-edge frequencies and magnitudes are

For an input signal sampled at 1 kHz, this filter would have stopbands from DC to 100 Hz and from 400 Hz to 500 Hz. The response in the passband is specified to have normalized gain of 0.1 (-20 dB) at 150 Hz and 350 Hz, and normalized gain of 1 at 250 Hz.

The equivalent MATLAB code, with corresponding frequency-magnitude pairs shaded, is

and the filter can be designed in the Digital FIR Filter Design block by making the following selections in the dialog box:

Note that normalized frequency-magnitude pairs must be provided for spectrum boundaries, 0 and 1. Whenever the last (right-most) band is a passband, the filter order must be even (so that the filter is Type I). If the example above had a passband at half the sample frequency, MATLAB would automatically increase the filter order to 42.


 Multiband Discrete-Time FIR Filters Discrete-Time IIR Filters