DocumentationHelp Center
Get test results of current spectral mask
results = getSpectralMaskStatus(scope)
example
results = getSpectralMaskStatus(scope) returns the current status of the spectral mask on the spectrum analyzer, scope, in a structure, results.
results
scope
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.
dsp.SpectrumAnalyzer
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);
Spectrum Analyzer with spectral masks whose status you want to check. Specified by the name of the dsp.SpectrumAnalyzer object.
The results return the current status of the spectral mask with these properties:
IsCurrentlyPassing
Indicator of whether one or more masks are currently passing
1 — All masks are passing
1
0 — One or more masks are failing
0
NumPassedTests
NumTotalTests
SuccessRate
FailingChannels
FailingMasks
'None'
'Upper'
'Lower'
'Upper and lower'
SimulationTime
dsp.SpectrumAnalyzer | getMeasurementsData | SpectrumAnalyzerConfiguration
getMeasurementsData
SpectrumAnalyzerConfiguration
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office