Spectrum Analyzer

Display frequency spectrum

Libraries:
DSP System Toolbox / Sinks
DSP System Toolbox HDL Support / Sinks

Description

The Spectrum Analyzer block, referred to here as the scope, displays frequency-domain signals and the frequency spectrum of time-domain signals. The scope shows the spectrum view and the spectrogram view. The block algorithm performs spectral estimation using the filter bank method and Welch's method of averaged modified periodograms. You can customize the spectrum analyzer display to show the data and the measurement information that you need. For more details, see Algorithms.

You can use the Spectrum Analyzer block in models running in Normal or Accelerator simulation modes. You can also use the Spectrum Analyzer block in models running in Rapid Accelerator or External simulation modes with some limitations.

You can use the Spectrum Analyzer block inside all subsystems and conditional subsystems. Conditional subsystems include enabled subsystems, triggered subsystems, enabled and triggered subsystems, and function-call subsystems. See Conditionally Executed Subsystems Overview (Simulink) for more information.

Programmatic Control

You can configure and display the Spectrum Analyzer settings from the command line with the SpectrumAnalyzerConfiguration object.

Ports

Input

expand all

Connect the signals you want to visualize. You can have up to 96 input ports. Input signals must have these characteristics:

• Signal Domain — Frequency or time signals.

• Type — Discrete signals.

• Data type — Any data type that Simulink supports. See Data Types Supported by Simulink (Simulink).

• Dimension — One dimensional (vector), two dimensional (matrix), or multidimensional (array) signals. Input signal must have a fixed number of channels. See Signal Dimensions (Simulink) and Determine Signal Dimensions (Simulink).

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point
Complex Number Support: Yes

Specify the frequencies in Hz. The frequency vector must be a finite, monotonically increasing, column vector with two or more elements. The number of frequency vector points must be equal to the input frame size. You can also specify the frequencies using the Frequency (Hz) parameter on the Estimation tab.

Dependency

To enable this port, set the:

• Input Domain parameter on the Estimation tab to Frequency.

• Frequency (Hz) parameter on the Estimation tab to Input port.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Specify the resolution bandwidth in Hz through this port. RBW defines the smallest positive frequency that can be resolved by the scope. You can also specify the RBW value using the RBW (Hz) parameter on the Analyzer tab.

Dependency

To enable this port, set the RBW (Hz) parameter on the Analyzer tab to Input port.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Specify the video bandwidth in Hz through this port. Video bandwidth is the bandwidth of the lowpass filter that the scope uses to average or smooth the noise in the signal before displaying it. You can also specify the VBW value using the VBW (Hz) parameter on the Estimation tab.

Dependency

To enable this port, set the:

• Input Domain parameter on the Estimation tab to Time.

• Averaging Method parameter on the Estimation tab to VBW.

• VBW (Hz) parameter on the Estimation tab to Input port.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Parameters

expand all

Analyzer Tab

Views

Set the type of spectrum to display as one of these values:

• Power — Spectrum Analyzer shows the power spectrum.

• Power Density — Spectrum Analyzer shows the power spectral density. The power spectral density is the squared magnitude of the spectrum normalized to a bandwidth of 1 Hz.

• RMS — Spectrum Analyzer shows the root mean squared spectrum. Use this option to view the frequency of voltage or current signals.

Tunable: Yes

Dependency

To enable this parameter, set the Input Domain parameter on the Estimation tab to Time.

Programmatic Use

 Block Parameter: SpectrumType Type: character vector or string scalar

Set the type of spectrogram to display as one of these values:

• Power — Spectrum Analyzer shows the power spectrogram.

• Power Density — Spectrum Analyzer shows the power density of the spectrogram. The power spectrogram density is the squared magnitude of the spectrogram normalized to a bandwidth of 1 Hz.

• RMS — Spectrum Analyzer shows the root mean square of the spectrogram. The root-mean-square shows the square root of the mean square. Use this option to view the frequency of voltage or current signals.

Tunable: Yes

Dependency

To enable this parameter, set the Input Domain parameter on the Estimation tab to Time.

Programmatic Use

 Block Parameter: SpectrumType Type: character vector or string scalar

Bandwidth

Specify the sample rate the scope uses in Hz as one of the following:

• Inherited –– Use this option to specify the same sample rate as the input signal.

• Positive scalar –– The sample rate you specify must be at least twice the sample rate of the input signal. Otherwise, you might see unexpected behavior when visualizing your signal in the scope due to aliasing.

To display this property on the status bar, right-click the status bar at the bottom of the Spectrum Analyzer window and select Sample Rate.

Tunable: Yes

Programmatic Use

 Block Parameter: SampleRate, SampleRateSource Type: double

Specify the resolution bandwidth in Hz. This parameter defines the smallest positive frequency that can be resolved by the scope. By default, this parameter is set to Auto. In this case, the Spectrum Analyzer determines the appropriate value to ensure that there are 1024 RBW intervals over the specified frequency span.

If you set this parameter to Input port, you can specify the RBW value through an input port on the block.

If you set this parameter to a numeric value, the value must allow at least two RBW intervals over the specified frequency span. In other words, the ratio of the overall frequency span to RBW must be greater than two:

$\frac{span}{RBW}>2$

To display this property on the status bar, right-click the status bar at the bottom of the Spectrum Analyzer window and select RBW.

Tunable: Yes

Programmatic Use

 Block Parameter: RBWSource, RBW Type: character vector, string scalar, double

Specify the offset to apply to the frequency axis (x-axis) in units of Hz as one of the following:

• Scalar — Apply the same frequency offset to all channels.

• Vector — Apply a specific frequency offset for each channel. The vector length must be equal to the number of input channels.

The overall span must fall within the Nyquist Frequency Interval. You can control the overall span in different ways based on how you set the Span (Hz) parameter.

Tunable: Yes

Programmatic Use

 Block Parameter: FrequencyOffset Type: double

Configuration > Spectrum Analyzer Settings ()

The number of input ports to the block, specified as an integer between 1 and 96. To change the number of input ports, drag a new input signal line to the block and the block automatically creates new ports.

Programmatic Use

 Block Parameter: NumInputPorts Type: character vector or string scalar Values: scalar between 1 and 96

Select this parameter to automatically open the Spectrum Analyzer window when you run the simulation.

Programmatic Use

 Block Parameter: OpenAtSimulationStart Type: logical

Specify the font size of labels in the display as Small, Medium, Large, and Extra Large.

Tunable: Yes

Programmatic Use

 Block Parameter: - Type: character vector or string scalar

Specify whether to display a Line or Stem plot in the Spectrum display.

Tunable: Yes

Dependency

To enable this parameter:

• Select Spectrum in the Analyzer tab.

• Select the Normal Trace check box in the Spectrum tab.

Programmatic Use

 Block Parameter: PlotType Type: character vector or string scalar

Specify the y-axis label in the Spectrum display as a character vector or a string scalar. To display signal units, add (%<SignalUnits>) to the label. When simulation starts, Simulink replaces (%SignalUnits) with the units associated with the signals.

For example, for a velocity signal with units of m/s enter

Velocity (%<SignalUnits>)

Tunable: Yes

Dependency

To enable this parameter, select Spectrum in the Analyzer tab.

Programmatic Use

 Block Parameter: YLabel Type: character vector or string scalar

Specify the y-axis limits in the Spectrum Analyzer display as a two-element numeric vector of the form [ymin ymax]. The units of the y-axis limits depend on the Spectrum Unit in the Spectrum tab.

Tunable: Yes

Dependency

To enable this parameter, select Spectrum in the Analyzer tab.

Programmatic Use

 Block Parameter: YLimits Type: double

Specify the display title. Enter %<SignalLabel> to use the signal labels in the Simulink model as the axes titles.

Tunable: Yes

Programmatic Use

 Block Parameter: Title Type: character vector or string

Select this check box to show the grid in the Spectrum Analyzer display.

Tunable: Yes

Programmatic Use

 Block Parameter: ShowGrid Type: logical

Select a valid colormap name for the spectrogram, or enter a three-column matrix with values in the range [0,1] defining RGB triplets. For more information about colormaps, see colormap.

Tunable: Yes

Dependency

To enable this parameter, select Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: Colormap Type: character vector or string scalar

Specify the color limits of the spectrogram as a two-element numeric vector of the form [colorMin colorMax]. The units of the color limits directly depend upon the Spectrum Unit in the Spectrogram tab.

Tunable: Yes

Dependencies

To enable this parameter, select Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: ColorLimits Type: double

When you select this parameter, the scope preserves the colors when you copy the display to the clipboard using the Copy Display and the Print options in the Analyzer tab > Share section.

Tunable: Yes

Specify the background color in the scope figure.

Tunable: Yes

Specify the background color of the axes.

Tunable: Yes

Specify the color of the labels, grid, and the channel names in the legend.

Tunable: Yes

Specify the channel for which you want to modify the visibility, line color, style, width, and marker properties.

Tunable: Yes

Select this check box to display the channel you have selected. If you clear this check box, the selected channel is no longer visible. You can also click the signal name in the legend to control its visibility. For more details, see Legend.

Tunable: Yes

Specify the line style for the selected channel.

Tunable: Yes

Specify the line width for the selected channel.

Tunable: Yes

Specify a data point marker for the selected channel. This parameter is similar to the Marker property for plots. You can choose any of the marker symbols from the drop-down list.

Tunable: Yes

Specify the line color for the selected channel.

Tunable: Yes

Configuration

Click the button to enable the Spectrum Analyzer to display the signal legend. The legend displays the signal names from the model. For signals with multiple channels, the scope appends a channel index after the signal name. Continuous signals have straight lines before their names and discrete signals have step-shaped lines.

You can control which signals are visible using the legend. To hide a signal, in the scope legend, click the signal name. To display the signal, click the signal name again. Alternatively, you can control which signal is visible using the Visible parameter in the Spectrum Analyzer Settings ().

To display only one signal and hide all other signals, right-click the name of the signal you want the scope to display. To show all signals, press Esc.

Note

The legend displays only the first 20 signals. You cannot view or control any additional signals from the legend.

Tunable: Yes

Dependency

To enable the Legend, select Spectrum in the Analyzer tab.

Programmatic Use

 Block Parameter: ShowLegend Type: logical

When you select the button, the Spectrum Analyzer shows the color bar.

Tunable: Yes

Dependencies

To enable the button, select Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: ShowColorbar Type: logical

Stack axes vertically or horizontally by selecting the appropriate configuration in the layout grid.

Tunable: Yes

Dependencies

To enable the Layout, select Spectrum and Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: AxesLayout Type: character vector or string scalar

Share

Click this button to copy the scope display to the clipboard. You can preserve the color in the display by selecting the Preserve colors for copy to clipboard parameter.

Click this button to save the scope display as an image or a PDF or to print the display.

Estimation Tab

Domain

The domain of the input signal you want to visualize. If you visualize time-domain signals, the scope transforms the signal to the frequency spectrum based on the algorithm you specify in the Method parameter.

Programmatic Use

 Block Parameter: InputDomain Type: character vector or string scalar

Set the frequency vector which determines the x-axis of the display to one of these values:

• Auto — The scope calculates the frequency vector from the length of the input. For more details, see Frequency Vector.

• Input port — You specify the frequency vector at the Frequency input port on the block.

• Custom vector — You specify a custom vector as the frequency vector. The length of the custom vector must be equal to the frame size of the input signal.

Tunable: Yes

Dependency

To enable this parameter, set Input Domain to Frequency.

Programmatic Use

 Block Parameter: FrequencyVectorSource, FrequencyVector Type: character vector, string scalar, double

Select the units of the frequency-domain input. This parameter enables the Spectrum Analyzer to scale frequency data when you select a different display unit in the Spectrum Unit parameter in the Estimation tab.

Tunable: Yes

Dependency

To enable this parameter, set Input Domain to Frequency.

Programmatic Use

 Block Parameter: InputUnits Type: character vector or string scalar

Frequency Resolution

Select the spectrum estimation method as one of the following:

• Filter Bank –– Use an analysis filter bank to estimate the power spectrum. Compared to Welch's method, this method has a lower noise floor, better frequency resolution, lower spectral leakage, and requires fewer samples per update.

• Welch –– Use Welch's method of averaged modified periodograms.

For more details on these methods, see Algorithms.

Tunable: Yes

Dependency

To use this parameter, set Input Domain to Time.

Programmatic Use

 Block Parameter: Method Type: character vector or string scalar

Specify the sharpness of the prototype lowpass filter as a real nonnegative scalar in the range [0,1].

Increasing the filter sharpness decreases the spectral leakage and gives a more accurate power reading.

Tunable: Yes

Dependencies

To enable this property, set Method to Filter bank.

Programmatic Use

 Block Parameter: FilterSharpness Type: double

Averaging

Specify the smoothing method as one of the following:

• VBW — Video bandwidth method. The block uses a lowpass filter to smooth the trace and decrease the noise. Use the VBW (Hz) parameter to specify the video bandwidth (VBW) value.

• Exponential — Weighted average of samples. The block computes the average over samples weighted by an exponentially decaying forgetting factor. Use the Forgetting Factor parameter to specify the weighted forgetting factor.

Tunable: Yes

Dependency

To enable this parameter, set Input Domain to Time.

Programmatic Use

 Block Parameter: AveragingMethod Type: character vector or string scalar

Specify the video bandwidth as one of the following:

• Auto –– The Spectrum Analyzer adjusts the VBW such that the equivalent forgetting factor is 0.9.

• Input port –– You specify the frequency vector at the VBW input port on the block.

• Positive scalar –– You specify a positive scalar. The Spectrum Analyzer adjusts the VBW using this value. The value you specify must be less than or equal to Sample Rate (Hz)/2.

For more details on the video bandwidth method, see Averaging Method.

The Spectrum Analyzer shows the VBW value in the status bar at the bottom of the display. To display the VBW value, right-click the status bar and select VBW.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Averaging Method to VBW.

Programmatic Use

 Block Parameter: VBWSource, VBW Type: double

Specify the forgetting factor of the exponential weighted averaging method as a scalar in the range [0,1].

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Averaging Method to Exponential.

Programmatic Use

 Block Parameter: ForgettingFactor Type: double

Frequency Options

Specify the frequency span mode as one of the following:

• Full –– The Spectrum Analyzer computes and plots the spectrum over the entire Nyquist Frequency Interval.

• Span and Center Frequency –– The Spectrum Analyzer computes and plots the spectrum over the interval specified by the Span (Hz) and Center Frequency (Hz) parameters.

• Start and Stop Frequencies –– The Spectrum Analyzer computes and plots the spectrum over the interval specified by the Start Frequency (Hz) and Stop Frequency (Hz) parameters.

Tunable: Yes

Dependency

To enable this parameter, set Input Domain to Time.

Programmatic Use

 Block Parameter: FrequencySpan Type: character vector or string scalar

Specify the frequency span in Hz over which the Spectrum Analyzer computes and plots the spectrum. The overall span, defined by this parameter and the Center Frequency (Hz) parameter, must fall within the Nyquist Frequency Interval. This parameter defines the range of the values shown on the Frequency axis in the Spectrum Analyzer window.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Frequency Span to Span and Center Frequency.

Programmatic Use

 Block Parameter: Span Type: double

Specify the center of the frequency span in Hz over which the Spectrum Analyzer computes and plots the spectrum. Use this parameter with the Span (Hz) parameter to define the frequency span around a center frequency. This parameter defines the midpoint of the Frequency axis in the Spectrum Analyzer window.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Frequency Span to Span and Center Frequency.

Programmatic Use

 Block Parameter: CenterFrequency Type: double

Specify the starting frequency in Hz of the frequency interval over which the Spectrum Analyzer computes and plots the spectrum. The overall span, which is defined by this parameter and the Stop Frequency (Hz) parameter, must fall within the Nyquist Frequency Interval. This parameter defines the leftmost value on the Frequency axis in the Spectrum Analyzer window.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Frequency Span to Start and Stop Frequencies.

Programmatic Use

 Block Parameter: StartFrequency Type: double

Specify the stop frequency in Hz of the frequency interval over which the Spectrum Analyzer computes and plots the spectrum. The overall span, which is defined by this parameter and the Start Frequency (Hz) parameter, must fall within the Nyquist Frequency Interval. This parameter defines the rightmost value on the Frequency axis in the Spectrum Analyzer window.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Frequency Span to Start and Stop Frequencies.

Programmatic Use

 Block Parameter: StopFrequency Type: double

Window Options

Specify the windowing method to apply to the spectrum. Windowing is used to control the effect of sidelobes in spectral estimation. The window you specify affects the window length required to achieve a resolution bandwidth and the required number of samples per update. For more information about windowing, see Windows.

You can use your own spectral estimation window by directly specifying a custom window function name in the Window parameter.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Method to Welch.

Programmatic Use

 Block Parameter: Window, CustomWindow Type: character vector or string scalar

Specify the sidelobe attenuation in dB as a scalar greater than or equal to 45.

Tunable: Yes

Dependency

To enable this parameter, set Window to Chebyshev or Kaiser.

Programmatic Use

 Block Parameter: SidelobeAttenuation Type: double

Specify the percentage of overlap between the previous and the current buffered data segments as a scalar in the range [0 100). The overlap creates a window segment that the scope uses to compute a spectral estimate. The value must be greater than or equal to zero and less than 100.

Tunable: Yes

Dependency

To enable this parameter, set:

• Input Domain to Time.

• Method to Welch.

Programmatic Use

 Block Parameter: OverlapPercent Type: double

Measurements Tab

Channel

The channel for which you need to obtain measurements, specified as a positive integer in the range [1 N], where N is the number of input channels.

Tunable: Yes

Dependency

To enable this parameter, pass some data through the scope.

Programmatic Use

Cursors

Click the button to enable data cursor measurements. Each cursor tracks a vertical line along the signal. The scope displays the difference between x- and y-values of the signal at the two cursors in the box between the cursors.

Tunable: Yes

Programmatic Use

See Enabled.

Select this parameter to position the cursors on the signal data points.

Tunable: Yes

Programmatic Use

See SnapToData.

Select this parameter to lock the frequency difference between the two cursors.

Tunable: Yes

Programmatic Use

See LockSpacing.

Peaks

Click the button to enable peak finder measurements. An arrow appears on the plot at each maxima and a Peaks panel appears at the bottom of the scope window.

Tunable: Yes

Programmatic Use

See Enabled.

Specify the maximum number of peaks to show as a positive integer less than 100.

Tunable: Yes

Programmatic Use

See NumPeaks.

Specify the level above which the scope detects peaks as a real scalar.

Tunable: Yes

Programmatic Use

See MinHeight.

Specify the minimum number of samples between adjacent peaks as a positive integer.

Tunable: Yes

Programmatic Use

See MinDistance.

Specify the minimum difference between the height of the peak and its neighboring samples as a nonnegative scalar.

Tunable: Yes

Programmatic Use

See Threshold.

Click the button to label the peaks. The scope displays the labels (P1, P2, …) above the arrows in the plot.

Tunable: Yes

Programmatic Use

See LabelPeaks.

Distortion

Click the button to enable distortion measurements. A Distortion panel appears at the bottom of the scope window when you click this button.

Tunable: Yes

Programmatic Use

See Enabled.

Specify the type of measurement data to display as Harmonic or Intermodulation. For more details, see Distortion Measurements.

Tunable: Yes

Programmatic Use

See Type.

Specify the number of harmonics to measure as a positive integer less than or equal to 99.

Tunable: Yes

Dependency

To enable this parameter, set Distortion Type to Harmonic.

Programmatic Use

See NumHarmonics.

When you select this parameter, the Spectrum Analyzer adds numerical labels to harmonics in the spectrum display.

Tunable: Yes

Programmatic Use

See LabelValues.

When you select this parameter, the Spectrum Analyzer adds numerical labels to the first-order intermodulation product and third-order frequencies in the Spectrum Analyzer display.

Tunable: Yes

See LabelValues.

Spectrum Tab

Note

This tab appears when you select Spectrum in the Analyzer tab.

Trace Options

Select this check box to enable a two-sided spectrum view. In this view, the Spectrum Analyzer shows both negative and positive frequencies. When the input signal is complex-valued, you must select this parameter. If you clear this check box, the Spectrum Analyzer shows a one-sided spectrum with positive frequencies only. In this case, the input signal data must be real valued.

When you clear this check box, the Spectrum Analyzer uses power folding. The y-axis values are twice the amplitude that they would be if you were to select this parameter, except at 0 and the Nyquist frequency. A one-sided power spectral density (PSD) contains the total power of the signal in the frequency interval from DC to half the Nyquist rate. For more information, see pwelch.

Tunable: Yes

Programmatic Use

 Block Parameter: PlotAsTwoSidedSpectrum Type: logical

When you select this check box, the Spectrum Analyzer calculates and plots the power spectral estimates. The Spectrum Analyzer performs a smoothing operation by averaging several spectral estimates and continues its spectral computations even when you clear this parameter.

Tunable: Yes

Dependencies

To clear this check box, first select either the Max-Hold Trace or the Min-Hold Trace parameters.

To enable this parameter, select Spectrum in the Analyzer tab.

Programmatic Use

 Block Parameter: PlotNormalTrace Type: logical

Select this check box to enable the Spectrum Analyzer to plot the maximum spectral values of all the estimates. The Spectrum Analyzer computes the maximum-hold spectrum at each frequency bin by keeping the maximum value of all the power spectrum estimates. When you clear this check box, the Spectrum Analyzer resets its maximum-hold computations.

Tunable: Yes

Dependency

To enable this parameter, select Spectrum in the Analyzer tab.

Programmatic Use

 Block Parameter: PlotMaxHoldTrace Type: logical

Select this check box to enable the Spectrum Analyzer to plot the minimum spectral values of all the estimates. The Spectrum Analyzer computes the minimum-hold spectrum at each frequency bin by keeping the minimum value of all the power spectrum estimates. When you clear this check box, the Spectrum Analyzer resets its minimum-hold computations.

Tunable: Yes

Dependency

To enable this parameter, select Spectrum in the Analyzer tab.

Programmatic Use

 Block Parameter: PlotMinHoldTrace Type: logical

Scale

Specify the scale to display frequencies as Linear or Log. When the frequency span contains negative frequency values, you cannot choose the logarithmic option.

Tunable: Yes

Dependency

To set the Frequency Scale to Log, clear the Two-Sided Spectrum check box in the section in the Spectrum or the Spectrogram tab (if enabled). If you select the Two-Sided Spectrum check box, then the Frequency Scale parameter is set to Linear.

Programmatic Use

 Block Parameter: FrequencyScale Type: character vector or string scalar

Specify the reference load in ohms that the Spectrum Analyzer uses as a reference to compute the power values.

Tunable: Yes

Dependency

To enable this parameter, set:

• Spectrum type to Power or Power Density.

• Spectrum Unit to any option other than dBFS or dBFS/Hz.

Programmatic Use

Specify the units in which the Spectrum Analyzer displays the power values as one of the following:

• dBm

• dBFS

• dBV

• dBW

• Vrms

• Watts

• dBm/Hz

• dBW/Hz

• dBFS/Hz

• Watts/Hz

• Auto

Tunable: Yes

Dependency

The units available depend on the value you choose for the Spectrum parameter in the Analyzer tab.

Estimation tab > Input Domain parameterAnalyzer tab > Spectrum optionAvailable Units
TimePowerdBm, dBW, dBFS, Watts
Power DensitydBm/Hz, dBW/Hz,dBFS/Hz, Watts/Hz
RMSdBV, Vrms
FrequencyAuto, dBm, dBV, dBW, Vrms, Watts

If you set the Input Domain parameter to Frequency and the Spectrum Unit parameter to Auto, the Spectrum Analyzer assumes the spectrum units to be equal to input units specified in the Estimation tab > Input Unit parameter. If you set the Input Domain parameter to Time and the Spectrum Unit parameter to any option other than Auto, the Spectrum Analyzer converts the units specified in the Input Unit parameter to the units specified in the Spectrum Unit parameter.

Programmatic Use

 Block Parameter: SpectrumUnits Type: character vector or string scalar

The full scale used for the decibel full scale (dBFS) units. By default, the Spectrum Analyzer uses the entire spectrum scale. Specify a positive real scalar for the dBFS full scale.

Tunable: Yes

Dependencies

To enable this parameter:

• In the Analyzer tab, set the spectrum type to Power or Power Density.

• In the Estimation tab, set Input Domain to Time.

• In the Spectrum tab, set Spectrum Unit to dBFS or dBFS/Hz (when spectrum type is set to Power Density).

Programmatic Use

 Block Parameter: FullScale Type: double

Spectrogram Tab

Note

This tab appears when you select Spectrogram in the Analyzer tab.

Channel

Select the signal channel for which the spectrogram settings apply.

Tunable: Yes

Dependency

To enable this parameter, select Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: SpectrogramChannel Type: character vector, string scalar, double

Time Options

Time resolution is the amount of data, in seconds, used to compute a spectrogram line. The minimum attainable resolution is the amount of time it takes to compute a single spectral estimate. The tooltip displays the minimum attainable resolution given the current Spectrum Analyzer settings.

When you set RBW (Hz) and Time Resolution (s) to Auto, then the Spectrum Analyzer adjusts the RBW value such that there are 1024 RBW intervals in one frequency span and sets the time resolution is set to 1/RBW.

When you set RBW (Hz) to Auto and Time Resolution (s) to a positive scalar, then time resolution becomes the main control and RBW is set to 1/Time Resolution (s) Hz.

When you set RBW (Hz) to a positive scalar and Time Resolution (s) to Auto, then RBW becomes the main control and the time resolution is set 1/RBW (Hz) s.

When you set RBW (Hz) and Time Resolution (s) to a positive value, then time resolution must be equal to or larger than the minimum attainable time resolution defined by 1/RBW (Hz). Several spectral estimates are combined into one spectrogram line to obtain the desired time resolution. Interpolation is used to obtain time resolution values that are not integer multiples of 1/RBW (Hz).

Tunable: Yes

Dependency

To enable this parameter, select Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: TimeResolutionSource, TimeResolution Type: character vector, string scalar, double

The time span over which the Spectrum Analyzer displays the spectrogram specified as a positive scalar in seconds. The time span is the product of the desired number of spectral lines and the time resolution. When you set this parameter to Auto, the spectrogram displays 100 spectrogram lines at any given time. Otherwise, the spectrogram uses the time duration you specify in this parameter. The time span that you specify must be at least two times larger than the duration of the number of samples required for a spectral update.

Tunable: Yes

Dependency

To enable this parameter, select Spectrogram in the Analyzer tab.

Programmatic Use

 Block Parameter: TimeSpanSource, TimeSpan Type: character vector, string scalar, double

Trace Options

Select this check box to enable a two-sided spectrum view. In this view, the Spectrum Analyzer shows both negative and positive frequencies. When the input signal is complex-valued, you must select this parameter. If you clear this check box, the Spectrum Analyzer shows a one-sided spectrum with positive frequencies only. In this case, the input signal data must be real valued.

When you clear this check box, the Spectrum Analyzer uses power folding. The y-axis values are twice the amplitude that they would be if you were to select this parameter, except at 0 and the Nyquist frequency. A one-sided power spectral density (PSD) contains the total power of the signal in the frequency interval from DC to half the Nyquist rate. For more information, see pwelch.

Tunable: Yes

Programmatic Use

 Block Parameter: PlotAsTwoSidedSpectrum Type: logical

Note

This tab appears when you select Spectrum in the Analyzer tab and set the Spectrum type to be Power or Power Density.

Views

Select to display the upper mask in the spectrum plot. The Spectral Mask panel appears at the bottom of the Spectrum Analyzer window and displays mask details, such as number of times a mask succeeded, number of times a mask failed, channels causing the mask failure, and so on.

Use the Upper Limits parameter to specify the upper mask. If the entire spectrum plot is below the upper mask, the upper mask looks green. In all other cases, the upper mask looks red.

Tunable: Yes

Programmatic Use

Select to display the lower mask in the spectrum plot. The Spectral Mask panel appears at the bottom of the Spectrum Analyzer window and displays mask details, such as number of times a mask succeeded, number of times a mask failed, channels causing the mask failure, and so on.

Use the Lower Limits parameter to specify the lower mask. If the entire spectrum plot is above the lower mask, the lower mask looks green. In all other cases, the lower mask looks red.

Tunable: Yes

Programmatic Use

Configuration

Specify the limit for the upper spectral mask as a scalar or a two-column matrix.

If UpperMask is a scalar, the upper limit mask uses the same power value for all frequencies specified in the Spectrum Analyzer.

If you specify a matrix, the first column contains the frequency values (Hz), which correspond to the x-axis values. The second column contains the power values, which correspond to the associated y-axis values.

To apply offsets to the power and frequency values, use the Reference Level (dBr) and the Frequency Offset (Hz) parameters.

Tunable: Yes

Programmatic Use

Specify the limit for the lower spectral mask as a scalar or a two-column matrix.

If LowerMask is a scalar, the lower limit mask uses the same power value for all frequencies specified in the Spectrum Analyzer.

If you specify a matrix, the first column contains the frequency values (Hz), which correspond to the x-axis values. The second column contains the power values, which correspond to the associated y-axis values.

To apply offsets to the power and frequency values, use the Reference Level (dBr) and the Frequency Offset (Hz) parameters.

Tunable: Yes

Programmatic Use

Specify the reference level for mask power values as a numeric scalar or set it to Spectrum peak.

When you set Reference Level (dBr) to a scalar value, the Spectrum Analyzer uses this value as the reference to the power values (in dBr) for the upper mask and the lower mask of the Spectrum Analyzer. The reference level should have the same units as the Spectrum Unit parameter in the Spectrum tab.

When you set Reference Level (dBr) to Spectrum peak, the Spectrum Analyzer uses the peak value of the current spectrum of the Channel in the Spectral Mask tab as the reference power value.

Tunable: Yes

Programmatic Use

Select the input channel which the Spectrum Analyzer uses to determine the mask reference level. The peak value of the spectrum in this channel becomes the mask reference level when you set the Reference Level (dBr) parameter to Spectrum peak.

Tunable: Yes

Dependency

To enable this parameter, set Reference Level (dBr) to Spectrum peak and display some data on the scope.

Programmatic Use

See SelectedChannel.

Specify the frequency offset in Hz as a finite numeric scalar. Using this value, the Spectrum Analyzer offsets the frequency values in the Upper Mask and the Lower Mask parameters.

Tunable: Yes

Channel Measurements Tab

Note

This tab appears when you select Spectrum in the Analyzer tab.

Channel

Specify the channel over which the Spectrum Analyzer computes and displays the occupied bandwidth and adjacent channel power ratio as a positive integer in the range [1 N], where N is the number of input channels.

Tunable: Yes

Dependency

To enable this parameter, pass data through the scope.

Programmatic Use

Channel Measurements

Click to enable channel measurements.

Tunable: Yes

Programmatic Use

See Enabled.

Specify the type of measurement data to display as Occupied BW or ACPR.

Tunable: Yes

Programmatic Use

See Type.

Specify the percentage of power over which the Spectrum Analyzer computes the occupied bandwidth as a positive scalar.

Tunable: Yes

Dependency

To enable this parameter, set Type to Occupied BW.

Programmatic Use

Frequency Options

Specify the frequency span mode as one of the following:

• Span and Center Frequency –– Measure over a frequency range specified in Span (Hz) and around the frequency value specified in Center Frequency (Hz).

• Start and Stop Frequencies –– Measure over the frequency range [Start Frequency (Hz), Stop Frequency (Hz)].

Tunable: Yes

Programmatic Use

See FrequencySpan.

Specify the frequency span over which the Spectrum Analyzer computes the channel measurements as a positive scalar in Hz.

Tunable: Yes

Dependency

To enable this parameter, set Frequency Span to Span and Center Frequency.

Programmatic Use

See Span.

Center frequency of the span over which the object computes the channel measurements, specified as a real scalar in Hz.

Tunable: Yes

Dependency

To enable this parameter, set Frequency Span to Span and Center Frequency.

Programmatic Use

See CenterFrequency.

Specify the start frequency in Hz over which the Spectrum Analyzer computes the channel measurements.

Tunable: Yes

Dependency

To enable this parameter, set Frequency Span to Start and Stop Frequencies.

Programmatic Use

See StartFrequency.

Specify the stop frequency in Hz over which the Spectrum Analyzer computes the channel measurements.

Tunable: Yes

Dependency

To enable this parameter, set Frequency Span to Start and Stop Frequencies.

Programmatic Use

See StopFrequency.

Specify the number of adjacent channel pairs as a positive integer in the range [1, 12].

Tunable: Yes

Dependency

To enable this parameter, set Type to ACPR.

Programmatic Use

See NumOffsets.

Specify the frequency of the adjacent channel relative to the center frequency of the main channel as a real vector of length equal to the number of offset pairs specified in Num Pairs.

Tunable: Yes

Dependency

To enable this parameter, set Type to ACPR.

Programmatic Use

See ACPROffsets.

Specify the adjacent channel bandwidth in Hz as a positive scalar.

Tunable: Yes

Dependency

To enable this parameter, set Type to ACPR.

Programmatic Use

Specify the filter shape for the main and adjacent channels as None, RRC, or Gaussian.

Tunable: Yes

Dependency

To enable this parameter, set Type to ACPR.

Programmatic Use

See FilterShape.

Specify the roll-off factor as a real scalar in the range [0, 1].

Tunable: Yes

Dependency

To enable this parameter, set Type to ACPR and Filter Shape to RRC.

Programmatic Use

See FilterCoeff.

Specify the BT product as a real scalar in the range [0, 1].

Tunable: Yes

Dependency

To enable this parameter, set Type to ACPR and Filter Shape to Gaussian.

See FilterCoeff.

Property Inspector Only

Input channel names, specified as a character vector, string, or array. The names appear in the legend, Settings, and Measurements panels. If you do not specify the names, the scope labels the channels as Channel 1, Channel 2, etc.

Example: ["A","B"]

Dependency

To see channel names, select Legend in the Analyzer tab.

Programmatic Use

 Block Parameter: ChannelNames Type: cell array of character vectors or string array

• Auto — If you have not specified Title and Y-Label, the scope maximizes all plots.

• On — The scope maximizes all plots and hides all values in Title and Y-label.

• Off — The scope does not maximize plots.

Hover over the Spectrum Analyzer to see the maximize axes button .

Tunable: Yes

Programmatic Use

 Block Parameter: MaximizeAxes Type: character vector or string scalar

• OnceAtStop — Scale y-axis after simulation completes.

• Manual — Manually scale y-axis range with the Scale Y-axis Limits toolbar button.

• Auto — Scale y-axis range during and after simulation.

• Updates — Scale y-axis after the number of time steps specified in the Number of Updates text box (100 by default). Scaling occurs only once during each run.

Tunable: Yes

Programmatic Use

 Block Parameter: AxesScaling Type: character vector or string scalar

Set this property to delay auto scaling the y-axis.

Tunable: Yes

Dependency

To enable this property, set Axes Scaling to Updates.

Programmatic Use

 Block Parameter: AxesScalingNumUpdates Type: character vector or string scalar Values: scalar

Block Characteristics

 Data Types Boolean | double | enumerated | fixed point | integer | single Direct Feedthrough no Multidimensional Signals yes Variable-Size Signals yes Zero-Crossing Detection no

expand all

expand all

Version History

Introduced in R2014b

expand all