Main Content

FVTool

R2026b

(To be removed) Filter Visualization Tool

FVTool will be removed in a future release. Use Filter Analyzer instead. For more information, see Version History.

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.

If you have installed the DSP System Toolbox™, FVTool can also visualize the frequency response of a filter System object™. If you need to filter streaming data in real time, using System objects is the recommended approach. For more information, see fvtool (DSP System Toolbox).

Filter Visualization Tool

Open the FVTool

FVTool can be opened programmatically using one of the methods described in Programmatic Use.

Examples

expand all

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 response of an elliptic filter in FVTool.

Parameters

expand all

Analysis Tab

Click New to add a new display.

FVTool supports these display options:

  • Legend — Toggle to show or hide legends in the active display.

  • Grid — Toggle to show or hide the grid in the active display.

  • Specification Mask — Toggle to show or hide the specification mask in the active display.

  • Reference Filters — Toggle to show or hide the double-precision reference responses for quantized filters in the active display.

  • Polyphase View — Toggle to show or hide the polyphase decompositions of polyphase filters in the active display. For more information about polyphase decomposition of multirate filters, see polyphase (DSP System Toolbox).

  • SOS View Settings — Click to set up visualization of second-order sections (SOS) in the active display. Select any of these options:

    • Overall filter — Show the overall response of the filter.

    • Individual sections — Show filter responses of individual sections.

    • Cumulative sections — Show filter responses of cumulative sections.

      If you select this option, you can also use secondary-scaling points.

    • User-defined — Show filter responses of selected sections or combinations of sections. To specify your selection, type a cell array.

  • User-defined Spectral Mask — Click to set up your own spectral mask and show it in the active display.

    • Select or clear the Enable Mask check box to show or hide the spectral mask in the active display.

    • Select or clear the Normalized Frequency check box to use normalized frequency (π rad/sample) or cyclical frequency.

    • Specify values for the frequencies of interest, magnitude units, and magnitudes of interest. The frequencies and the magnitudes must be finite vectors of the same size.

Expand this gallery to choose a base and optional secondary analysis for the active display. Choose options using the thumbnail view or the details view of the gallery.

  • Analysis — Choose the base analysis type.

  • Overlay Analysis — Optionally, choose the secondary analysis that overlays the base analysis.

To access the options available for each analysis, use the Analysis Parameters button.

FVTool supports the these analyses:

  • Frequency-domain — Magnitude response, phase response, magnitude and phase response, group delay response, phase delay, magnitude response estimate, and round-off noise power spectrum.

  • Time-domain — Impulse response and step response.

  • Other — Pole-zero plot, filter coefficients, and filter information.

Click Analysis Parameters to set up the analysis in the current display.

Frequency Options

For all frequency-domain analyses, you can select these options:

  • Normalized Frequency —Select this check box to analyzes filter responses using normalized frequencies. Otherwise, use cyclical frequencies.

    Frequency Scale — To display responses in linear frequency scale, select Linear. To use a logarithmic frequency scale, select Log.

  • Frequency Range — Specify the frequency range of the displayed response as one of these options:

    • [0, pi) or [0, Fs/2) (one-sided) — Display responses over positive frequencies only.

    • [0, 2pi) or [0, Fs) (two-sided) — Display responses over the whole frequency range.

    • [-pi, pi) or [-Fs/2, Fs/2) (centered) — Display responses over the whole frequency range centered at zero.

    • Specify freq. vector — Display responses over a custom range of frequencies that you specify.

  • Number of Points — Specify the number of discrete Fourier transform points to use to display frequency-domain responses.

  • Frequency Vector — Specify an n-element vector that lists n discrete Fourier transform points to use to display frequency-domain responses.

Analysis Options

Depending on the analysis selected from the Analysis gallery, FVTool displays additional options.

Click Sampling Frequency to set up the analysis sample rate in the current display.

Click Send to Figure to open the current display in a new figure.

Click Link to link this filter to Filter Designer.

Programmatic Use

fvtool(b,a) opens FVTool and displays the magnitude response of the digital filter defined with numerator b and denominator a. Specify b and a coefficients in ascending order of power z-1.

fvtool(sos) opens FVTool and displays the magnitude response of the digital filter defined by the L-by-6 matrix of second order sections:

sos=[b01b11b211a11a21b02b12b221a12a22⋮⋮⋮⋮⋮⋮b0Lb1Lb2L1a1La2L]

The rows of sos contain the numerator and denominator coefficients bik and aik of the cascade of second-order sections of H(z):

H(z)=g∏k=1LHk(z)=g∏k=1Lb0k+b1kz−1+b2kz−21+a1kz−1+a2kz−2.

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) opens FVTool and displays the magnitude response of a digital filter d. Use designfilt to generate d based on frequency-response specifications.

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) opens FVTool and displays the magnitude responses of multiple filters defined with second order section matrices sos1, sos2, ..., sosN.

fvtool(Hd) opens FVTool and displays the magnitude responses for the dfilt filter object Hd or the array of dfilt filter objects.

fvtool(Hd1,Hd2,...,HdN) opens FVTool and displays the magnitude responses of the filters in the dfilt objects Hd1, Hd2, ..., HdN.

h = fvtool(___) returns a figure handle h. You can use this handle to interact with FVTool from the command line. For more information, see Control FVTool Using MATLAB Command Line.

More About

expand all

Version History

Introduced before R2006a

expand all