Main Content

getSpectralMaskStatus

Get test results of current spectral mask

Description

example

results = getSpectralMaskStatus(scope) returns the current status of the spectral mask on the spectrum analyzer, scope, in a structure, results.

Examples

collapse all

Add a spectral mask to an existing spectrumAnalyzer object. Use the getSpectralMaskStatus function to get the spectral mask status.

sine = dsp.SineWave(Frequency=[98 100],SampleRate=1000);
sine.SamplesPerFrame = 1024;   
scope = spectrumAnalyzer(SampleRate=sine.SampleRate,...
       PlotAsTwoSidedSpectrum=false,ShowLegend=true,YLimits=[-60 40]);
hide(scope);

scope.SpectralMask.EnabledMasks = "upper-and-lower";
upperMask = [0 -10; 90 -10; 90 30; 110 30; 110 -10; 500 -10];
set(scope.SpectralMask,UpperMask=upperMask,LowerMask=-55);

for i=1:100       
    scope(sine() + 0.05*randn(1024,2));
end

res = getSpectralMaskStatus(scope)
res = struct with fields:
    IsCurrentlyPassing: 1
        NumPassedTests: 50
         NumTotalTests: 50
           SuccessRate: 100
          FailingMasks: ''
       FailingChannels: [1x0 double]
        SimulationTime: 102.3990

You can also view the status in the Spectral Mask tab on the Spectrum Analyzer toolstrip.

show(scope);
release(scope);

Input Arguments

collapse all

Spectrum Analyzer with spectral masks, specified as one of the following:

Output Arguments

collapse all

Current status of the spectral mask, returned as a structure with these fields.

FieldDescription
IsCurrentlyPassing

Pass status of one or more masks.

1 — All masks have passed

0 — One or more masks have failed

NumPassedTestsNumber of mask tests that have passed
NumTotalTestsTotal number of mask tests
SuccessRatePercentage of tests that have passed
FailingChannelsArray of channel numbers that have currently failed the mask test
FailingMasksMasks that have currently failed: "none", "upper", "lower", or "upper-and-lower"
SimulationTimeSimulation time

Version History

Introduced in R2017a

expand all