Signal Processing Toolbox Previous page   Next Page

Arbitrary-Response Filter Design

The cfirpm filter design function provides a tool for designing FIR filters with arbitrary complex responses. It differs from the other filter design functions in how the frequency response of the filter is specified: it accepts the name of a function which returns the filter response calculated over a grid of frequencies. This capability makes cfirpm a highly versatile and powerful technique for filter design.

This design technique may be used to produce nonlinear-phase FIR filters, asymmetric frequency-response filters (with complex coefficients), or more symmetric filters with custom frequency responses.

The design algorithm optimizes the Chebyshev (or minimax) error using an extended Remez-exchange algorithm for an initial estimate. If this exchange method fails to obtain the optimal filter, the algorithm switches to an ascent-descent algorithm that takes over to finish the convergence to the optimal solution.

Multiband Filter Design

Consider a multiband filter with the following special frequency-domain characteristics.

Band
Amplitude
Optimization Weighting
[-1 -0.5]
[5 1]
1
[-0.4 +0.3]
[2 2]
10
[+0.4 +0.8]
[2 1]
5

A linear-phase multiband filter may be designed using the predefined frequency-response function multiband, as follows:

For the specific case of a multiband filter, we can use a shorthand filter design notation similar to the syntax for firpm:

As with firpm, a vector of band edges is passed to cfirpm. This vector defines the frequency bands over which optimization is performed; note that there are two transition bands, from -0.5 to -0.4 and from 0.3 to 0.4.

In either case, the frequency response is obtained and plotted using linear scale in FVTool:

Note that the range of data shown below is (-Fs/2,Fs/2). You can set this range by changing the x-axis units to Frequency (Fs = 1 Hz).

The filter response for this multiband filter is complex, which is expected because of the asymmetry in the frequency domain. The impulse response, which you can select from the FVTool toolbar, is shown below.

Filter Design with Reduced Delay

Consider the design of a 62-tap lowpass filter with a half-Nyquist cutoff. If we specify a negative offset value to the lowpass filter design function, the group delay offset for the design is significantly less than that obtained for a standard linear-phase design. This filter design may be computed as follows:

The resulting magnitude response is

Note that the range of data in this plot is (-Fs/2,Fs/2), which you can set changing the x-axis units to Frequency. The y-axis is in Magnitude Squared, which you can set by right-clicking on the axis label and selecting Magnitude Squared from the menu.

The group delay of the filter reveals that the offset has been reduced from N/2 to N/2-16 (i.e., from 30.5 to 14.5). Now, however, the group delay is no longer flat in the passband region. To create this plot, click the Group Delay button on the toolbar.

If we compare this nonlinear-phase filter to a linear-phase filter that has exactly 14.5 samples of group delay, the resulting filter is of order 2*14.5, or 29. Using b = cfirpm(29,[0 0.5 0.55 1],'lowpass'), the passband and stopband ripple is much greater for the order 29 filter. These comparisons can assist you in deciding which filter is more appropriate for a specific application.


Previous page  Constrained Least Squares FIR Filter Design Special Topics in IIR Filter Design Next page

© 1994-2005 The MathWorks, Inc.