FVTool
Filter Visualization Tool
Description
Filter Visualization Tool is an interactive app that enables you to display and analyze the responses, coefficients, and other information of a filter. You can also synchronize FVTool and Filter Designer to immediately visualize any changes made to a filter design.
In the app, you can view:
Magnitude response
Phase response
Group delay
Phase delay
Impulse response
Step response
Pole-zero plot
Filter coefficients
Filter information
For more information, see Analysis Types.

Open the FVTool
FVTool can be opened programmatically using one of the methods described in Programmatic Use.
Examples
Magnitude Response of Elliptic Filter
Consider a 6th-order elliptic filter with a passband ripple of 3 dB, a stopband attenuation of 50 dB, a sample rate of 1 kHz, and a normalized passband edge of 300 Hz. Display the magnitude response of the filter.
[b,a] = ellip(6,3,50,300/500); fvtool(b,a)
Magnitude and Phase Response of Bandpass FIR Filter
Design a 50th-order bandpass FIR filter with stopband frequencies of 150 Hz and 350 Hz and passband frequencies of 200 Hz and 300 Hz. The sample rate is 1000 Hz. Visualize the magnitude and phase response of the filter.
N = 50; Fstop1 = 150; Fstop2 = 350; Fpass1 = 200; Fpass2 = 300; Fs = 1e3; bpFilt = designfilt("bandpassfir",FilterOrder=N, ... StopbandFrequency1=Fstop1,StopbandFrequency2=Fstop2,... PassbandFrequency1=Fpass1,PassbandFrequency2=Fpass2,... SampleRate=Fs); fvtool(bpFilt,Analysis="freq")
Select the Analysis Parameters button in the toolstrip. An Analysis Parameters window appears that shows the parameters associated with the plot.
FVTool Figure Handle Commands
Display the magnitude response of a 6th-order elliptic filter. Specify a passband ripple of 3 dB, a stopband attenuation of 50 dB, a sample rate of 1 kHz, and a normalized passband edge of 300 Hz. Obtain the handle for FVTool.
[b,a] = ellip(6,3,50,300/500); h = fvtool(b,a)
h = Figure (filtervisualizationtool) with properties: Number: [] Name: 'Figure 1: Magnitude Response (dB)' Color: [0.9400 0.9400 0.9400] Position: [348 376 583 437] Units: 'pixels' Use GET to show all properties
Use the FVTool handle to display the phase response of the filter.
h.Analysis = "phase"
h = Figure (filtervisualizationtool) with properties: Number: [] Name: 'Figure 1: Phase Response' Color: [0.9400 0.9400 0.9400] Position: [1 1 1024 657] Units: 'pixels' Use GET to show all properties
Turn on the plot legend and add text.
legend(h,"Phase plot")
Specify a sample rate of 1 kHz. Display the two-sided centered response.
h.Fs = 1000;
h.FrequencyRange = "[-Fs/2, Fs/2)"
h = Figure (filtervisualizationtool) with properties: Number: [] Name: 'Figure 1: Phase Response' Color: [0.9400 0.9400 0.9400] Position: [1 1 1024 657] Units: 'pixels' Use GET to show all properties
View the all the properties of the plot. The properties specific to FVTool are at the end of the list.
get(h)
Grid: on Legend: 'on' DesignMask: 'off' SOSViewSettings: [1x1 dspopts.sosview] Fs: 1000 Alphamap: [0 0.0159 0.0317 0.0476 0.0635 0.0794 0.0952 0.1111 0.1270 0.1429 0.1587 0.1746 0.1905 0.2063 0.2222 0.2381 0.2540 0.2698 0.2857 0.3016 0.3175 0.3333 0.3492 0.3651 0.3810 0.3968 0.4127 0.4286 0.4444 0.4603 ... ] (1x64 double) CloseRequestFcn: 'closereq' Color: [0.9400 0.9400 0.9400] Colormap: [256x3 double] ContextMenu: [0x0 GraphicsPlaceholder] CurrentAxes: [1x1 Axes] CurrentCharacter: '' CurrentObject: [0x0 GraphicsPlaceholder] CurrentPoint: [0 0] DockControls: off FileName: '' IntegerHandle: off InvertHardcopy: on KeyPressFcn: '' KeyReleaseFcn: '' Name: 'Figure 1: Phase Response' NextPlot: 'add' NumberTitle: off PaperUnits: 'inches' PaperOrientation: 'portrait' PaperPosition: [-0.8700 2.2150 10.2400 6.5700] PaperPositionMode: 'auto' PaperSize: [8.5000 11] PaperType: 'usletter' Pointer: 'arrow' PointerShapeCData: [16x16 double] PointerShapeHotSpot: [1 1] Position: [1 1 1024 657] Renderer: 'opengl' RendererMode: 'auto' Resize: on ResizeFcn: @(~,~)fix_listbox_position(this,hFVT) SelectionType: 'normal' ToolBar: 'none' Type: 'figure' Units: 'pixels' WindowButtonDownFcn: '' WindowButtonMotionFcn: '' WindowButtonUpFcn: '' WindowKeyPressFcn: '' WindowKeyReleaseFcn: '' WindowScrollWheelFcn: '' WindowStyle: 'docked' BeingDeleted: off ButtonDownFcn: '' Children: [5x1 Graphics] Clipping: on CreateFcn: '' DeleteFcn: '' BusyAction: 'queue' HandleVisibility: 'off' HitTest: on Interruptible: on Parent: [1x1 Root] Selected: off SelectionHighlight: on Tag: 'filtervisualizationtool' UserData: [] Visible: on NumberofPoints: 8192 OverlayedAnalysis: '' PhaseUnits: 'Radians' NormalizedFrequency: 'off' FrequencyScale: 'Linear' FrequencyVector: [0 0.0039 0.0078 0.0118 0.0157 0.0196 0.0235 0.0275 0.0314 0.0353 0.0392 0.0431 0.0471 0.0510 0.0549 0.0588 0.0627 0.0667 0.0706 0.0745 0.0784 0.0824 0.0863 0.0902 0.0941 0.0980 0.1020 0.1059 0.1098 0.1137 ... ] (1x256 double) PolyphaseView: 'off' ShowReference: 'on' PhaseDisplay: 'Phase' Analysis: 'phase' FrequencyRange: '[-Fs/2, Fs/2)'
Related Examples
Programmatic Use
fvtool(b
,a
)
b
,a
)fvtool(
opens FVTool
and displays the magnitude response of the digital filter defined with numerator
b
,a
)b
and denominator a
. Specify b
and a
coefficients in ascending order of power z-1.
fvtool(sos
)
sos
)fvtool(
opens FVTool and displays the
magnitude response of the digital filter defined by the L-by-6 matrix of
second order sections:sos
)
The rows of sos
contain the numerator and denominator coefficients
bik and
aik of the cascade of second-order sections of
H(z):
The number of sections L must be greater than or equal to 2. If the
number of sections is less than 2, fvtool
considers the input to be a
numerator vector.
fvtool(d
)
d
)fvtool(
opens FVTool and displays the
magnitude response of a digital filter d
)d
. Use designfilt
to generate d
based on frequency-response
specifications.
fvtool(b1,a1,b2,a2,...,bN,aN)
fvtool(b1,a1,b2,a2,...,bN,aN)
opens FVTool and displays the
magnitude responses of multiple filters defined with numerators b1
, …,
bN
and denominators a1
, ...,
aN
.
fvtool(sos1
,sos2
,...,sosN
)
sos1
,sos2
,...,sosN
)fvtool(
opens FVTool and displays the magnitude responses of multiple filters defined with second
order section matrices sos1
,sos2
,...,sosN
)sos1
, sos2
, ...,
sosN
.
fvtool(Hd
)
Hd
)fvtool(
opens FVTool and displays the
magnitude responses for the Hd
)dfilt
filter object Hd
or the array of dfilt
filter objects.
fvtool(Hd1
,Hd2
,...,HdN
)
Hd1
,Hd2
,...,HdN
)fvtool(
opens FVTool and displays the magnitude responses of the filters in the
Hd1
,Hd2
,...,HdN
)dfilt
objects Hd1
, Hd2
,
..., HdN
.
h
= fvtool(___)
h
= fvtool(___)
returns a figure
handle h
= fvtool(___)h
. You can use this handle to interact with FVTool from the
command line. For more information, see Controlling FVTool from the MATLAB Command Line.
More About
Controlling FVTool from the GUI
Display and analyze responses of one or multiple filters using controls on the toolstrip.
By default, the app displays the magnitude response of a filter. To change the display, select an option from the Analysis list in the Analysis section of the toolstrip.
To overlay a second response on the plot, select an available response from the Overlay Analysis list in the Analysis section of the toolstrip. The app adds a second y-axis to the right side of the response plot. The Analysis Parameters dialog box shows parameters for the x-axis and both y-axes.
To adjust view settings, analysis parameters, or specify sampling frequency, use the corresponding buttons on the toolstrip. You can also toggle the plot legend and grid.
To edit a plot, first click Send to Figure. In the new figure window, use the plot editing toolbar.
Analysis Types
FVTool has these analysis types:
Analysis | Description |
---|---|
Magnitude response | |
Phase response |
|
Magnitude response and phase response |
|
Group delay |
|
Phase delay |
|
Impulse response |
|
Step response |
|
Pole-zero plot |
|
Filter coefficients |
|
Filter information |
|
Linking to Filter Designer
When the Filter Designer app displays the analysis for a
filter, in the app, select View > Filter Visualization Tool or the Full View Analysis toolbar button
to open FVTool for the filter. In
FVTool, use the Link button to link to Filter
Designer. FVTool updates the current display with any changes made to the filter in
Filter Designer. By default, the app retains the current filter and adds the
new filter to the display. To remove the current filter and insert the new filter, select
the Replace check box in the Filter Designer
section of the toolstrip.
Version History
Introduced before R2006aR2022a: Controls are on the toolstrip
The behavior of fvtool has changed. In previous releases, the app had plot editing and analysis toolbars. Starting this release, access filter visualization controls on the toolstrip. To edit a plot, first export the plot to a figure and then use the figure controls.
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)