Configure Filter Visualizer - MATLAB & Simulink (original) (raw)

You can use the dsp.DynamicFilterVisualizer object in MATLAB® or the Filter Visualizer block in Simulink® to visualize the magnitude response and phase response of digital filters. You can configure the visualizer from the Filter Visualizer interface. These sections show you how to use the Filter Visualizer interface and the available settings.

Display

These figures highlight important elements in the Filter Visualizer window in MATLAB.

This figure highlights important elements in the Filter Visualizer window in Simulink.

Multiple Filter Names and Colors

When the Filter Visualizer displays multiple filter responses, the scope uses an index number to identify each filter in the legend. To show the legend, on theScope tab, click Legend. The legend for seven filters, for example, displays as follows.

When the background is black, the default colors of the input channels are yellow, blue, orange, green, purple, teal, and pink.

By default, the axes background in the scope is black. The scope sets the line color for each filter in a manner similar to the Scope (Simulink) block and in the order shown in this legend.

If there are more than seven filters to display, then the filter visualizer repeats this order to assign line colors to the remaining filters. Colors in the plot repeat in the same order.

Colors repeat beyond 7. Filter 1 through 7 have the same color as filters 8 through 14.

When you change the background to a different color, the scope orders the lines as follows.

When the background is not black, the default colors of the filters are dark blue, orange, dark yellow, purple, green, light blue, and maroon.

To set the background color, on the Scope tab, clickSettings, and then use the Axes color drop-down list to change the background color. To change the line color, first click Line to select a line, and then use theColor drop-down list to change the color of the selected line.

Configure Plot Settings

Use the Configuration section on the Scope tab to modify the plot settings.

Use Filter Visualizer Measurements

Use the Measurements tab to modify the measurement settings. All measurements relate to a specific filter response curve. By default, the scope applies the measurements to the first filter. To change the filter response being measured by the scope, use the Channel drop-down list in theMeasurements tab.

Data Cursors

Use the Data Cursors button to display waveform cursors. You can control the cursor settings from the toolstrip of the scope or from the command line. For more information on cursor measurements, see theCursorMeasurementsConfiguration object.

Peak Finder

Use the Peak Finder button to display peak values for the selected magnitude response curve. Peaks are defined as a local maximum with lower values present on both sides of the peak. Endpoints are not considered as peaks. For more information on the algorithms the scope uses to determine peaks, see findpeaks.

When you turn on the peak finder measurements, an arrow appears on the plot at each maxima and a Peaks pane appears at the bottom of the array plot window showing the x and y values at each peak.

You can customize several of the peak finder settings:

You can control the peak finder settings from the toolstrip of the scope or from the command line. For more information on peak finder measurements, see thePeakFinderConfiguration object.

Share or Save the Filter Visualizer

If you want to save the filter visualizer plot for future use or share it with others, use the buttons in the Share section of theScope tab.

Scale Axes

To scale the plot axes, you can use the mouse to pan around the axes and the scroll button on your mouse to zoom in and out of the plot. Additionally, you can use the buttons that appear when you hover over the plot window.

Set Additional Properties

You cannot use the Filter Visualizer interface to change properties such as signal names in the legend and the number of inputs. Set these properties from the command line using the dsp.DynamicFilterVisualizer object.

See Also

Objects

Blocks

Topics