Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

design

Apply design method to filter specification object

Syntax

filt = design(D,'Systemobject',true)
filt = design(D,METHOD,'Systemobject',true)
filt = design(D,METHOD,PARAM1,VALUE1,PARAM2,VALUE2,...,'Systemobject',true)
filt = design(D,METHOD,OPTS,'Systemobject',true)

Description

filt = design(D,'Systemobject',true) uses the filter specifications object D to generate a filter System object™, filt. When you do not provide a design method as an input argument, design uses the default design method. Use designmethods(D,'default') to see the default design method for your filter specifications object.

filt = design(D,METHOD,'Systemobject',true) uses the design method specified by METHOD. METHOD must be one of the options returned by designmethods. Use designmethods(D,'default') to determine which algorithm is used by default.

The design method you provide as the designmethod input argument must be one of the methods returned by

designmethods(D,'Systemobject',true)

To help you design filters more quickly, the input argument METHOD accepts a variety of special keywords that force design to behave in different ways. The following table presents the keywords you can use for METHOD and how design responds to the keyword.

Design Method Keyword

Description of the Design Response

'FIR'

Forces design to produce an FIR filter. When no FIR design method exists for object D, design returns an error.

'IIR'

Forces design to produce an IIR filter. When no IIR design method exists for object D, design returns an error.

'ALLFIR'

Produces filters from every applicable FIR design method for the specifications in D, one filter for each design method. As a result, design returns multiple filters in the output object.

'ALLIIR'

Produces filters from every applicable IIR design method for the specifications in D, one filter for each design method. As a result, design returns multiple filters in the output object.

'ALL'

Designs filters using all applicable design methods for the specifications object D. As a result, design returns multiple filters, one for each design method. design uses the design methods in the order that designmethods(D,'Systemobject',true) returns them.

Keywords are not case sensitive.

When design returns multiple filters in the output object, use indexing to see the individual filters. For example, to see the third filter in filt, enter:

filt(3)

filt = design(D,METHOD,PARAM1,VALUE1,PARAM2,VALUE2,...,'Systemobject',true) specifies design-method options. Use help(D,METHOD) for complete information on which design-method-specific options are available. You can also use designopts(D,METHOD) for a less-detailed listing of the design-method-specific options.

filt = design(D,METHOD,OPTS,'Systemobject',true) specifies design-method options using the structure OPTS. OPTS is usually obtained from designopts and then specified as an input to design. Use help(D,METHOD) for more information on optional inputs.

If you are specifying design-method-specific options using OPTS, you can also set OPTS.SystemObject to true instead of calling design with the 'SystemObject', true syntax.

Examples

collapse all

Design an FIR equiripple lowpass filter. Specify a passband edge frequency of 0.2π rad/sample and a stopband edge frequency of 0.25π rad/sample. Set the passband ripple to 0.5 dB and the stopband attenuation to 40 dB. Use the default equiripple method.

D = fdesign.lowpass('Fp,Fst,Ap,Ast',0.2,0.25,0.5,40);
filt = design(D,'SystemObject',true);

Design a minimum-phase FIR equiripple filter. Display pole-zero plots of the default and minimum-phase designs.

filtMin = design(D,'equiripple','MinPhase',true,'SystemObject',true);

fvt = fvtool(filt,filtMin,'Analysis','polezero');
legend(fvt,'Default design','Minimum-phase design')

Redesign the filter using the elliptic method. Match the passband exactly.

filt = design(D,'ellip','MatchExactly','passband','SystemObject',true);

You can specify the P-th norm scaling on the second-order sections. Use L-infinity norm scaling in the time domain.

filtL = design(D,'ellip','MatchExactly','passband','SOSScaleNorm','linf', ...
    'SystemObject',true);

Display the frequency responses of the Butterworth filters.

fvt = fvtool(filt,filtL);
legend(fvt,'Default scaling','L-infinity norm scaling')

Introduced in R2009a

Was this topic helpful?