Main Content

showUserDefinedMask

Specify and toggle user-defined spectral mask in Filter Analyzer app displays

Since R2024a

Description

example

showUserDefinedMask(fa,showit,mask) shows or hides a user-defined mask on the active display in the Filter Analyzer app fa, depending on whether showit is true or false.

  • For the app to show the mask, the Analysis property must be set to either "magnitude" or "magestimate". There must be no overlaid analysis.

showUserDefinedMask(___,DisplayNums=dispnums) shows or hides mask on the displays specified in dispnums.

Examples

collapse all

Design a lowpass filter and show it in Filter Analyzer. Define a mask that specifies values of 0 dB at DC and 0.45π rad/sample and –40 dB at 0.55π rad/sample and the Nyquist frequency.

d1 = designfilt("lowpassfir", ...
    PassbandFrequency=0.45,StopbandFrequency=0.55);
fa = filterAnalyzer(d1);

mask = [[0 0.45 0.55 1]' [0 0 -40 -40]'];
showUserDefinedMask(fa,true,mask)

Toggle the mask off.

showUserDefinedMask(fa,false)

Input Arguments

collapse all

Filter Analyzer app handle, specified as a filterAnalyzer object.

Show option, specified as false or true.

Data Types: logical

User-defined mask, specified as a two-column matrix of finite numeric values.

  • The first column of mask contains normalized frequency values in rad/sample.

  • The second column of mask contains the magnitude values in dB at the frequencies specified in the first column.

This argument must be omitted if showit is false.

Example: [[0 0.45 0.55 1]' [0 0 -40 -40]']

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

Display numbers for user-defined mask toggling, specified as an integer or a vector of integers. If you do not specify this argument, Filter Analyzer toggles the user-defined mask in the active display. Identification numbers appear above the plotting area of the app, on the tabs that correspond to the different displays.

Example: [1 5]

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

Version History

Introduced in R2024a