Controlling FVTool from the MATLAB Command Line
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 these properties.
Analysis
— Displays the specified type of analysis plot. This table lists all analysis types and how to invoke them. 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 Option Magnitude plot
"magnitude"
Phase plot
"phase"
Magnitude and phase plot
"freq"
Group delay plot
"grpdelay"
Phase delay plot
"phasedelay"
Impulse response plot
"impulse"
Step response plot
"step"
Pole-zero plot
"polezero"
Filter coefficients
"coefficients"
Filter information
"info"
Magnitude response estimate
(Available only with the DSP System Toolbox product. For more information, see
freqrespest
(DSP System Toolbox).)"magestimate"
Round-off noise power
(Available only with the DSP System Toolbox product. For more information, see
noisepsd
(DSP System Toolbox).)"noisepower"
Grid
— Controls whether the grid is"on"
or"off"
.Legend
— Controls whether the legend is"on"
or"off"
.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, FVTool applies each value to its corresponding filter. If it is a scalar, FVTool applies the same value to all filters.SosViewSettings
— (This option is available only if you have the DSP System Toolbox product.) For second-order sections filters, this controls how the filter is displayed. TheSOSViewSettings
property contains an object so you must use this syntax to set it:set(h.SOSViewSettings,View=
, whereviewtype
)viewtype
is one of these: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 specify secondary scaling, 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. By default, the display does not use secondary scaling. To turn on secondary scaling, use this syntax.
set(h.SOSViewSettings,View="Cumulative",SecondaryScaling=true)
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{1:4}
plots the combined response for all four sections, and entering{1,2,3,4}
plots the response for each section individually.
Note
You can change other properties of FVTool from the command line using the
set
function. Use get(h)
to view property tags and
current property settings.
You can use these 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
addfilter(h,filtobj,Fs=10)
.
setfilter(h,filtobj)
replaces the filter in FVTool with the filter
specified in filtobj
. You can set the sampling frequency as described
above.
deletefilter(h,index)
deletes the filter at the FVTool cell array
index
location.
legend(h,str1,str2,...)
creates a legend in FVTool by associating
str1
with filter 1, str2
with filter 2, etc. For more
information, see legend
.