Main Content

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 and tools.

Signal Display

These figures highlight the important aspects of the Spectrum Analyzer window.

View type set to Spectrum

Spectrum Analyzer window with callouts pointing to the toolstrip, title axes labels, status

View type set to Spectrogram

Spectrum Analyzer window with view type set to Spectrogram

  • Toolstrip

    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 1 and 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.

    When the background is black, the default colors of the input channels are yellow, blue, orange, green, purple, teal, and pink.

    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.

    When the background is not black, the default colors of the input channels are dark blue, orange, dark yellow, purple, green, light blue, and maroon.

    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 Title, YLabel, YLimits, and ColorLimits properties.

    The x-axis is always a frequency axis. The X-Axis Label is therefore either Frequency (Hz) or Frequency (kHz).

  • Min X-Axis, Max X-Axis –– Spectrum Analyzer determines the x-axis limits based on the value of the FrequencySpan property. 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 button — Maximize the axes, hiding all labels and insetting the axes values.

    • Zoom button — Zoom in on the plot.

    • Panning button — Pan the plot.

    • Autoscale button — Autoscale the axes to fit the shown data.

  • Status — Current status.

    • Processing –– After you run the object and before you run the release function.

    • Stopped –– After you call the release function.

    • 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.

    Select Sample Rate, RBW, and VBW in the customize status bar window

Analyzer Tab

Shows the settings in the analyzer tab.

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.

    Clicking on the drop down arrow under Spectrum and Spectrogram shows Power, Power Density, and RMS.

  • Bandwidth –– Specify the sample rate, RBW, and the frequency offset for the frequency axis (x-axis).

  • 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 generateScript.

Estimation Tab

Showing the Estimation tab of the toolstrip with method set to filter bank. Window options section is disabled.

Showing the Estimation tab of the toolstrip with method set to Welch. Window options section is enabled.

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 Filter bank or Welch. For more information on these methods, see Algorithms.

  • Averaging –– Select the method of averaging the power spectral estimate as VBW (video bandwidth) or Exponential.

  • 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.

Measurements Tab

Showing the Measurements tab of the toolstrip.

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.

Spectrum Tab

Showing the Spectrum tab of the toolstrip.

To enable the Spectrum tab, in the Analyzer tab, in the Views section, click Spectrum.

The Spectrum tab contains these sections.

  • Trace Options –– Choose to display a two-sided spectrum or a one-sided spectrum, and select to show maximum-hold trace, minimum-hold trace, or normal trace.

  • Scale –– Specify reference load and spectrum units.

Spectrogram Tab

Showing the Spectrogram tab of the toolstrip.

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

Showing the Spectral Mask tab of the toolstrip.

To enable the Spectral Mask tab, in the Analyzer tab, in the Views section, click Spectrum, and select either Power or 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

Showing the Channel Measurements tab of the toolstrip with Type set to Occupied BW.

Showing the Channel Measurements tab of the toolstrip with Type set to ACPR.

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.

See Also

Related Topics