Documentation

This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Spectrum Analyzer

Display frequency spectrum of time-domain signals

Library

Sinks

`dspsnks4`

Description

The Spectrum Analyzer block, referred to here as the scope, displays frequency spectra of signals. The Spectrum Analyzer block accepts input signals, through one or more input ports, with the following characteristics:

• Discrete sample time

• Real- or complex-valued

• Fixed number of channels of variable length

• Floating- or fixed-point data type

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. See the Supported Simulation Modes section for more information.

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

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

For an example that uses the Spectrum Analyzer, see the Display Frequency-Domain Data in Spectrum Analyzer.

See the following sections for more information on the Spectrum Analyzer:

 Note:   For information about the Spectrum Analyzer System object, see `dsp.SpectrumAnalyzer`.

Signal Display

The Spectrum Analyzer indicates the spectrum computation settings that are represented in the current display. Check the Resolution Bandwidth, Time Resolution, and Offset indicators on the status bar in the scope window for this information. These indicators relate to the Minimum Frequency-Axis limit and Maximum Frequency-Axis limit values on the frequency-axis of the scope window. The values specified by these indicators may be changed by modifying parameters in the Spectrum Settings panel. You can also view the object state and the amount of time data that correspond to the current display. Check the Simulation Status and Simulation time indicators on the status bar in the scope window for this information. The following figure highlights these aspects of the Spectrum Analyzer window.

 Note:   To prevent the scope from opening when you run your model, right-click the scope icon and select `Comment Out`. If the scope is already open, and you comment it out in the model, the scope displays, "No data can be shown because this scope is commented out." Select `Uncomment` to turn the scope back on.
• Frequency Span — The range of values shown on the frequency-axis on the Spectrum Analyzer window.

• Resolution Bandwidth — The smallest positive frequency or frequency interval that can be resolved.

• Time Resolution — The time resolution for a spectrogram line.

• Offset — The constant frequency offset to apply to the entire spectrum or a vector of frequency offsets to apply to each spectrum for multiple inputs.

• Simulation Status — Provides the current status of the model simulation.

• Display time — The amount of time that has progressed since the last update to the Spectrum Analyzer display.

Reduce Plot Rate to Improve Performance

By default, Spectrum Analyzer updates the display at fixed intervals of time at a rate not exceeding 20 hertz. If you want Spectrum Analyzer to plot a spectrum on every simulation time step, you can disable the Reduce Plot Rate to Improve Performance option. In the Spectrum Analyzer menu, select Simulation > Reduce Plot Rate to Improve Performance to clear the check box. Tunable (Simulink).

 Note:   When this check box is selected, Spectrum Analyzer may display a misleading spectrum in some situations. For example, if the input signal is wide-band with non-stationary behavior, such as a chirp signal, Spectrum Analyzer might display a stationary spectrum. The reason for this behavior is that Spectrum Analyzer buffers the input signal data and only updates the display periodically at approximately 20 times per second. Therefore, Spectrum Analyzer does not render changes to the spectrum that occur and elapse between updates, which gives the impression of an incorrect spectrum. To ensure that spectral estimates are as accurate as possible, clear the Reduce Plot Rate to Improve Performance check box. When you clear this box, Spectrum Analyzer calculates spectra whenever there is enough data, rendering results correctly.

You can add upper and lower spectral mask lines to spectrum plots. You use spectral masks to enhance visualizing spectrum limits. Spectral masks also are useful for comparing spectrum values to specification values.

You must use commands at the MATLAB® command line to setup or configure spectral masks for a Spectrum Analyzer block. You use `get_param` to create a Spectrum Analyzer configuration object to control the block. The configuration object has a `SpectralMask` property. The `SpectralMask` property uses `SpectralMaskSpecfication` properties to enable and configure the spectral masks. The `SpectralMaskSpecfication` properties, which are described in `spbscopes.SpectrumAnalyzerConfiguration`, are

• `EnabledMasks` — Turn on spectral mask.

• `UpperMask` — Set upper mask values.

• `LowerMask` — Set lower mask values.

• `ReferenceLevel` — Select the mask reference level to use a specific value or the spectrum peak value.

• `CustomReferenceLevel` — Set mask reference level value.

• `SelectedChannel` — Set channel to use for mask reference.

• `MaskFrequencyOffset` — Set frequency offset for mask.

You can check the status of the spectral mask using a method or an event listener.

• To get the status of the spectral masks, call `getSpectralMaskStatus`.

• To perform an action every time the mask fails, use the `MaskTestFailed` event. To trigger a function when the mask fails, create a listener to the `MaskTestFailed` event and define a callback function to trigger. For more details about using events, see Events (MATLAB).

Example of Spectral Mask

This example shows how to create a new model based on the `dsp_basic_filter` template, add a spectral mask to its Spectrum Analyzer block, and run the model.

``` [~,mdl] = fileparts(tempname); open_system(new_system(mdl,'FromTemplate','dsp_basic_filter')); saBlock = find_system(mdl,'BlockType','SpectrumAnalyzer'); scopeConfig = get_param(saBlock{1},'ScopeConfiguration'); upperMask = [0 50; 1200 50; 1200 -10; 24000 -10]; scopeConfig.SpectralMask.UpperMask = upperMask; scopeConfig.SpectralMask.LowerMask = -100; scopeConfig.SpectralMask.EnabledMasks = 'Upper and lower'; sim(mdl,'StopTime','20');```

Masks are overlaid on the spectrum. If the mask is green, the signal is passing. If the mask is red, the signal is failing.

At the bottom of the window, the Mask success rate shows what percentage of the time the mask is succeeding. A tooltip gives you details about which mask is failing, how many times the mask(s) failed, and which channels are causing the failure.

Spectrum Settings

The Spectrum Settings panel appears at the right side of the Spectrum Analyzer figure. This panel enables you to modify settings to control the manner in which the spectrum is calculated. You can choose to hide or display the Spectrum Settings panel. In the Spectrum Analyzer menu, select View > Spectrum Settings. Alternatively, in the Spectrum Analyzer toolbar, select the Spectrum Settings button.

The Spectrum Settings panel is separated into three panes, labeled Main Options, Window Options, and Trace Options. You can expand each pane to see the available options.

Main Options Pane

The Main Options pane enables you to modify the main options.

• Type — The type of spectrum to display. Available options are `Power`, ```Power density```, and `RMS`. When you set this parameter to `Power`, the Spectrum Analyzer shows the power spectrum. When you set this parameter to ```Power density```, the Spectrum Analyzer shows the power spectral density. The power spectral density is the magnitude of the spectrum normalized to a bandwidth of 1 hertz. When you set this parameter to `RMS`, the Spectrum Analyzer shows the root mean squared spectrum. Tunable (Simulink)

• View — The spectrum view to display. Available options are `Spectrum`, `Spectrogram`, and `Spectrum and spectrogram`. When you set this parameter to `Spectrum`, the Spectrum Analyzer shows the spectrum. When you set this parameter to `Spectrogram`, the Spectrum Analyzer shows the spectrogram, which displays frequency content over time. The most recent spectrogram update is at the bottom of the display and time scrolls from the bottom to the top of the display. When you set this parameter to ```Spectrum and spectrogram```, the Spectrum Analyzer shows both the spectrum and spectrogram. Tunable (Simulink).

• Sample rate (Hz) — The sample rate, in hertz, of the input signals. Select `Inherited` to use the same sample rate as the input signal. To specify a sample rate, enter its value.

• Full frequency span — Enable this check box to have Spectrum Analyzer compute and plot the spectrum over the entire Nyquist frequency interval. By default, when the Two-sided spectrum check box is also enabled, the Nyquist interval is $\left[-\frac{SampleRate}{2},\frac{SampleRate}{2}\right]+FrequencyOffset$ hertz. If you clear the Two-sided spectrum check box, the Nyquist interval is$\left[0,\frac{SampleRate}{2}\right]+FrequencyOffset$ hertz. Tunable (Simulink).

• Span (Hz) and CF (Hz), or FStart (Hz) and FStop (Hz) — When Span (Hz) is showing in the Main Options pane, you define the range of values shown on the frequency-axis on the Spectrum Analyzer window using frequency span and center frequency. From the drop-down list, select FStart (Hz) to define the range of frequency-axis values using start frequency and stop frequency instead.

• Span (Hz) — The frequency span, in hertz. This parameter defines the range of values shown on the frequency-axis on the Spectrum Analyzer window. Tunable (Simulink).

• CF (Hz) — The center frequency, in hertz. This parameter defines the value shown at the middle point of the frequency-axis on the Spectrum Analyzer window. Tunable (Simulink).

• FStart (Hz) — The start frequency, in hertz. This parameter defines the value shown at the leftmost side of the frequency-axis on the Spectrum Analyzer window. Tunable (Simulink).

• FStop (Hz) — The stop frequency, in hertz. The parameter defines the value shown at the rightmost side of the frequency-axis on the Spectrum Analyzer window. Tunable (Simulink).

• RBW (Hz) / Window length — The frequency resolution method.

If set to RBW (Hz), the resolution bandwidth, in hertz. This property defines the smallest positive frequency that can be resolved. By default, this property 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 property to a numeric value, then you must specify a value that ensures there are at least two RBW intervals over the specified frequency span. In other words, the ratio of the overall frequency span to RBW must be at least two: $\frac{span}{RBW}>2$. Tunable (Simulink).

If set to Window length, the length of the window, in samples, used to control the frequency resolution and compute the spectral estimates. The window length must be an integer scalar greater than 2.

The time resolution value is determined based on frequency resolution method, the RBW setting, and the time resolution setting.

Frequency Resolution RBW SettingTime Resolution SettingTime Resolution
RBW (Hz)`Auto``Auto`1/RBW s
RBW (Hz)`Auto`Manually enteredTime Resolution s
RBW (Hz)Manually entered`Auto`1/RBW s
RBW (Hz)Manually enteredManually enteredMust be equal to or greater than the minimum attainable time resolution, 1/RBW s. 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 s.
Window length`Auto`1/RBW s

RBW = (NENBW*Fs)/Window Length, where NENBW is the normalized effective noise bandwidth of the specified window.
Window lengthManually enteredMust be equal to or greater than the minimum attainable time resolution, (NENBW*Fs)/Window Length. 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 s.

• NFFT — The number of Fast Fourier Transform (FFT) points. You can set the NFFT only when in Window length mode. This property defines the length of the FFT that Spectrum Analyzer uses to compute spectral estimates. Acceptable options are `Auto` or a positive, scalar integer. The NFFT value must be greater than or equal to the Window length. By default, when NFFT is set to `Auto`, Spectrum Analyzer sets the number of FFT points to the window length. When in RBW mode, an FFT length is used that equals the window length required to achieve the specified RBW value.

When this property is set to a positive integer, this property is equivalent to the `n` parameter that you can set when you run the MATLAB `fft` function. Tunable (Simulink).

• Samples/update — The number of input samples required to compute one spectral update. You cannot modify this property; it is shown here for display purposes only. This property is directly related to RBW by the following equation: ${N}_{samples}=\frac{\left(1-\frac{{O}_{p}}{100}\right)×NENBW×{F}_{s}}{RBW}$ or to the window length by this equation: . NENBW is the normalized effective noise bandwidth, a factor of the windowing method used, which is shown in the Window Options pane. Fs is the sample rate. If the number of samples provided in the input are not sufficient to achieve the resolution bandwidth that you specify, Spectrum Analyzer produces a message on the display as shown in the following figure.

Spectrogram Options Pane

• Channel — Select the signal channel for which the spectrogram settings apply. This option displays only when the Type is `Spectrogram` and only if there is more than one signal channel input.

• Time res. (s) — The time resolution, in seconds. Time resolution is the amount of data, in seconds, used to compute a spectrogram line. The minimum attainable resolution is the amount of data time it takes to compute a single spectral estimate. The tooltip displays the minimum attainable resolution given the current settings. This property applies only to spectrograms. Tunable (Simulink)

• Time span (s) — The time span over which the Spectrum Analyzer displays the spectrogram, in seconds. The time span is the product of the desired number of spectral lines and the time resolution. The tooltip displays the minimum allowable time span, given the current settings. If the time span is set to `Auto`, 100 spectral lines are used. This property applies only to spectrograms.Tunable (Simulink)

Window Options Pane

The Window Options pane enables you to modify the window options.

• Overlap (%) — The segment overlap percentage. This parameter defines the amount of overlap between the previous and current buffered data segments. The overlap creates a window segment that is used to compute a spectral estimate. The value must be greater than or equal to zero and less than 100. Tunable (Simulink).

• Window — 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 (Signal Processing Toolbox). Tunable (Simulink).

• Attenuation (dB) — The sidelobe attenuation, in decibels (dB). This property applies only when you set the Window parameter to `Chebyshev` or `Kaiser`. You must specify a value greater than or equal to `45`. Tunable (Simulink).

• NENBW — Normalized Effective Noise Bandwidth of the window. You cannot modify this parameter; it is a readout shown here for display purposes only. This parameter is a measure of the noise performance of the window. It is the width of a rectangular filter that accumulates the same noise power with the same peak power gain. NENBW can be calculated from the windowing function using the following equation:

``` ```

The rectangular window has the smallest NENBW, with a value of 1. All other windows have a larger NENBW value. For example, the Hann window has an NENBW value of approximately 1.5.

Trace Options Pane

The Trace Options pane enables you to modify the trace options.

• Units — The units of the spectrum. The available values depends on the value of Type. Available options include `dBm`, `dBW`, `Watts`, `Vrms`, and `dBV`. Tunable (Simulink).

• Averages — Specify as a positive, scalar integer the number of spectral averages. This property applies only when the Spectrum View is `Spectrum` or ```Spectrum and spectrogram```. Spectrum Analyzer computes the current power spectrum estimate by computing a running average of the last N power spectrum estimates. This property defines the number of spectral averages, N. Tunable (Simulink).

• Reference load — The reference load, in ohms, used to scale the spectrum. Specify as a real, positive scalar the load, in ohms, that the Spectrum Analyzer uses as a reference to compute power values. Tunable (Simulink).

• Scale — Linear or logarithmic scale. When the frequency span contains negative frequency values, Spectrum Analyzer disables the logarithmic option. Tunable (Simulink).

• Offset — The constant frequency offset to apply to the entire spectrum or a vector of frequencies to apply to each spectrum for multiple inputs. The offset parameter is added to the values on the frequency-axis in the Spectrum Analyzer window. It is not used in any spectral computations. You must take the parameter into consideration when you set the Span (Hz) and CF (Hz) parameters to ensure that the frequency span is within Nyquist limits. The Nyquist interval is $\left[-\frac{SampleRate}{2},\frac{SampleRate}{2}\right]+FrequencyOffset$ hertz if Two-sided spectrum is selected, and $\left[0,\frac{SampleRate}{2}\right]+FrequencyOffset$ hertz otherwise. Tunable (Simulink)

• Normal trace — Normal trace view. This property applies only when the Spectrum View is `Spectrum` or ```Spectrum and spectrogram```. By default, when this check box is enabled, Spectrum Analyzer calculates and plots the power spectrum or power spectrum density. Spectrum Analyzer performs a smoothing operation by averaging a number of spectral estimates. To clear this check box, you must first select either the Max hold trace or the Min hold trace check box. Tunable (Simulink).

• Max hold trace — Maximum hold trace view. This property applies only when the Spectrum View is `Spectrum` or ```Spectrum and spectrogram```. Select this check box to enable Spectrum Analyzer to plot the maximum spectral values of all the estimates obtained. Tunable (Simulink).

• Min hold trace — Minimum hold trace view. This property applies only when the Spectrum View is `Spectrum` or ```Spectrum and spectrogram```. Select this check box to enable Spectrum Analyzer to plot the minimum spectral values of all the estimates obtained. Tunable (Simulink)

• Two-sided spectrum — Select this check box to enable two-sided spectrum view. In this view, both negative and positive frequencies are shown. If you clear this check box, Spectrum Analyzer shows a one-sided spectrum with only positive frequencies. Spectrum Analyzer requires that this parameter is selected when the input signal is complex-valued.

Measurements Panels

The Measurements panels are the other four panels that appear to the right side of the Spectrum Analyzer figure.

Trace Selection Panel

When you use the scope to view multiple signals, the Trace Selection panel appears if you have more than one signal displayed and you click any of the other Measurements panels. The Measurements panels display information about only the signal chosen in this panel. Choose the signal name for which you would like to display time domain measurements. See the following figure.

You can choose to hide or display the Trace Selection panel. In the Scope menu, select Tools > Measurements > Trace Selection.

Cursor Measurements Panel

The Cursor Measurements panel displays screen cursors. The panel provides two types of cursors for measuring signals. Waveform cursors are vertical cursors that track along the signal. Screen cursors are both horizontal and vertical cursors that you can place anywhere in the display.

 Note:   If a data point in your signal has more than one value, the cursor measurement at that point is undefined and no cursor value is displayed.

In the Scope menu, select Tools > Measurements > Cursor Measurements. Alternatively, in the Scope toolbar, click the Cursor Measurements button.

The Cursor Measurements panel appears as follows for the spectrum and dual view.

The Cursor Measurements panel appears as follows for the spectrogram view. You must pause the spectrogram display before you can use cursors.

The Cursor Measurements panel is separated into two panes, labeled Settings and Measurements. You can expand each pane to see the available options.

You can use the mouse or the left and right arrow keys to move vertical or waveform cursors and the up and down arrow keys for horizontal cursors.

The Settings pane enables you to modify the type of screen cursors used for calculating measurements. When more than one signal is displayed, you can assign cursors to each trace individually.

• Screen Cursors — Shows screen cursors (for spectrum and dual view only).

• Horizontal — Shows horizontal screen cursors (for spectrum and dual view only).

• Vertical — Shows vertical screen cursors (for spectrum and dual view only).

• Waveform Cursors — Shows cursors that attach to the input signals (for spectrum and dual view only).

• Lock Cursor Spacing — Locks the frequency difference between the two cursors.

• Snap to Data — Positions the cursors on signal data points.

Peak Finder Panel

The Peak Finder panel displays the maxima, showing the x-axis values at which they occur. Peaks are defined as a local maximum where lower values are present on both sides of a peak. Endpoints are not considered to be peaks. This panel allows you to modify the settings for peak threshold, maximum number of peaks, and peak excursion. You can choose to hide or display the Peak Finder panel. In the scope menu, select Tools > Measurements > Peak Finder. Alternatively, in the scope toolbar, select the Peak Finder button.

The Peak finder panel is separated into two panes, labeled Settings and Peaks. You can expand each pane to see the available options.

The Settings pane enables you to modify the parameters used to calculate the peak values within the displayed portion of the input signal. For more information on the algorithms this pane uses, see the Signal Processing Toolbox™ `findpeaks` function reference.

• Peak Threshold — The level above which peaks are detected. This setting is equivalent to the `MINPEAKHEIGHT` parameter, which you can set when you run the `findpeaks` function.

• Max Num of Peaks — The maximum number of peaks to show. The value you enter must be a scalar integer from 1 through 99. This setting is equivalent to the `NPEAKS` parameter, which you can set when you run the `findpeaks` function.

• Min Peaks Distance — The minimum number of samples between adjacent peaks. This setting is equivalent to the `MINPEAKDISTANCE` parameter, which you can set when you run the `findpeaks` function.

• Peak Excursion — The minimum height difference between a peak and its neighboring samples The peak excursion setting is equivalent to the `THRESHOLD` parameter, which you can set when you run the `findpeaks` function.

• Label Format — The coordinates to display next to the calculated peak values on the plot. To see peak values, expand the Peaks pane and select the check boxes associated with individual peaks of interest. By default, both x-axis and y-axis values are displayed on the plot. Select which axes values you want to display next to each peak symbol on the display.

• `X+Y` — Display both x-axis and y-axis values.

• `X` — Display only x-axis values.

• `Y` — Display only y-axis values.

The Peaks pane displays all of the largest calculated peak values. It also shows the coordinates at which the peaks occur, using the parameters you define in the Settings pane. You set the Max Num of Peaks parameter to specify the number of peaks shown in the list.

The numerical values displayed in the Value column are equivalent to the `pks` output argument returned when you run the `findpeaks` function. The numerical values displayed in the second column are similar to the `locs` output argument returned when you run the `findpeaks` function.

The Peak Finder displays the peak values in the Peaks pane. By default, the Peak Finder panel displays the largest calculated peak values in the Peaks pane in decreasing order of peak height. Use the sort descending button ( ) to rearrange the category and order by which Peak Finder displays peak values. Click this button again to sort the peaks in ascending order instead. When you do so, the arrow changes direction to become the sort ascending button ( ). A filled sort button indicates that the peak values are currently sorted in the direction of the button arrow. If the sort button is not filled ( ), then the peak values are sorted in the opposite direction of the button arrow. The Max Num of Peaks parameter still controls the number of peaks listed.

Use the check boxes to control which peak values are shown on the display. By default, all check boxes are cleared and the Peak Finder panel hides all the peak values. To show all the peak values on the display, select the check box in the top-left corner of the Peaks pane. To hide all the peak values on the display, clear this check box. To show an individual peak, select the check box directly to the left of its Value listing. To hide an individual peak, clear the check box directly to the left of its Value listing.

The Peaks are valid for any units of the input signal. The letter after the value associated with each measurement indicates the abbreviation for the appropriate International System of Units (SI) prefix, such as m for milli-. For example, if the input signal is measured in volts, an m next to a measurement value indicates that this value is in units of millivolts.

Channel Measurements Panel

The Channel Measurements panel displays occupied bandwidth or adjacent channel power ratio (ACPR) measurements. You can choose to hide or display this pane in the Scope menu by selecting Tools > Measurements > Channel Measurements. Alternatively, in the Scope toolbar, click the Cursor Measurements button.

In addition to the measurements, the Channel Measurements panel has an expandable Channel Settings pane.

• Measurement — The type of measurement data to display. Available options are ```Occupied BW``` or `ACPR`. See Algorithms for information on how Occupied BW is calculated. ACPR is the adjacent channel power ratio, which is the ratio of the main channel power to the adjacent channel power.

When you select `Occupied BW` as the Measurement, the following fields appear.

• Channel Settings — Enables you to modify the parameters for calculating the channel measurements.

• Channel Power — The total power in the channel.

• Occupied BW — The bandwidth containing the specified Occupied BW (%) of the total power of the spectrum. This setting is available only if you select `Occupied BW` as the Measurement type.

• Frequency Error — The difference between the center of the occupied band and the center frequency (CF) of the channel. This setting is available only if you select `Occupied BW` as the Measurement type.

When you select `ACPR` as the Measurement, the following fields appear.

• Channel Settings — Enables you to modify the parameters for calculating the channel measurements.

• Channel Power — The total power in the channel.

• Offset (Hz) — The center frequency of the adjacent channel with respect to the center frequency of the main channel. This setting is available only if you select `ACPR` as the Measurement type.

• Lower (dBc) — The power ratio of the lower sideband to the main channel. This setting is available only if you select `ACPR` as the Measurement type.

• Upper (dBc) — The power ratio of the upper sideband to the main channel. This setting is available only if you select `ACPR` as the Measurement type.

Distortion Measurements Panel

The Distortion Measurements panel displays harmonic distortion and intermodulation distortion measurements. You can choose to hide or display this panel in the Scope menu by selecting Tools > Measurements > Distortion Measurements. Alternatively, in the Scope toolbar, click the Distortion Measurements button.

The Distortion Measurements panel has an expandable Harmonics pane, which shows measurement results for the specified number of harmonics.

 Note:   For an accurate measurement, ensure that the fundamental signal (for harmonics) or primary tones (for intermodulation) is larger than any spurious or harmonic content. To do so, you may need to adjust the resolution bandwidth (`RBW`) of the spectrum analyzer. Make sure that the bandwidth is low enough to isolate the signal and harmonics from spurious and noise content. In general, you should set the RBW so that there is at least a 10dB separation between the peaks of the sinusoids and the noise floor. You may also need to select a different spectral window to obtain a valid measurement.
• Distortion — The type of distortion measurements to display. Available options are `Harmonic` or `Intermodulation`. Select `Harmonic` if your system input is a single sinusoid. Select `Intermodulation` if your system input is two equal amplitude sinusoids. Intermodulation can help you determine distortion when only a small portion of the available bandwidth will be used.

See Algorithms for information on how distortion measurements are calculated.

When you select `Harmonic` as the Distortion, the following fields appear.

The harmonic distortion measurement automatically locates the largest sinusoidal component (fundamental signal frequency). It then computes the harmonic frequencies and power in each harmonic in your signal. Any DC component is ignored. Any harmonics that are outside the spectrum analyzer's frequency span are not included in the measurements. Adjust your frequency span so that it includes all the desired harmonics.

 Note:   To best view the harmonics, make sure that your fundamental frequency is set high enough to resolve the harmonics. However, this frequency should not be so high that aliasing occurs. For the best display of harmonic distortion, your plot should not show skirts, which indicate frequency leakage. Additionally, the noise floor should be visible. For a better display, try a Kaiser window with a large sidelobe attenuation (e.g. between 100–300 db).
• Num. Harmonics — Number of harmonics to display, including the fundamental frequency. Valid values of Num. Harmonics are from `2` to `99`. The default value is `6`.

• Label Harmonics — Select Label Harmonics to add numerical labels to each harmonic in the spectrum display.

• 1 — The fundamental frequency, in hertz, and its power, in decibels of the measured power referenced to one milliwatt (dBm).

• 2, 3, ... — The harmonics frequencies, in hertz, and their power in decibels relative to the carrier (dBc). If the harmonics are at the same level or exceed the fundamental frequency, reduce the input power.

• THD — The total harmonic distortion. This value represents the ratio of the power in the harmonics, D, to the power in the fundamental frequency, S. If the noise power is too high in relation to the harmonics, the THD value is not accurate. In this case, lower the resolution bandwidth or select a different spectral window. THD = 10log10(D/S).

• SNR — Signal-to-noise ratio (SNR). This value represents the ratio of power in the fundamental frequency, S, to the power of all nonharmonic content, N, including spurious signals, in decibels relative to the carrier (dBc). SNR = 10log10(S/N). If you see – – as the reported SNR, your signal's total non-harmonic content is less than 30% of the total signal.

• SINAD — Signal-to-noise-and-distortion. This value represents the ratio of the power in the fundamental frequency, S to all other content (including noise, N, and harmonic distortion, D), in decibels relative to the carrier (dBc). SINAD = 10log10(S/(N+D).

• SFDR — Spurious free dynamic range (SFDR). This value represents the ratio of the power in the fundamental frequency, S, to power of the largest spurious signal, R, regardless of where it falls in the frequency spectrum. The worst spurious signal may or may not be a harmonic of the original signal. SFDR represents the smallest value of a signal that can be distinguished from a large interfering signal. SFDR includes harmonics. SFDR = 10log10(S/R).

When you select `Intermodulation` as the Distortion, the following fields appear.

The intermodulation distortion measurement automatically locates the fundamental, first-order frequencies (F1 and F2). It then computes the frequencies of the third-order intermodulation products (2*F1-F2 and 2*F2-F1).

• Label frequencies — Select Label frequencies to add numerical labels to the first-order intermodulation product and third-order frequencies in the spectrum analyzer display.

• F1 — Lower fundamental first-order frequency

• F2 — Upper fundamental first-order frequency

• 2F1 - F2 — Lower intermodulation product from third-order harmonics

• 2F2 - F1 — Upper intermodulation product from third-order harmonics

• TOI — Third-order intercept point. If the noise power is too high in relation to the harmonics, the TOI value will not be accurate. In this case, you should lower the resolution bandwidth or select a different spectral window. If the TOI has the same amplitude as the input two-tone signal, reduce the power of that input signal.

CCDF Measurements Panel

The CCDF Measurements panel displays complimentary cumulative distribution function measurements. CCDF measurements in this scope show the probability of a signal's instantaneous power being a specified level above the signal's average power. These measurements are useful indicators of a signal's dynamic range.

To compute the CCDF measurements, each input sample is quantized to 0.01 dB increments. Using a histogram 100 dB wide (10,000 points at 0.01 dB increments), the largest peak encountered is placed in the last bin of the histogram. If a new peak is encountered, the histogram shifts to make room for that new peak.

You can choose to hide or display this panel in the Scope menu by selecting Tools > Measurements > CCDF Measurements. Alternatively, in the Scope toolbar, click the CCDF Measurements button.

• Plot Gaussian reference — Select Plot Gaussian reference to show the Gaussian white noise reference signal on the plot.

• Probability (%) — The percentage of the signal that contains the power level above the value listed in the dB above average column

• dB above average — The expected minimum power level at the associated Probability (%).

• Average Power — The average power level of the signal since the start of simulation or from the last reset.

Max Power — The maximum power level of the signal since the start of simulation or from the last reset.

• PAPR — The ratio of the peak power to the average power of the signal. PAPR should be less that 100 dB to obtain accurate CCDF measurements. If PAPR is above 100 dB, only the highest 100 dB power levels are plotted in the display and shown in the distribution table.

• Sample Count — The total number of samples used to compute the CCDF.

• Reset — Clear all current CCDF measurements and restart.

Visuals — Spectrum Properties

The Visuals—Spectrum Properties dialog box controls the visual configuration settings of the Spectrum Analyzer display. From the Spectrum Analyzer menu, select View > Configuration Properties to open this dialog box. Alternatively, in the Spectrum Analyzer toolbar, click the Configuration Properties button.

Display Pane

When the Spectrum View is `Spectrum`, the Display pane of the Visuals—Spectrum Properties dialog box appears as follows:

When the Spectrum View is `Spectrogram` the Display pane of the Visuals—Spectrum Properties dialog box appears as follows:

When the Spectrum View is ```Spectrum or spectroogram``` the Display pane of the Visuals—Spectrum Properties dialog box appears as follows:

Title

Specify the display title as a character vector. Enter `%<SignalLabel>` to use the signal labels in the Simulink Model as the axes titles. This property is Tunable (Simulink).

By default, the display has no title.

Show legend

Select this check box to show the legend in the display. The channel legend displays a name for each channel of each input signal. When the legend appears, you can place it anywhere inside of the scope window. To turn off the legend, clear the Show legend check box.

You can edit the name of any channel in the legend by double-clicking the current name and entering a new channel name. By default, if the signal has multiple channels, the scope uses an index number to identify each channel of that signal. To change the appearance of any channel of any input signal in the scope window, from the scope menu, select View > Style.

The legend lets you modify what signals are shown. To show only one signal, click the signal name. To toggle a signal on/off, right-click the signal name.

This parameter applies only when the View Type is `Spectrum` or ```Spectrum and spectrogram```. Tunable (Simulink)

Show grid

When you select this check box, a grid appears in the display of the scope figure. To hide the grid, clear this check box. Tunable (Simulink)

Y-limits (Minimum)

Specify the minimum value of the y-axis. Tunable (Simulink)

Y-limits (Maximum)

Specify the maximum value of the y-axis. Tunable (Simulink)

Y-axis label

Specify the text for the scope to display to the left of the y-axis. Regardless of this property, Spectrum Analyzer always displays power units after this text as one of `'dBm'`, `'dBW'`, `'Watts'`, `'dBm/Hz'`, `'dBW/Hz'`, `'Watts/Hz'`, `Vrms`, or `dBV`Tunable (Simulink).

Color map

Select the color map for the spectrogram, or enter a 3-column matrix expression for the color map. See `colormap` for information. Tunable (Simulink).

Color-limits (Minimum)

Set the signal power for the minimum color value of the spectrogram. Tunable (Simulink).

Color-limits (Maximum)

Set the signal power for the maximum color value of the spectrogram. Tunable (Simulink).

Style Dialog Box

In the Style dialog box, you can customize the style of spectrum display. This dialog box is not available for the spectrogram view. You are able to change the color of the figure, the background and foreground colors of the axes, and properties of the lines. From the Spectrum Analyzer menu, select View > Style to open this dialog box.

Properties

The Style dialog box allows you to modify the following properties of the Spectrum Analyzer figure:

Figure color

Specify the color that you want to apply to the background of the scope figure. By default, the figure color is gray.

Plot type

Specify whether to display a `Line` or `Stem` plot.

Axes colors

Specify the color that you want to apply to the background of the axes.

Properties for line

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

Visible

Specify whether the selected channel should be visible. If you clear this check box, the line disappears.

Line

Specify the line style, line width, and line color for the selected channel.

Marker

Specify marks for the selected channel to show at its data points. This parameter is similar to the `Marker` property for plot objects. You can choose any of the marker symbols from the dropdown.

Tools — Axes Scaling Properties

The Tools — Axes Scaling Properties dialog box allows you to automatically zoom in on and zoom out of your data. You can also scale the axes and color of the Spectrum Analyzer. In the Spectrum Analyzer menu, select Tools > Scaling Properties to open this dialog box.

Properties

For the spectrum view, the Tools—Axes Scaling Properties dialog box appears as:

For spectrogram view, the Tools—Axes Scaling Properties dialog box appears as:

For dual view, the Tools—Axes Scaling Properties dialog box appears as:

 Note:   The X-axis scaling options only apply when using CCDF measurements.

Axes scaling/Color scaling

Specify when the scope automatically scales the axes. If the spectrogram is displayed, specify when the scope automatically scales the color. You can select one of the following options:

• `Manual` — When you select this option, the scope does not automatically scale the axes or color. You can manually scale the axes or color in any of the following ways:

• Select Tools > Scaling Properties.

• Press one of the Scale Axis Limits toolbar buttons.

• When the scope figure is the active window, press Ctrl and A simultaneously.

• `Auto` — When you select this option, the scope scales the axes or color as needed, both during and after simulation. Selecting this option shows the Do not allow Y-axis limits to shrink or Do not allow color limits to shrink .

• `After N Updates` — Selecting this option causes the scope to scale the axes or color after a specified number of updates. This option is useful and more efficient when your scope display starts with one axis scale, but quickly reaches a different steady state axis scale. Selecting this option shows the Number of updates edit box.

By default, this parameter is set to `Auto`, and the scope does not shrink the y-axis limits when scaling the axes or color. Tunable (Simulink).

Do not allow Y-axis limits to shrink / Do not allow color limits to shrink

When you select this property, the y-axis are allowed to grow during axes scaling operations. If the spectrogram is displayed, selecting this property allows the color limits to grow during axis scaling. If you clear this check box, the y-axis or color limits can shrink during axes scaling operations.

This property appears only when you select `Auto` for the Axis scaling or Color scaling property. When you set the Axes scaling or Color scaling property to `Manual` or ```After N Updates```, the y-axis or color limits can shrink. Tunable (Simulink).

Specify as a positive integer the number of updates after which to scale the axes. If the spectrogram is displayed, this property specifies the number of updates after which to scale the color. This property appears only when you select `After N Updates` for the Axes scaling or Color scaling property. Tunable (Simulink).

Scale axes limits at stop/Scale color limits at stop

Select this check box to scale the axes when the simulation stops. If the spectrogram is displayed, select this check box to scale the color when the simulation stops. The y-axis is always scaled. The x-axis limits are only scaled if you also select the Scale X-axis limits check box.

Y-axis Data range (%) / Color-limits Data range

Set the percentage of the y-axis that the scope uses to display the data when scaling the axes. If the spectrogram is displayed, set the percentage of the power values range within the colormap. Valid values are from 1 through 100. For example, if you set this property to `100`, the Scope scales the y-axis limits such that your data uses the entire y-axis range. If you then set this property to `30`, the scope increases the y-axis range or color such that your data uses only 30% of the y-axis range or color. Tunable (Simulink).

Y-axis Align / Color-limits Align

Specify where the scope aligns your data along the y-axis when it scales the axes. If the spectrogram is displayed, specify where the scope aligns your data along the y-axis when it scales the color. You can select `Top`, `Center`, or `Bottom`. Tunable (Simulink).

Autoscale X-axis limits

Check this box to allow the scope to scale the x-axis limits when it scales the axes. If Axes scaling is set to `Auto`, checking Autoscale X-axis limits only scales the data currently within the axes, not the entire signal in the data buffer. If Autoscale X-axis limits is on and the resulting axis is greater than the span of the scope, trigger position markers will not be displayed. Triggers are controlled using the Trigger Measurements panel. Tunable (Simulink).

X-axis Data range (%)

Set the percentage of the x-axis that the scope uses to display the data when scaling the axes. Valid values are from 1 through 100. For example, if you set this property to `100`, the scope scales the x-axis limits such that your data uses the entirex-axis range. If you then set this property to `30`, the scope increases the x-axis range such that your data uses only 30% of the x-axis range. Use the x-axis Align property to specify data placement along the x-axis.

This property appears only when you select the Scale X-axis limits check box. Tunable (Simulink).

X-axis Align

Specify how the scope aligns your data along the x-axis: `Left`, `Center`, or `Right`. This property appears only when you select the Scale X-axis limits check box. Tunable (Simulink).

Algorithms

Spectrum Analyzer uses the `RBW` or the `Window Length` setting in the Spectrum Settings panel to determine the data window length. The value of the `FrequencyResolutionMethod` property determines whether RBW or window length is used. Then, it partitions the input signal into a number of windowed data segments. Finally, Spectrum Analyzer uses the modified periodogram method to compute spectral updates, averaging the windowed periodograms for each segment.

1. Spectrum Analyzer requires that a minimum number of samples have been provided before it computes a spectral estimate. This number of input samples required to compute one spectral update is shown as Samples/update in the Main options pane. This value is directly related to resolution bandwidth, RBW, by the following equation or to the window length, by the equation shown in step 1b.

${N}_{samples}=\frac{\left(1-\frac{{O}_{p}}{100}\right)×NENBW×{F}_{s}}{RBW}$

The normalized effective noise bandwidth, NENBW, is a factor that depends on the windowing method. Spectrum Analyzer shows NENBW in the Window Options pane of the Spectrum Settings panel. Overlap percentage, Op, is the value of the Overlap % parameter in the Window Options pane of the Spectrum Settings panel. Fs is the sample rate of the input signal. Spectrum Analyzer shows sample rate in the Main Options pane of the Spectrum Settings panel.

1. When in RBW mode, the window length required to compute one spectral update, Nwindow, is directly related to the resolution bandwidth and normalized effective noise bandwidth by the following equation.

When in WindowLength mode, the window length is used as specified.

2. The number of input samples required to compute one spectral update, Nsamples, is directly related to the window length and the amount of overlap by the following equation.

When you increase the overlap percentage, fewer new input samples are needed to compute a new spectral update. For example, if the window length is 100, then the number of input samples required to compute one spectral update is given as shown in the following table.

OpNsamples
0%100
50%50
80%20

3. The normalized effective noise bandwidth, NENBW, is a window parameter determined by the window length, Nwindow, and the type of window used. If w(n) denotes the vector of Nwindow window coefficients, then NENBW is given by the following equation.

4. When in RBW mode, you can set the resolution bandwidth using the value of the RBW parameter on the Main options pane of the Spectrum Settings panel. You must specify a value to ensure that there are at least two RBW intervals over the specified frequency span. The ratio of the overall span to RBW must be greater than two, as given in the following equation.

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

By default, the RBW parameter on the Main options pane 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. Thus, when you set RBW to `Auto`, it is calculated by the following equation.$RB{W}_{auto}=\frac{span}{1024}$

5. When in window length mode, you specify Nwindow and the resulting RBW is

In some cases, the number of samples provided in the input are not sufficient to achieve the resolution bandwidth that you specify. When this situation occurs, Spectrum Analyzer produces a message on the display, as shown in the following figure.

Spectrum Analyzer removes this message and displays a spectral estimate as soon as enough data has been input. Notice that this behavior differs from the Spectrum Scope block in versions R2012b and earlier. If the Buffer input check box was selected, the Spectrum Scope block computed a spectral update using the number of samples given by the Buffer size parameter. Otherwise, the Spectrum Scope block computed a spectral update using the number of samples in each frame.

2. Spectrum Analyzer calculates and plots the power spectrum, power spectrum density, and RMS computed by the modified Periodogram estimator. For more information about the Periodogram method, see `periodogram` in the Signal Processing Toolbox documentation.

Power Spectral Density — The power spectral density (PSD) is given by the following equation.

In this equation, x[n] is the discrete input signal. On every input signal frame, Spectrum Analyzer generates as many overlapping windows as possible, each window denoted as x(p)[n], and computes their periodograms. Spectrum Analyzer displays a running average of the P most current periodograms.

Power Spectrum — The power spectrum is the product of the power spectral density and the resolution bandwidth, as given by the following equation.

Spectrogram — You can plot any power as a spectrogram. Each line of the spectrogram is one periodogram. The time resolution of each line is 1/RBW, which is the minimum attainable resolution. Achieving the resolution you want may require combining several periodograms may be combined. You then use interpolation to calculate noninteger values of 1/RBW. In the spectrogram display, time scrolls from bottom to top, so the most recent data is shown at the bottom of the display. The offset shows the time value at which the center of the most current spectrogram line occurred.

 Note:   The number of FFT points (Nfft) is independent of the window length (Nwindow). You can set them to different values provided that Nfft is greater than or equal to Nwindow.

The Occupied BW is calculated as follows.

• Calculate the total power in the measured frequency range.

• Determine the lower frequency value. Starting at the lowest frequency in the range and moving upward, the power distributed in each frequency is summed until this sum is of the total power.

• Determine the upper frequency value. Starting at the highest frequency in the range and moving downward, the power distributed in each frequency is summed until it reaches of the total power.

• The bandwidth between the lower and upper power frequency values is the occupied bandwidth.

• The frequency halfway between the lower and upper frequency values is the center frequency.

The Distortion Measurements are computed as follows.

1. Spectral content is estimated by finding peaks in the spectrum. When the algorithm detects a peak, it ignores all adjacent content that decreases monotonically from the peak. After recording the width of the peak, it clears all monotonically decreasing values (that is, it treats all of these values as if they belong to the peak). Using this method, all spectral content centered at DC (0 Hz) is removed from the spectrum and the amount of bandwidth cleared (W0) is recorded.

2. The fundamental power (P1) is determined from the remaining maximum value of the displayed spectrum. A local estimate (Fe1) of the fundamental frequency is made by computing the central moment of the power in the vicinity of the peak. The bandwidth of the fundamental power content (W1) is recorded. Then, the power associated from the fundamental is removed as in step 1.

3. The power and width of the second, and higher order harmonics (P2, W2, P3, W3, etc.) are determined in succession by examining the frequencies closest to the appropriate multiple of the local estimate (Fe1). Any spectral content that decreases in a monotonically about the harmonic frequency is removed from the spectrum first before proceeding to the next harmonic.

4. Once the DC, fundamental, and harmonic content is removed from the spectrum, the power of the remaining spectrum is examined for its sum (Premaining) peak value (Pmaxspur), and its median value (Pestnoise).

5. The sum of all the removed bandwidth is computed as Wsum = W0+W1+W2+...+Wn.

The sum of powers of the second and higher order harmonics are computed as Pharmonic = P2+P3+P4+...+Pn.

6. The sum of the noise power is then estimated as Pnoise = (Premaining*dF + Pestnoise*Wsum)/RBW, where dF is the absolute difference between frequency bins, and RBW is the resolution bandwidth of the window.

7. The metrics for SNR, THD, SINAD, and SFDR are then computed from the estimates.

`$\begin{array}{l}THD=10\cdot {\mathrm{log}}_{10}\left(\frac{{P}_{harmonic}}{{P}_{1}}\right)\\ SINAD=10\cdot {\mathrm{log}}_{10}\left(\frac{{P}_{1}}{{P}_{harmonic}+{P}_{noise}}\right)\\ SNR=10\cdot {\mathrm{log}}_{10}\left(\frac{{P}_{1}}{{P}_{noise}}\right)\\ SFDR=10\cdot {\mathrm{log}}_{10}\left(\frac{{P}_{1}}{\mathrm{max}\left({P}_{maxspur},\mathrm{max}\left({P}_{2},{P}_{3},...,{P}_{n}\right)\right)}\right)\end{array}$`

The following considerations apply to Distortion Measurements.

• The harmonic distortion measurements use the spectrum trace shown in the display as the input to the measurements. The default `Hann` window setting of the Spectrum Analyzer may exhibit leakage that can completely mask the noise floor of the measured signal.

The harmonic measurements attempt to correct for leakage by ignoring all frequency content that decreases monotonically away from the maximum of harmonic peaks. If the window leakage covers more than 70% of the frequency bandwidth in your spectrum, you may see a blank reading (–) reported for SNR and SINAD. Consider using a Kaiser window with a high attenuation (up to 330dB) to minimize spectral leakage if your application can tolerate the increased equivalent noise bandwidth (ENBW) of the Kaiser window.

• The DC component is ignored.

• After windowing, the width of each harmonic component masks the noise power in the neighborhood of the fundamental frequency and harmonics. To estimate the noise power in each region, Spectrum Analyzer computes the median noise level in the nonharmonic areas of the spectrum. It then extrapolates that value into each region.

• Nth order intermodulation products occur at

A*F1 + B*F2

where F1 and F2 are the sinusoid input frequencies and |A| + |B| = N. A and B are integer values.

• For intermodulation measurements, the third-order intercept (TOI) point is computed as follows, where P is power in decibels of the measured power referenced to one milliwatt (dBm).:

• TOIlower = PF1 + (PF2 - P(2F1-F2))/2

• TOIupper = PF2 + (PF1 - P(2F2-F1))/2

• TOI = + (TOIlower + TOIupper)/2

Differences from Spectrum Scope Block

All Simulink® models containing Spectrum Scope blocks load with Spectrum Analyzer blocks in R2013a or later. Several options that were available on the Parameters dialog box of the Spectrum Scope block are no longer available or have changed. The parameters of Spectrum Scope map to Spectrum Analyzer parameters in the following manner.

R2012b Spectrum Scope Block Parameters dialog box Tab nameR2012b Spectrum Scope ParameterR2013a Spectrum Analyzer ChangeR2013a Spectrum Analyzer Equivalent Parameter
Scope PropertiesBuffer input check box R2013a Spectrum Analyzer does not require that input signals are buffered. Spectrum Analyzer determines the number of samples needed using the value of the RBW parameter. Regardless of whether the input is a frame-based or sample-based signal, Spectrum Analyzer calculates the spectrum once it has acquired the requisite number of samples.For Spectrum Scope blocks in R2012b or earlier models, the equivalent R2013a Spectrum Analyzer RBW value is given by the equation:
``` ```
In the preceding equation, NENBW is the window constant calculated for a window length of 1000, Fs is the sample rate of the block, and Nwindow is the buffer length. If the input signal to the R2012b Spectrum Scope block was frame-based and the Buffer input check box was cleared, then the R2013a Spectrum Analyzer computes the RBW value with Nwindow set to the frame size of the input signal.
Scope PropertiesBuffer size parameterR2013a Spectrum Analyzer uses the RBW parameter to determine the requisite number of samples to calculate the spectrum, instead of using the buffer size or frame length. For Spectrum Scope blocks in R2012b or earlier models, if the input signal was frame-based and the Buffer input check box was selected, then the R2013a Spectrum Analyzer computes the RBW value with Nwindow set to the value of the Buffer size parameter.
Scope PropertiesBuffer Overlap parameterR2013a Spectrum Analyzer has an Overlap % parameter that is directly related to buffer overlap. R2013a Spectrum Analyzer will compute its Overlap % using the equation:
``` ```
In the preceding equation, Op is Overlap % parameter value, Ol is the R2012b Spectrum Scope Buffer overlap parameter value, and Nwindow is the buffer length.
Scope PropertiesTreat Mx1 and unoriented sample-based signals asR2013a Spectrum Analyzer defaults to treating Mx1 and unoriented sample-based signals as one channel.Spectrum Scope blocks in R2012b or earlier models with Treat Mx1 and unoriented sample-based signals as set to ```M Channels``` will have the Spectrum Analyzer property `TreatMby1SignalAsOneChannel` set to `false`. This property is available only via the Scope Configuration object.
Scope PropertiesWindow parameterR2013a Spectrum Analyzer does not have the `Bartlett`, `Blackman`, `Triang`, or `Hanning` settings.Spectrum Scope blocks in R2012b or earlier models with a window parameter set to any of these values will have their Window parameter set to `Hann` in the R2013a Spectrum Analyzer.
Scope PropertiesWindow Sampling parameterR2013a Spectrum Analyzer does not have a `Periodic` option. All window sampling is now symmetric in the R2013a Spectrum Analyzer. n/a
Display PropertiesPersistence check box — this setting would execute the equivalent of the MATLAB `hold on` command, adding another line for each spectrum computation on the display. This option is not available in the R2013a Spectrum Analyzer, which has replaced this feature with the trace options, Normal Trace, Max Hold Trace, and Min Hold Trace. Spectrum Scope blocks in R2012b or earlier models with persistence enabled will have their Max Hold Trace check box selected in the R2013a Spectrum Analyzer.
Display PropertiesCompact Display check boxThere is no equivalent capability in the R2013a Spectrum Analyzer. n/a
Axis PropertiesInherit Sample time from input check boxR2013a Spectrum Analyzer always uses the sample time of the input signal. n/a
Axis PropertiesFrequency display limits parameterR2013a Spectrum Analyzer determines the range of frequencies calculated based on the Full Span, FStart (Hz), and FStop (Hz) parameters. If this parameter was set to:
• `Auto` — R2013a Spectrum Analyzer selects the Full Span check box on the Spectrum Settings panel, Main options pane.

• `User-defined` — R2013a Spectrum Analyzer clears the Full Span check box on the Spectrum Settings panel Main options pane.

Axis PropertiesMinimum frequency (Hz) parameterR2013a Spectrum Analyzer determines the range of frequencies calculated based on the Full Span, FStart (Hz), and FStop (Hz) parameters. If the `User-defined` parameter was chosen, then this parameter maps to the R2013a Spectrum Analyzer FStart (Hz) parameter.
Axis PropertiesMaximum frequency (Hz) parameter R2013a Spectrum Analyzer determines the range of frequencies calculated based on the Full Span, FStart (Hz), and FStop (Hz) parameters. If the `User-defined` parameter was chosen, then this parameter maps to the R2013a Spectrum Analyzer FStop (Hz) parameter.
Line PropertiesLine visibilities, Line styles, Line markers, and Line colors parametersThere are no equivalent capabilities in the R2013a Spectrum Analyzer. Once the simulation has started, you can modify the line styles, markers, and colors using the Style dialog box.

The R2012b Spectrum Scope allowed you to retain the axes limits over multiple simulations by selecting Axes > Save Axes Settings. There is no equivalent capability in the R2013a Spectrum Analyzer. However, you can automatically scale the axes to a specified range using the Tools — Axes Scaling Properties dialog box.

Supported Data Types

PortSupported Data Types

Input

• Double-precision floating point

• Single-precision floating point

• Fixed point (signed and unsigned)

Supported Simulation Modes

You can use the scope block in models running the following supported simulation modes.

ModeSupportedNotes and Limitations

Normal

Yes

Accelerator

Yes

Rapid Accelerator

Yes

You can use Rapid Accelerator mode as a method to increase the execution speed of your Simulink model. Rapid Accelerator mode creates an executable that includes the solver and model methods. This executable resides outside MATLAB and Simulink. Rapid Accelerator mode uses External mode to communicate with Simulink. For more information about Rapid Accelerator mode, see Acceleration (Simulink).

PIL

No

SIL

No

External

Yes

You can use External mode to tune block parameters in real time and view block outputs in many types of blocks and subsystems. External mode establishes communication between a host system, where the Simulink environment resides, and a target system, where the executable runs after code generation and the build process. For more information about External mode, see Set Up and Use Host/Target Communication Channel (Simulink Coder).

The scope does not support data archiving. See Set External Mode Data Archiving Parameters (Simulink Desktop Real-Time).