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

This example shows how to add a spectral mask to an existingdsp.SpectrumAnalyzerSystem object scope and get the status withgetSpectralMaskStatus.

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,“低erMask',-55);fori=1:100 scope(sine() + 0.05*randn(1024,2));endres = 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 thedsp.SpectrumAnalyzerobject.

Output Arguments

collapse all

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

Field Description
IsCurrentlyPassing

Indicator of whether one or more masks are currently passing

1— All masks are passing

0— One or more masks are failing

NumPassedTests Number of mask tests that have passed
NumTotalTests Total number of mask tests
SuccessRate Percentage of tests that have passed
FailingChannels Array of channel numbers that are currently failing the mask test
FailingMasks Character array of which masks are currently failing:'None','Upper',“低er', or'Upper and lower'
SimulationTime Simulation time

Introduced in R2017a