Main Content

showFilters

Show filters in Filter Analyzer app

Since R2024a

Description

example

showFilters(fa,showit) shows all filters in Filter Analyzer on the active display when showit is true and hides them when showit is false. If there is no display, the app adds one and plots the filters on it. If you want to replace only a subset of the filters, use FilterNames to specify which ones.

showFilters(___,Name=Value) specifies additional options using name-value arguments. You can choose the filters to show or hide and the display in which you want to show them or hide them.

dispnum = showFilters(___) returns the identification number of the new display, if one was added.

Examples

collapse all

Design two lowpass filters and display their magnitude responses in Filter Analyzer.

d1 = designfilt("lowpassiir", ...
    PassbandFrequency=0.45,StopbandFrequency=0.55);
d2 = designfilt("lowpassiir", ...
    PassbandFrequency=0.25,StopbandFrequency=0.35);
fa = filterAnalyzer(d1,d2,FilterNames=["LP1" "LP2"]);

Add a display to analyze phase response. Set the number of NFFT points to 1024. Show the filters.

phaseDispNum = addDisplays(fa,Analysis="phase",NFFT=1024);

showFilters(fa,true, ...
    FilterNames=["LP1" "LP2"],DisplayNums=phaseDispNum);

Remove the filter plots from the phase response display.

showFilters(fa,false,DisplayNums=phaseDispNum);

Input Arguments

collapse all

Filter Analyzer app handle, specified as a filterAnalyzer object.

Show option, specified as false or true.

Data Types: logical

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: FilterNames=["LP" "HP"],SampleRates=[150 3e3]

Displays to plot filters, specified as a vector of display numbers. If you do not specify this argument, Filter Analyzer uses the active display. Use display identification numbers to target displays when using other Filter Analyzer functions. Identification numbers appear above the plotting area of the app, on the tabs that correspond to the different displays.

Example: [1 4]

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Filter names, specified as a string vector. Filter names are the names that identify the different filters in the app Filters table. Use this argument to specify which filters you want to appear in the selected displays.

Example: ["LPbutter" "LPelliptic"]

Data Types: char | string

Output Arguments

collapse all

Display identification number. If more than one display is added, dispnum is a vector. Use display identification numbers to target displays when using other Filter Analyzer functions. Identification numbers appear above the plotting area of the app, on the tabs that correspond to the different displays.

Version History

Introduced in R2024a