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

This example shows how to add a spectral mask to an existing dsp.SpectrumAnalyzer System object scope and get the status with getSpectralMaskStatus.

sine = dsp.SineWave('Frequency',[98 100],'SampleRate',1000);
sine.SamplesPerFrame = 1024;
scope = dsp.SpectrumAnalyzer('SampleRate',sine.SampleRate, ...
       'PlotAsTwoSidedSpectrum',false,'ShowLegend',true);
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: 0
        NumPassedTests: 1
         NumTotalTests: 33
           SuccessRate: 3.0303
          FailingMasks: 'Lower'
       FailingChannels: [1 2]
        SimulationTime: 101.3760

In the Spectrum Analyzer, you can see the same information in the Spectral Mask panel.

show(scope);
release(scope);

Input Arguments

collapse all

Spectrum Analyzer with spectral masks whose status you want to check. Specified by the name of the dsp.SpectrumAnalyzer object.

Output Arguments

collapse all

The results return the current status of the spectral mask with these properties:

FieldDescription
IsCurrentlyPassing

Indicator of whether one or more masks are currently passing

1 — All masks are passing

0 — One or more masks are failing

NumPassedTestsNumber of mask tests that have passed
NumTotalTestsTotal number of mask tests
SuccessRatePercentage of tests that have passed
FailingChannelsArray of channel numbers that are currently failing the mask test
FailingMasksCharacter array of which masks are currently failing: 'None', 'Upper', 'Lower', or 'Upper and lower'
SimulationTimeSimulation time

Introduced in R2017a