Main Content


Least-squares IIR filter from specification object


hd = design(d,'iirls','SystemObject',true)
hd = design(d,'iirls',designoption,value,designoption,value,...,'SystemObject',true)


hd = design(d,'iirls','SystemObject',true) designs a least-squares filter specified by the filter specification object d.


The iirls algorithm might not be well behaved in all cases. Experience is your best guide to determining if the resulting filter meets your needs. When you use iirls to design a filter, review the filter carefully to ensure that it is appropriate for your use.

hd = design(d,'iirls',designoption,value,designoption,value,...,'SystemObject',true) returns a least-squares IIR filter where you specify design options as input arguments.

To determine the available design options, use designopts with the specification object and the design method as input arguments as shown.


For complete help about using iirls, refer to the command line help system. For example, to get specific information about using iirls with d, the specification object, enter the following at the MATLAB prompt.



collapse all

Starting from an arbitrary magnitude and phase design object d, generate a complex bandpass filter of order = 5. To make the example a little easier to do, use the default values for F, and H, the frequency vector and the complex desired frequency response.

d = fdesign.arbmagnphase('N,F,H',5)
d = 
  arbmagnphase with properties:

               Response: 'Arbitrary Magnitude and Phase'
          Specification: 'N,F,H'
            Description: {3x1 cell}
    NormalizedFrequency: 1
            FilterOrder: 5
            Frequencies: [1x655 double]
           FreqResponse: [1x655 double]

fvt = design(d,'iirls','SystemObject',true);

Figure Filter Visualization Tool - Magnitude Response (dB) and Phase Response contains an axes and other objects of type uitoolbar, uimenu. The axes with title Magnitude Response (dB) and Phase Response contains an object of type line. This object represents Magnitude.

Introduced in R2011a