Main Content

showUserDefinedMask

Show or hide user-defined spectral mask in Filter Analyzer app

Since R2024a

Description

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

  • For the app to show the mask, you must specify the Analysis argument of fa either "magnitude" or "magestimate". You must not specify an overlaid analysis.

example

showUserDefinedMask(___,DisplayNums=dispnums) specifies the displays dispnums on which to show or hide the mask, in addition to the arguments from the previous syntax.

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)

Hide the mask.

showUserDefinedMask(fa,false)

Input Arguments

collapse all

Filter Analyzer app handle, specified as a filterAnalyzer object.

Show option, specified as a logical 0 (false) or 1 (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.

If showit is false, you must omit this argument.

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

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

Displays on which to toggle the user-defined mask, 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