## Documentation Center |

On this page… |
---|

Accessing Filter Parameters in a Saved Filter |

FDATool is the recommended filter design tool. Filter Designer will be removed in a future release. The following information is provided for users that choose to use Filter Designer while they transition to FDATool. Filter Designer, provides an interactive graphical environment for the design of digital IIR and FIR filters based on specifications that you enter on a magnitude or pole-zero plot.

You can design filters of the following types using the Filter Designer:

Bandpass

Lowpass

Bandstop

Highpass

You can use the following filter methods to design FIR filters:

Equiripple

Least squares

Window

You can use the following filter methods to design IIR filters:

Butterworth

Chebyshev Type I

Chebyshev Type II

Elliptic

You can use the Pole/Zero Editor to design arbitrary
FIR and IIR filters by placing and moving poles and zeros on the complex *z*-plane.

You can also superimpose spectra on a filter's magnitude response to see if the filtering requirements are met.

Open the Filter Designer from SPTool by either:

Clicking

**New**in the**Filters**list in SPToolSelecting a filter you want to edit from the

**Filters**list in SPTool, and then clicking**Edit**

The Filter Designer has the following components:

A pull-down

**Filter**menu for selecting a filter from the list in SPToolA

**Sampling Frequency**text boxA pull-down

**Algorithm**menu for selecting a filter design method or a pole-zero plot displayA Specifications area for viewing or modifying a filter's design parameters or pole-zero locations

A plot display region for graphically adjusting filter magnitude responses or the pole-zero locations

A Measurements area for viewing the response characteristics and stability of the current filter

A toolbar with the following buttons

Icon

Description

Print and print preview

Zoom in and out

Passband view

Overlay spectrum

Turn on the What's This help

The MATLAB^{®} structures created by SPTool have several associated
fields, many of which are also MATLAB structures. See the MATLAB documentation
for general information about MATLAB structures.

For example, after exporting a filter filt1 to the MATLAB workspace, type

filt1

to display the fields of the MATLAB filter structure. The `tf,
Fs`, and `specs` fields of the structure
contain the information that describes the filter.

The `tf` field is a structure containing the
transfer function representation of the filter. Use this field to
obtain the filter coefficients;

`filt1.tf.num`contains the numerator coefficients.`filt1.tf.den`contains the denominator coefficients.

The vectors contained in these structures represent polynomials
in descending powers of *z*. The numerator and denominator
polynomials are used to specify the transfer function

where:

*b*is a vector containing the coefficients from the`tf.num`field.*a*is a vector containing the coefficients from the`tf.den`field.*m*is the numerator order.*n*is the denominator order.

You can change the filter representation from the default transfer
function to another form by using the `tf2ss` or `tf2zp` functions.

The `Fs` field contains the sampling frequency
of the filter in hertz.

The `specs` field is a structure containing
parameters that you specified for the filter design. The first field, `specs.currentModule`,
contains a string representing the most recent design method selected
from the Filter Designer's **Algorithm** list before
you exported the filter. The possible contents of the `currentModule` field
and the corresponding design methods are shown below.

Contents of the currentModule field | Design Method |
---|---|

Butterworth IIR | |

Chebyshev Type I IIR | |

Chebyshev Type II IIR | |

Elliptic IIR | |

Least Squares FIR | |

Kaiser Window FIR | |

Equiripple FIR |

Following the `specs.currentModule` field,
there may be up to seven additional fields, with labels such as `specs.fdremez`, `specs.fdfirls`,
etc. The design specifications for the most recently exported filter
are contained in the field whose label matches the `currentModule` string.
For example, if the `specs` structure is

filt1.specs ans currentModule: 'fdremez' fdremez: [1x1 struct]

the filter specifications are contained in the `fdremez` field,
which is itself a data structure.

The specifications include the parameter values from the Specifications
region of the Filter Designer, such as band edges and filter order.
For example, the filter above has the following specifications stored
in `filt1.specs.fdremez`:

filt1.specs.fdremez ans = setOrderFlag: 0 type: 3 f: [0 0.2000 0.3000 0.5000 0.6000 1] m: [6x1 double] Rp: 0.0100 Rs: 75 wt: [3.2371 1 3.2371] order: 78

Because certain filter parameters are unique to a particular design, this structure has a different set of fields for each filter design.

The table below describes the possible fields associated with
the filter design specification field (the `specs` field)
that can appear in the exported structure.

Parameter | Description |
---|---|

Kaiser window β parameter. | |

Contains a vector of band-edge frequencies, normalized so that 1 Hz corresponds to half the sample frequency. | |

Passband cutoff frequencies. Scalar for lowpass and highpass designs, two-element vector for bandpass and bandstop designs. | |

Stopband cutoff frequencies. Scalar for lowpass and highpass designs, two-element vector for bandpass and bandstop designs. | |

The response magnitudes corresponding to the band-edge
frequencies in | |

Filter order. | |

Passband ripple (dB) | |

Stopband attenuation (dB) | |

Contains | |

Contains | |

-3 dB frequency for Butterworth IIR designs. | |

Vector of Kaiser window coefficients. | |

Cutoff frequency for the Kaiser window FIR filter when | |

Vector of weights, one weight per frequency band. |

To design a filter transfer function using the Filter Designer Pole/Zero Editor:

Select the

`Pole/Zero Editor`option from the**Algorithm**list to open the Pole/Zero Editor in the Filter Designer display.Select a pole or zero (or conjugate pair) by selecting one of the (pole) or (zero) symbols on the plot.

Choose the coordinates to work in by specifying

`Polar`or`Rectangular`from the**Coordinates**list.Specify the new location(s) of the selected pole, zero, or conjugate pair by typing values into the

**Mag**and**Angle**fields (for angular coordinates) or**X**and**Y**(for rectangular coordinates) fields. Alternatively, position the poles and zeros by dragging the and symbols.Use the

**Conjugate pair**check box to create a conjugate pair from a lone pole or zero, or to break a conjugate pair into two individual poles or zeros.

Design a new filter or edit an existing filter in the same way.

You can use your mouse to move poles and zeros around the pole/zero plot and modify your filter design.

Icon | Description |
---|---|

| Enable moving poles or zeros by dragging on the plot |

| Add pole |

| Add zero |

| Erase poles or zeros |

You can move both members of a conjugate pair simultaneously by manipulating just one of the poles or zeros.

To ungroup conjugates, select the desired pair and clear **Conjugate
pair** in the Specifications region on the Filter Designer.

When you place two or more poles (or two or more zeros) directly
on top of each other, a number is displayed next to the symbols (on
the left for poles, and on the right for zeros) indicating the number
of poles or zeros at that location (e.g.,
for three zeros). This
number makes it easy to keep track of all the poles and zeros in the
plot area, even when several are superimposed on each other and are
not visually differentiable. Note, however, that this number *does
not* indicate the *multiplicity* of the
poles or zeros to which it is attached.

To detect whether or not a set of poles or zeros are truly multiples,
use the zoom tools to magnify the region around the poles or zeros
in question. Because numerical limitations usually prevent any set
of poles or zeros from sharing *exactly* the same
value, at a high enough zoom level even truly multiple poles or zeros
appear distinct from each other.

A common way to assess whether a particular group of poles or
zeros contains multiples is by comparing the mutual proximity of the
group members against a selected threshold value. As an example, the `residuez` function defines a pole or zero
as being a multiple of another pole or zero if the absolute distance
separating them is less than 0.1% of the larger pole or zero's magnitude.

After designing a filter in the Filter Designer, you can redesign it by dragging the specification lines on the magnitude plot. Use the specification lines to change passband ripple, stopband attenuation, and edge frequencies.

In the following example, create a Chebyshev filter and modify it by dragging the specification lines:

**Fp**=`800`**Fs**=`700`**Rp**=`2.5`**Rs**=`35`

Select

**Minimum Order**so the Filter Designer can calculate the lowest filter order that produces the desired characteristics.Click

**Apply**to compute the filter and update the response plot.Position the cursor over the horizontal filter specification line for the stopband. This is the first (leftmost) horizontal specification line you see.

The cursor changes to the up/down drag indicator.

Drag the line until the

**Rs**(stopband attenuation) field reads`100`.

Was this topic helpful?