Configure Dynamic Filter Visualizer
This topic shows you how to use the Dynamic Filter Visualizer interface to configure
dsp.DynamicFilterVisualizer object in MATLAB®.
This figure highlights important elements in the Dynamic Filter Visualizer window.
Min Frequency, Max Frequency — The scope sets the minimum and maximum limits of the x-axis using the value of the Frequency Range property. To change the frequency range from the Dynamic Filter Visualizer window, click Settings and set Frequency Range or update the
Min Y-Axis, Max Y-Axis –– The scope sets the minimum and maximum limits of the y-axis using the value of the Y-Axis Limits property. To change the y-axis limits from the Dynamic Filter Visualizer window, click Settings and set Y-Axis Limits or update the
Frequency Axis Label –– The scope auto populates this label as Frequency (Hz) as the display shows the magnitude or phase response of the filter.
Y-Axis Label –– The scope populates this label based on the unit you set in the Display Unit property. To change the display unit from the Dynamic Filter Visualizer window, click Settings and set Display Unit or update the
Title — You can customize the plot title from Settings or by using the
Toolstrip — The Plot tab contains buttons and settings to customize and share the dynamic filter visualizer. The Measurements tab contains buttons and settings to turn on different measurement tools. Use the pin button to keep the toolstrip showing or the arrow button to hide the toolstrip.
Multiple Filter Names and Colors
When the Dynamic Filter Visualizer displays multiple filter responses, the scope uses an index number to identify each filter in the legend. To show the legend, on the Plot tab, click Legend. The legend for seven filters, for example, displays as follows.
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.
When you change the background to a different color, the scope orders the lines as follows.
To set the background color, on the Plot tab, click Settings, 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 the Color drop-down list to change the color of the selected line.
Configure Plot Settings
Use the Configuration section on the Plot tab to modify the plot.
The Legend button turns the legend on or off. This button corresponds to the
ShowLegendproperty in the object. When you display the legend, you can control which filters you want the scope to display. To hide a filter from the plot, click the filter name in the legend, the filter name then shows in grey in the legend. To redisplay the filter, click the filter name again.
The Magnitude Phase button splits the magnitude and phase response of the filter and plots them on two separate axes within the same window. This button corresponds to the
PlotAsMagnitudePhaseproperty in the object.
The Settings button opens the settings window which allows you to modify the sample rate, FFT length, frequency range, x-axis scaling, y-axis label and limits, and signal colors.
Use Dynamic 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 the Measurements tab.
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 the
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
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:
Num Peaks — The number of peaks to show. Must be a scalar integer from 1 through 99.
Min Height — The level above which peaks are detected.
Min Distance — The minimum number of samples between adjacent peaks.
Threshold — The minimum height difference between a peak and its neighboring samples.
Label Peaks — Show labels (P1, P2, …) above the arrows on the plot.
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 the
Share or Save the Dynamic Filter Visualizer
If you want to save the dynamic filter visualizer plot for future use or share it with others, use the buttons in the Share section of the Plot tab.
Generate Script –– Generate a script to re-create your dynamic filter visualizer plot with the same settings. When you click this button, an editor window opens with the code that you can use to re-create your
Copy Display — Copy the display to your clipboard. You can paste the image in another program to save or share.
Print — Open a print dialog box from which you can print out the plot image.
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.
— Maximize the axes, hide all labels and inset the axes values.
— Zoom in on the plot.
— Pan the plot.
— Autoscale the axes to fit the shown data.
Set Additional Properties
You cannot use the Dynamic 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