Configure Spectrum Analyzer MATLAB Object
When you use the
spectrumAnalyzer object in MATLAB®, you can configure many object settings using the Spectrum Analyzer user
interface and tools. These sections show you how to use the Spectrum Analyzer interface
These figures highlight the important aspects of the Spectrum Analyzer window.
View type set to Spectrum
View type set to Spectrogram
Toolstrip is the top of the Spectrum Analyzer window that contains all the settings and controls. Use these settings to control the Spectrum Analyzer display.
The toolstrip contains the following tabs:
Analyzer Tab –– Control spectrum and spectrogram display settings.
Estimation Tab –– Control settings related to spectral estimation.
Measurements Tab –– Control signal measurements.
Spectrum Tab –– Control trace and scale options for the spectrum view.
Spectrogram Tab –– Control trace and scale options for the spectrogram view.
Spectral Mask Tab –– Configure upper and lower limits for spectral mask.
Channel Measurements Tab –– Control channel measurements.
Use the pin button to keep the toolstrip showing or the arrow button to hide the toolstrip.
Legend –– If the input signal has multiple channels, the scope uses an index number to identify each channel of the signal. For example, the legend for a two-channel signal displays the default names as
Channel 2. To show the legend, on the Analyzer tab, click Legend.
By default, the axes background in the scope is black, and the scope chooses line colors for each channel in a manner similar to the Scope (Simulink) block. When the axes background is black, the scope assigns each channel of each input signal a line color in the order shown in the legend.
If there are more than seven channels, then the scope repeats this order when assigning line colors to the remaining channels. When the axes background is a color other than black, the scope assigns line colors in this order.
To choose line colors or background colors, on the Analyzer tab, click Settings (). Under Color and Styling, use Background to change the background color of the scope, and Axes to change the background of the plot. Click Line to choose channel, and Color to change the line color of the selected channel.
Title, Y-Axis Label, Y-Axis Limits, Colorbar Limits — You can customize the title, y-axis label, y-axis limits, and the color limits (in spectrogram view) from Settings or by using the
The x-axis is always a frequency axis. The X-Axis Label is therefore either
Min X-Axis, Max X-Axis –– Spectrum Analyzer determines the x-axis limits based on the value of the
FrequencySpanproperty. To change the x-axis limits in the Spectrum Analyzer interface, click the Estimation tab, in the Frequency Options section, select an option fromFrequency Span.
Display Controls –– To scale the plot axes, use the mouse to pan around the axes and the scroll button on your mouse to zoom in and out of the plot. Additionally, you can use the buttons that appear when you hover over the plot window.
— Maximize the axes, hiding all labels and insetting the axes values.
— Zoom in on the plot.
— Pan the plot.
— Autoscale the axes to fit the shown data.
Status — Current status.
Processing–– After you run the object and before you run the
Stopped–– After you call the
Ready–– After you create the scope object and before you call the object for the first time.
Status bar –– The status bar shows several signal display properties. To enable these properties to show in the status bar, right-click the status bar and select the properties in the Customize Status Bar window.
The Analyzer tab contains these sections.
Views –– Choose to view a spectrum, a spectrogram, or both. You can select the type of spectrum by clicking the Spectrum drop-down and selecting one of the options. The Spectrum Analyzer updates the display accordingly.
Configuration –– Modify the Spectrum Analyzer settings, enable the legend and colorbar (for spectrogram display), and set the display layout.
Share –– Generate a MATLAB script to create a scope with the current settings. You can even copy and print the display. For more information on generating a script, see
The Estimation tab contains these sections.
Domain –– Select the domain of the input signal that you want to visualize.
Frequency Resolution –– Select the spectral estimation method as
Welch. For more information on these methods, see Algorithms.
Averaging –– Select the method of averaging the power spectral estimate as
VBW(video bandwidth) or
Frequency Options –– Select the frequency span. This property determines the x-axis (frequency axis) limits in the display.
Window Options –– When you set the spectral estimation method to
Welch, the Spectrum Analyzer uses Welch's method of averaged modified periodogram. In this technique, the algorithm applies a window to the time-domain data before computing FFT and the power spectrum estimate.
You can select the window and specify the corresponding window options.
The Measurements tab contains these sections.
Channel –– Select the channel for which you want the Spectrum Analyzer to display the measurements.
Cursors –– Enable Data Cursors in the display. For more information, see Cursor Measurements.
Peaks –– Enable Peak Finder to display the largest peak values. You can specify the number of peaks, minimum height of the peaks, minimum distance between peaks, and label the peaks. For more information, see Peak Measurements.
Distortion –– Enable Distortion to compute and display the harmonic and intermodulation distortion measurements. For more information, see Distortion Measurements.
To enable the Spectrum tab, in the Analyzer tab, in the Views section, click Spectrum.
The Spectrum tab contains these sections.
To enable the Spectrogram tab, in the Analyzer tab, in the Views section, click Spectrogram.
In addition to the trace and scale options, the Spectrogram tab also contains Time Options. In the Time Options section, you can specify the time resolution for each spectrogram line and the time span of the spectrogram display.
Spectral Mask Tab
To enable the Spectral Mask tab, in the
Analyzer tab, in the Views section,
click Spectrum, and select either
Power Density in
the spectrum drop-down options.
Enable to show upper and lower masks in the Spectrum Analyzer. You can specify the upper and lower limits of the mask, and select the channel over which the Spectrum Analyzer applies the mask. For more information, see Spectral Mask.
Channel Measurements Tab
To enable the Channel Measurements tab, in the Analyzer tab, in the Views section, click Spectrum. Use the Channel Measurements tab to enable the Spectrum Analyzer to compute and display the occupied bandwidth and adjacent channel power ratio. For more information, see Channel Measurements.