Accelerating the pace of engineering and science

# iirls

Least-squares IIR filter from specification object

## Syntax

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

## Description

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

 Note   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,...) 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.

`designopts(d,'method')`

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.

`help(d,'iirls')`

## Examples

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 =

Response: 'Arbitrary Magnitude and Phase'
Specification: 'N,F,H'
Description: {'Filter Order';'Frequency Vector';'
Complex Desired Frequency Response'
NormalizedFrequency: true
FilterOrder: 5
Frequencies: [1x655 double]
FreqResponse: [1x655 double]

design(d,'iirls'); % Opens FVTool to show the filter.```

Displaying both the phase and magnitude response in FVTool shows you the filter.