Open Filter Visualization Tool
h = fvtool(...)
fvtool(b,a) opens FVTool
and displays the magnitude response of the digital filter defined
b and denominator,
Using FVTool you can display the phase response, group delay, impulse
response, step response, pole-zero plot, and coefficients of the filter.
You can export the displayed response to a file with File > Export.
If the input to
fvtool(sos) opens FVTool and displays the
magnitude response of the digital filter defined by the matrix of
second order sections,
a K-by-6 matrix, where the number of sections, K,
must be greater than or equal to 2. If the number of sections is less
fvtool considers the input to be a numerator
vector. Each row of
sos corresponds to the coefficients
of a second order (biquad) filter. The ith row
sos matrix corresponds to
bi(2) bi(3) ai(1) ai(2) ai(3)].
fvtool(d) opens FVTool and displays the
magnitude response of a digital filter,
designfilt to generate
on frequency-response specifications.
FVTool and displays the magnitude responses of multiple filters defined
fvtool(sos1,sos2,...,sosN) opens FVTool
and displays the magnitude responses of multiple filters defined with
second order section matrices,
fvtool(Hd) opens FVTool
and displays the magnitude responses for the
Hd, or the array of
FVTool and displays the magnitude responses of the filters in the
If you have the DSP System Toolbox™ product installed,
you can also use
Quantized filter objects (
arithmetic set to
Multirate filter (
Adaptive filter (
Any of the following filter System objects.
The following Filter System objects are supported by this analysis function:
|Filter System objects|
When the input filter is a
FVTool performs fixed-point analysis if the arithmetic property of
the filter objects is set to 'fixed'. However, for filter System objects,
based on the arithmetic specified in the
ARITH can be one of
is only relevant for the analysis of filter System objects. The arithmetic
ARITH, applies to all the filter System
objects that you input to fvtool. When you specify
the function performs double- or single-precision analysis. When you
'fixed' , the arithmetic changes depending
on the setting of the
and whether the System object is locked or unlocked.
If you do not specify the arithmetic for non-CIC structures, and the System object is in an unlocked state, the function uses double-precision arithmetic. If the System object is locked, the function performs analysis based on the locked input data type. CIC structures only support fixed-point arithmetic.
h = fvtool(...) returns
a figure handle
h. You can use this handle to interact
with FVTool from the command line. See Controlling FVTool from the MATLAB Command Line.
FVTool has two toolbars.
An extended version of the MATLAB® plot editing toolbar. The following table shows the toolbar icons specific to FVTool.
Restore default view. This view displays buffer regions around the data and shows only significant data. To see the response using standard MATLAB plotting, which shows all data values, use View > Full View.
Link to FDATool (appears only if FVTool was started from FDATool)
Toggle Add mode/Replace mode (appears only if FVTool was launched from FDATool)
Analysis toolbar with the following icons
To see the zero-phase response, right-click the y-axis label of the Magnitude plot and select Zero-phase from the context menu.
Phase response of the current filter. See
Superimposes the magnitude response and the phase response
of the current filter. See
Shows the group delay of the current filter. Group delay
is the average delay of the filter as a function of frequency. See
Shows the phase delay of the current filter. Phase delay
is the time delay the filter imposes on each component of the input
Impulse response of the current filter. The impulse response
is the response of the filter to a impulse input. See
Step response of the current filter. The step response
is the response of the filter to a step input. See
Pole-zero plot, which shows the pole and zero locations
of the current filter on the z-plane. See
Filter coefficients of the current filter, which depend on the filter structure (e.g., direct-form, lattice, etc.) in a text box. For SOS filters, each section is displayed as a separate filter.
Detailed filter information.
fdatool, selecting View > Filter Visualization Tool or the Full View Analysis toolbar
when an analysis is displayed starts
FVTool for the current filter. You can synchronize FDATool and FVTool
with the FDAToolLink toolbar button
. Any changes
made to the filter in FDATool are immediately reflected in FVTool.
Two FDATool link modes are provided via the Set Link Mode toolbar button:
Replace — removes the filter currently displayed in FVTool and inserts the new filter.
Add — retains the filter currently displayed in FVTool and adds the new filter to the display.
You can change the x- or y-axis units by right-clicking the mouse on the axis label or by right-clicking on the plot and selecting Analysis Parameters. Available options for the axes units are as follows.
|Plot||X-Axis Units||Y-Axis Units|
Magnitude and Phase
(y-axis on left side)
(y-axis on right side)
You can use any of the plot editing toolbar buttons to change the properties of your plot.
Analysis Parameters are parameters that apply to the displayed analyses. To display them, right-click in the plot area and select Analysis Parameters from the menu. (Note that you can access the menu only if the Edit Plot button is inactive.) The following analysis parameters are displayed. (If more than one response is displayed, parameters applicable to each plot are displayed.) Not all of these analysis fields are displayed for all types of plots:
Normalized Frequency — if checked, frequency is normalized between 0 and 1, or if not checked, frequency is in Hz
Frequency Scale — y-axis
Frequency Range — range
of the frequency axis or
Specify freq. vector
Number of Points — number of samples used to compute the response
Frequency Vector — vector
to use for plotting, if
Specify freq. vector is
selected in Frequency Range.
Magnitude Display — y-axis
Phase Units — y-axis
Phase Display — type of
phase plot (
Group Delay Units — y-axis
Specify Length — length
type of impulse or step response (
Length — number of points to use for the impulse or step response
In addition to the above analysis parameters, you can change
the plot type for Impulse and Step Response plots by right-clicking
and selecting Line with Marker, Stem or Line from
the context menu. You can change the x-axis units
by right-clicking the x-axis label and selecting
To save the displayed parameters as the default values to use when FDATool or FVTool is opened, click Save as default.
To restore the default values, click Restore original defaults.
Data tips display information about a particular point in the plot. See Display Data Values Interactively in the MATLAB documentation for information on data tips.
If you have the DSP System Toolbox software, FVTool displays a specification mask along with your designed filter on a magnitude plot.
To use View > Passband
zoom, your filter must have been designed
You can overlay a second response on the plot by selecting Analysis > Overlay Analysis and selecting an available response. A second y-axis is added to the right side of the response plot. The Analysis Parameters dialog box shows parameters for the x-axis and both y-axes. See Example 2 for a sample Analysis Parameters dialog box.
After you obtain the handle for FVTool, you can control some aspects of FVTool from the command line. In addition to the standard Handle Graphics® properties (see Handle Graphics in the MATLAB documentation), FVTool has the following properties:
'Analysis' — displays the
specified type of analysis plot. The following table lists the analyses
and corresponding analysis strings. Note that the only analyses that
use filter internals are magnitude response estimate and round-off
noise power, which are available only with the DSP System Toolbox product.
|Analysis Type||Analysis String|
Magnitude and phase plot
Group delay plot
Phase delay plot
Impulse response plot
Step response plot
Magnitude response estimate
with the DSP System Toolbox product, see
Round-off noise power
(available only with
the DSP System Toolbox product, see
'Grid' — controls whether
the grid is
'Legend' — controls whether
the legend is
'Fs' — controls the sampling
frequency of filters in FVTool. The sampling frequency vector must
be of the same length as the number of filters or a scalar value.
If it is a vector, each value is applied to its corresponding filter.
If it is a scalar, the same value is applied to all filters.
(This option is available only if you have the DSP System Toolbox product.)
For second-order sections filters, this controls how the filter is
SOSViewSettings property contains
an object so you must use this syntax to set it:
viewtype is one of the following:
'Complete' — Displays the
complete response of the overall filter
'Individual' — Displays
the response of each section separately
'Cumulative' — Displays the response for each section accumulated with each prior section. If your filter has three sections, the first plot shows section one, the second plot shows the accumulation of sections one and two, and the third plot show the accumulation of all three sections.
You can also define whether to use
which determines where the sections should be split. The secondary
scaling points are the scaling locations between the recursive and
the nonrecursive parts of the section. The default value is
which does not use secondary scaling. To turn on secondary scaling,
use this syntax:
'UserDefined' — Allows you
to define which sections to display and the order in which to display
them. Enter a cell array where each section is represented by its
index. If you enter one index, only that section is plotted. If you
enter a range of indices, the combined response of that range of sections
is plotted. For example, if your filter has four sections, entering
the combined response for all four sections, and entering
the response for each section individually.
You can change other properties of FVTool from the command line
You can use the following methods with the FVTool handle.
addfilter(h,filtobj) adds a new filter to
FVTool. The new filter,
filtobj, must be a
dfilt filter object. You can specify
the sampling frequency of the new filter with
setfilter(h,filtobj) replaces the filter
in FVTool with the filter specified in
You can set the sampling frequency as described above.
deletefilter(h, index) deletes the filter
at the FVTool cell array
legend(h,str1,str2,...) creates a legend
in FVTool by associating
str1 with filter 1,
filter 2, etc. See
the MATLAB documentation for information.
Display the magnitude response of an elliptic filter, starting FVTool from the command line:
[b,a] = ellip(6,3,50,300/500); fvtool(b,a);
Display and analyze multiple FIR filters, starting FVTool from the command line. Then, display the associated analysis parameters for the magnitude:
b1 = firpm(20,[0 0.4 0.5 1],[1 1 0 0]); b2 = firpm(40,[0 0.4 0.5 1],[1 1 0 0]); fvtool(b1,1,b2,1);
Create a lowpass, equiripple filter of order 20 in FDATool and display it in FVTool.
fdatool % Start FDATool
Set these parameters in
Design Method: FIR
Filter Order: Specify order
Options: Density Factor
Frequency Specifications: Units
Magnitude Specifications: Wpass and Wstop
and then click the Design Filter button.
Click the Full View Analysis button to start FVTool.
Create an elliptic filter and use some of FVTool's figure handle commands:
[b,a]=ellip(6,3,50,300/500); h = fvtool(b,a); % Create handle, h and start FVTool % with magnitude plot
set(h,'Analysis','phase') % Change display to phase plot
set(h,'Legend','on') % Turn legend on legend(h,'Phase plot') % Add legend text
get(h) % View all properties % FVTool-specific properties are % at the end of this list. AlphaMap: [1x64 double] CloseRequestFcn: 'closereq' Color: [0.8314 0.8157 0.7843] ColorMap: [64x3 double] CurrentAxes: 208.0084 CurrentCharacter: '' CurrentObject:  CurrentPoint: [0 0] DockControls: 'on' DoubleBuffer: 'on' FileName: '' FixedColors: [11x3 double] IntegerHandle: 'on' InvertHardcopy: 'on' KeyPressFcn: '' MenuBar: 'none' MinColormap: 64 Name: 'Filter Visualization Tool - Phase Response' NextPlot: 'new' NumberTitle: 'on' PaperUnits: 'inches' PaperOrientation: 'portrait' PaperPosition: [0.2500 2.5000 8 6] PaperPositionMode: 'manual' PaperSize: [8.5000 11] PaperType: 'usletter' Pointer: 'arrow' PointerShapeCData: [16x16 double] PointerShapeHotSpot: [1 1] Position: [360 292 560 345] Renderer: 'painters' RendererMode: 'auto' Resize: 'on' ResizeFcn: '' SelectionType: 'normal' Toolbar: 'auto' Units: 'pixels' WindowButtonDownFcn: '' WindowButtonMotionFcn: '' WindowButtonUpFcn: '' WindowStyle: 'normal' BeingDeleted: 'off' ButtonDownFcn: '' Children: [15x1 double] Clipping: 'on' CreateFcn: '' DeleteFcn: '' BusyAction: 'queue' HandleVisibility: 'on' HitTest: 'on' Interruptible: 'on' Parent: 0 Selected: 'off' SelectionHighlight: 'on' Tag: 'filtervisualizationtool' UIContextMenu:  UserData:  Visible: 'on' AnalysisToolbar: 'on' FigureToolbar: 'on' Grid: 'on' Legend: 'on' DesignMask: 'off' Fs: 1 SOSViewSettings: [1x1 dspopts.sosview] Analysis: 'phase' OverlayedAnalysis: '' ShowReference: 'on' PolyphaseView: 'off' NormalizedFrequency: 'on' FrequencyScale: 'Linear' FrequencyRange: '[0, pi)' NumberofPoints: 8192 FrequencyVector: [1x256 double] PhaseUnits: 'Radians' PhaseDisplay: 'Phase'