주요 콘텐츠

Use Filter Designer App

App Workflow

A typical workflow for designing filters using the Filter Designer app is:

  1. Import or Create Filters — Import existing filters available in the MATLAB® workspace, where each filter is either a set of numeric variables, a digitalFilter object, or one of the supported filter System objects (DSP System Toolbox) from DSP System Toolbox™.

    Choose a predefined response to create a new digital filter with default specifications.

  2. Design Filters — Modify filter parameters, edit poles and zeros, transform filter frequency response, and create filter cascades.

  3. Quantize Filters — Quantize coefficients of floating-point filter to fixed-point. This workflow requires licenses for DSP System Toolbox and Fixed-Point Designer™.

  4. Manage and Analyze Filters — View and compare filter details, analyze filter responses in frequency and time domains, organize analysis with multiple displays and display options.

  5. Export and Share Filters — Export filters to the MATLAB workspace, Simulink®, the DSP HDL IP Designer (DSP HDL Toolbox) app, or a file. Generate MATLAB functions to recreate a filter or save and share your Filter Designer session.

Example: Design, Analyze, and Export Lowpass IIR Filter

Use the Filter Designer app to create, design, analyze, and export a lowpass filter that preserves frequency content under 200 Hz for signals sampled at 1 kHz. You have decided to design a Chebyshev type II filter because you want a low-order filter with a narrow transition region and no ripple in the passband.

Create Filter

Open Filter Designer. In the Response gallery of the Designer tab in the app toolstrip, select Lowpass IIR. The app displays a filter design with default specifications.

Design Filter

To modify the filter specifications, expand the Parameters panel.

  1. Under Algorithm, select Chebyshev type II.

  2. Under Sample Rate, select Hz for the frequency units and specify the input sample rate as 1000.

  3. Under Filter Order, select Specify and specify the order as 5.

  4. Under Frequency Specifications, specify a stopband frequency of 200 Hz.

  5. In the Filter section of the Designer toolstrip tab, click Update Filter.

Filter Designer app, showing the Designer toolstrip tab, the lowpass IIR filter in the Filters table, the Parameters panel, and the magnitude response of the filter. The display shows the response plot along with a mask that correspond to the filter design specifications.

Inspect Filter

To inspect the filter, plot the magnitude and phase responses on a display and set display options.

  1. Add the phase response as an overlaid analysis to the active display. In the Analysis gallery of the Analysis tab, select Phase under the Overlay Analysis pane.

  2. Show the CTF sections of the filter. In the Display Options tab, click CTF View.

Filter Designer app, showing the Display Options toolstrip tab, the lowpass IIR filter in the Filters table, the Parameters panel, and the magnitude and phase responses of the filter. The display shows the response plots for each CTF section of the filter.

Export Filter

Export the filter coefficients and generate a MATLAB function that creates a digitalFilter object.

  1. To export the coefficients as variables in the MATLAB workspace, click Export in the Designer tab, select Export to MATLAB Workspace, and then select Coefficients. Filter Designer appends _Num and _Den to the variables that contain the numerator and denominator coefficients, respectively.

  2. To generate a MATLAB function that creates a digitalFilter object, click Export in the Designer tab, select Generate MATLAB Function, and then select Digital Filter Object.

See Also

Apps

Functions

Objects

Live Editor Tasks

Topics