sptool

Open interactive digital signal processing tool

Syntax

sptool

Description

The command, sptool, opens SPTool, a suite of four tools: Signal Browser, Filter Design and Analysis Tool, FVTool, and Spectrum Viewer. These tools provide access to many of the signal, filter, and spectral analysis functions in the toolbox. When you type sptool at the command line, the SPTool suite opens.

Using SPTool, you can:

  • Analyze signals listed in the Signals list box with the Signal Browser.

  • Design or edit filters with the Filter Design and Analysis Tool (includes a Pole/Zero Editor).

  • Analyze filter responses for filters listed in the Filters list box with FVTool.

  • Apply filters in the Filters list box to signals in the Signals list box.

  • Create and analyze signal spectra with the Spectrum Viewer.

  • Print the Signal Browser, Filter Design and Analysis Tool, and Spectrum Viewer.

You can activate all four integrated signal processing tools from SPTool.

Signal Browser

The Signal Browser, hereafter referred to as the scope, allows you to view, measure, and analyze the time-domain information of one or more signals. To activate the Signal Browser, press the View button under the Signals list box in SPTool.

See the following sections for more information on the Signal Browser:

Displaying Multiple Signals

Multiple Signal Input

Select more than one signal in the Signals list box to show multiple signals within the same display or on separate displays. By default, the signals appear as different-colored lines on the same display. The signals can have different dimensions, sample rates, and data types. Each signal can be either real or complex valued.

Multiple Signal Colors

By default, Signal Browser has a white axes background and chooses line colors for each channel in a manner similar to the MATLAB® plot function. Signal Browser considers each of the real and imaginary components of the input signals to be a channel, and assigns each channel a line color in the following order:

  1. Blue

  2. Dark Green

  3. Red

  4. Cyan

  5. Purple

  6. Dark Yellow

  7. Black

If there are more than 7 channels, the scope repeats this order to assign line colors to the remaining channels. For example, if you select 4 complex-valued input signals, the following legend appears in the display.

If all the input signals are real-valued, Signal Browser skips the line colors that would be associated with their imaginary components. For example, if you select 4 real-valued input signals, the following legend appears in the display.

To manually modify any line color, select View > Style to open the Style dialog box. Next to Properties for line, select the signal name whose color you want to change. Then, next to Line, click the Line color button ( ) and select any color from the palette. To change the axes background color, click the Axes background color button ( ), and select any color from the palette.

Multiple Displays

You can display multiple channels of data on different displays in the scope window. In the scope toolbar, select View > Layout, or select the Layout button ( ).

    Note:   The Layout menu item and button are not available when the scope is in snapshot mode.

This feature allows you to tile the window into a number of separate displays, up to a grid of 4 rows and 4 columns. For example, if there are three inputs to the scope, you can display the signals in separate displays by selecting row 3, column 1, as shown in the following figure.

After you select row 3, column 1, the scope window is partitioned into three separate displays, as shown in the following figure.

When you use the Layout option to tile the window into multiple displays, the display highlighted in blue is referred to as the active display. The scope dialog boxes reference the active display.

Signal Display

The Signal Browser uses the longest time length of all the input signals selected in the Signals list box for the time range. To communicate the array of times that corresponds to the current display, the scope uses the Minimum time-axis limit, Time units, and Maximum time-axis limit indicators on the scope window. The following figure highlights these aspects of the Signal Browser window.

  • Minimum time-axis limit — The Signal Browser sets the minimum time-axis limit to 0.

  • Maximum time-axis limit — The Signal Browser sets the maximum time-axis limit to the final time step of the longest input signal.

  • Time units — The units used to describe the time-axis. The Signal Browser sets the time units using the value of the Time Units parameter on the Main tab of the Visuals:Time Domain Options dialog box. By default, this parameter is set to Metric (based on Time Span) and displays in metric units such as microseconds, milliseconds, minutes, days, etc. You can change the unit of measure to Seconds to always display the time-axis values in units of seconds. You can change it to None to suppress the display of units of measure on the time-axis. When you set this parameter to None, then the Signal Browser shows only the word Time on the time-axis.

    To hide both the word Time and the values on the time-axis, set the Show time-axis labels parameter to None. To hide both the word Time and the values on the time-axis in all displays except the bottom ones in each column of displays, set this parameter to Bottom Displays Only. This behavior differs from that of the Simulink® Scope block, which always shows the values but never shows a label on the x-axis.

Signal Names and Legend Strings

Signal Browser uses the names of the signals in the SPTool as the strings displayed in the legends. If you change the name of any selected signal in the Signals list box, its corresponding legend string in Signal Browser changes immediately. To change the name of any selected signal, from the SPTool menu, select Edit > Name. Signal Browser automatically updates the legend string to reflect the new signal name you entered. Similarly, if you modify any string in a legend in Signal Browser, SPTool updates the corresponding signal name in the Signals list box.

Axes Maximization

You can specify whether to display the Signal Browser in maximized axes mode. In this mode, the axes are expanded to fill the entire display. In each display, there is no space to show titles or axis labels. The minimum and maximum time-axis limits are located at the far-left and far-right edges of the display. The values at the axis tick marks appear as grid lines on top of the axes. The following figure highlights how three displays appear in maximized axes mode in the Signal Browser window.

To enable or disable this mode, in the Signal Browser menu, select View > Properties to bring up the Visuals:Time Domain Options dialog box. In the Main pane, you can set the Maximize axes parameter to one of the following options:

  • Auto — In this mode, the axes appear maximized in all displays only if the Title and Y-Axis label parameters are empty for every display. If you enter any value in any display for either of these parameters, the axes are not maximized.

  • On — In this mode, the axes appear maximized in all displays. Any values entered into the Title and Y-Axis label parameters are hidden.

  • Off — In this mode, none of the axes appear maximized.

See the Visuals — Time Domain Options section for more information.

Toolbar

The Signal Browser toolbar contains the following buttons.

Print Button

ButtonMenu LocationShortcut KeysDescription

File > PrintCtrl+P

Print the current scope window. To print the current scope window to a figure rather than sending it to your printer, select File > Print to figure.

Zoom and Axes Control Buttons

ButtonMenu LocationShortcut KeysDescription

Tools >
Zoom In

N/A

When this tool is active, you can zoom in on the scope window. To do so, click in the center of your area of interest, or click and drag your cursor to draw a rectangular area of interest inside the scope window.

Tools >
Zoom X

N/A

You access the Zoom X button from the menu under the Zoom In icon. When this tool is active, you can zoom in on the x-axis. To do so, click inside the scope window, or click and drag your cursor along the x-axis over your area of interest.

Tools >
Zoom Y

N/A

You access the Zoom Y button from the menu under the Zoom In icon. When this tool is active, you can zoom in on the y-axis. To do so, click inside the scope window, or click and drag your cursor along the y-axis over your area of interest.

Tools >
Pan

N/A

You access the Pan button from the menu under the Zoom In icon. When this tool is active, you can pan on the scope window. To do so, click in the center of your area of interest and drag your cursor to the left, right, up, or down, to move the position of the display.

Tools >
Scale Y-Axis Limits
Ctrl+A

Click this button to scale the axes in the active scope window.

Alternatively, you can enable automatic axes scaling by selecting one of the following options from the Tools menu:

  • Automatically Scale Axes Limits — When you select this option, the scope scales the axes as needed during simulation.

  • Scale Axes Limits after 10 Updates — When you select this option, the scope scales the axes after 10 updates. The scope does not scale the axes again during the simulation.

  • Scale Axes Limits at Stop — When you select this option, the scope scales the axes each time the simulation is stopped.

Tools >
Scale X-Axis Limits
N/A

You access the Scale X-Axis Limits button from the menu under the current Axis Limits icon. Click this button to scale the axes in the X direction in the active scope window.

Alternatively, you can enable automatic axes scaling by selecting one of the following options from the Tools menu:

  • Automatically Scale Axes Limits — When you select this option, the scope scales the axes as needed during simulation.

  • Scale Axes Limits after 10 Updates — When you select this option, the scope scales the axes after 10 updates. The scope does not scale the axes again during the simulation.

  • Scale Axes Limits at Stop — When you select this option, the scope scales the axes each time the simulation is stopped.

Tools >
Scale X & Y Axes Limits
N/A

You access the Scale X & Y Axes Limits button from the menu under the current Axis Limits icon. Click this button to scale the axes in both the X and Y directions in the active scope window.

Alternatively, you can enable automatic axes scaling by selecting one of the following options from the Tools menu:

  • Automatically Scale Axes Limits — When you select this option, the scope scales the axes as needed during simulation.

  • Scale Axes Limits after 10 Updates — When you select this option, the scope scales the axes after 10 updates. The scope does not scale the axes again during the simulation.

  • Scale Axes Limits at Stop — When you select this option, the scope scales the axes each time the simulation is stopped.

Measurements Buttons

Tools >
Measurements
>
Cursor Measurements

N/A

Open or close the Cursor Measurements panel. This panel puts screen cursors on all the displays.

See the Cursor Measurements Panel section for more information.

Tools >
Measurements
>
Signal Statistics

N/A

Open or close the Signal Statistics panel. This panel displays the maximum, minimum, peak-to-peak difference, mean, median, RMS values of a selected signal, and the times at which the maximum and minimum occur.

See the Signal Statistics Panel section for more information.

Tools >
Measurements
>
Bilevel Measurements

N/A

Open or close the Bilevel Measurements panel. This panel displays information about a selected signal's transitions, overshoots or undershoots, and cycles.

See the Bilevel Measurements Panel section for more information.

Tools >
Measurements
>
Peak Finder

N/A

Open or close the Peak Finder panel. This panel displays maxima and the times at which they occur, allowing the settings for peak threshold, maximum number of peaks, and peak excursion to be modified.

See the Peak Finder Panel section for more information.

Other Buttons

Tools > Play Selected Signal

N/A

Play an audio signal. The function soundsc is used to play the signal.

View > Show All Legends

N/A

Show a legend that matches each line style to a signal name in every display.

View > Layout

N/A

Arrange the layout of displays in the Signal Browser. This feature allows you to tile your screen into a number of separate displays, up to a grid of 4 rows and 4 columns. You may find multiple displays useful when you select multiple input signals in SPTool. The default display is 1 row and 1 column. See the Multiple Displays section for more information.

You can control whether this toolbar appears in the Signal Browser window. From the Signal Browser menu, select View > Toolbar.

Measurements Panels

The Measurements panels are the five panels that appear at the right side of the Signal Browser. These panels are labeled Trace selection, Cursor measurements, Signal statistics, Bilevel measurements, and Peak finder.

Measurements Panel Buttons

Each of the Measurements panels contains the following buttons that enable you to modify the appearance of the current panel.

ButtonDescription

Move the current panel to the top. When you are displaying more than one panel, this action moves the current panel above all the other panels.

Collapse the current panel. When you first enable a panel, by default, it displays one or more of its panes. Click this button to hide all of its panes to conserve space. After you click this button, it becomes the expand button .

Expand the current panel. This button appears after you click the collapse button to hide the panes in the current panel. Click this button to display the panes in the current panel and show measurements again. After you click this button, it becomes the collapse button again.

Undock the current panel. This button lets you move the current panel into a separate window that can be relocated anywhere on your screen. After you click this button, it becomes the dock button in the new window.

Dock the current panel. This button appears only after you click the undock button. Click this button to put the current panel back into the right side of the Scope window. After you click this button, it becomes the undock button again.

Close the current panel. This button lets you remove the current panel from the right side of the Scope window.

Some panels have their measurements separated by category into a number of panes. Click the pane expand button to show each pane that is hidden in the current panel. Click the pane collapse button to hide each pane that is shown in the current panel.

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 on 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. You can choose to hide or display the Cursor Measurements panel. In the Scope menu, select Tools > Measurements > Cursor Measurements. Alternatively, in the Scope toolbar, click the Cursor Measurements button.

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.

 Settings Pane

 Measurements Pane

Signal Statistics Panel

The Signal Statistics panel displays the maximum, minimum, peak-to-peak difference, mean, median, and RMS values of a selected signal. It also shows the x-axis indices at which the maximum and minimum values occur. You can choose to hide or display the Signal Statistics panel. In the Scope menu, select Tools > Measurements > Signal Statistics. Alternatively, in the scope toolbar, click the Signal Statistics button.

 Signal Statistics Measurements

When you use the zoom options in the Scope, the Signal Statistics measurements automatically adjust to the time range shown in the display. In the Scope toolbar, click the Zoom In or Zoom X button to constrict the x-axis range of the display, and the statistics shown reflect this time range. For example, you can zoom in on one pulse to make the Signal Statistics panel display information about only that particular pulse.

The Signal Statistics measurements are valid for any units of the input signal. The letter after the value associated with each measurement represents 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. The SI prefixes are shown in the following table:

AbbreviationNameMultiplier
aatto10^-18
ffemto10^-15
ppico10^–12
nnano10^-9
umicro10^-6
mmilli10^-3
  10^0
kkilo10^3
Mmega10^6
Ggiga10^9
Ttera10^12
Ppeta10^15
Eexa10^18

Bilevel Measurements Panel

The Bilevel Measurements panel shows information about a selected signal's transitions, overshoots or undershoots, and cycles. You can choose to hide or display the Bilevel Measurements panel. In the Scope menu, select Tools > Measurements > Bilevel Measurements. Alternatively, in the Scope toolbar, you can select the Bilevel Measurements button.

The Bilevel Measurements panel is separated into four panes, labeled Settings, Transitions, Overshoots / Undershoots, and Cycles. You can expand each pane to see the available options.

 Settings Pane

 Transitions Pane

 Overshoots/Undershoots

 Cycles

When you use the zoom options in the Scope, the bilevel measurements automatically adjust to the time range shown in the display. In the Scope toolbar, click the Zoom In or Zoom X button to constrict the x-axis range of the display, and the statistics shown reflect this time range. For example, you can zoom in on one rising edge to make the Bilevel Measurements panel display information about only that particular rising edge. However, this feature does not apply to the High and Low measurements.

Peak Finder Panel

The Peak Finder panel displays the maxima, showing the x-axis values at which they occur. 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.

 Settings Pane

 Peaks Pane

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.

AbbreviationNameMultiplier
aatto10^–18
ffemto10^–15
ppico10^–12
nnano10^–9
umicro10^–6
mmilli10^–3
  10^0
kkilo10^3
Mmega10^6
Ggiga10^9
Ttera10^12
Ppeta10^15
Eexa10^18

Visuals — Time Domain Options

The Visuals — Time Domain Properties dialog box controls the visual configuration settings of the Signal Browser display. From the menu, select View > Configuration Properties to open this dialog box.

Main Pane

The Main pane of the Visuals — Time Domain Properties dialog box appears as follows.

Time units

Specify the units used to describe the time-axis. The default setting is Metric. You can select one of the following options.

  • Metric — In this mode, the Signal Browser converts the times on the time-axis to some metric units such as milliseconds, microseconds, days, etc. The Signal Browser chooses the appropriate metric units, based on the minimum time-axis limit and the maximum time-axis limit of the window.

  • Seconds — In this mode, the Signal Browser always displays the units on the time-axis as seconds.

  • None — In this mode, the Signal Browser displays no units on the time-axis. The Signal Browser shows only the word Time on the time-axis.

Time-axis labels

Specify how to display the time units used to describe the time-axis. The default setting is All. You can select one of the following options.

  • All — In this mode, the time-axis labels appear in all displays.

  • None — In this mode, the time-axis labels do not appear in the displays.

  • Bottom Displays Only — In this mode, the time-axis labels appear only in the bottom row of the displays.

Show time-axis label

Select to turn on time-axis label display.

Maximize axes

Specify whether to display the Signal Browser in maximized axes mode. In this mode, each of the axes is expanded to fit into the entire display. In each display, there is no space to show labels. Tick mark values are shown on top of the plotted data. The default setting is Auto. You can select one of the following options:

  • Auto — In this mode, the axes appear maximized in all displays only if the Title and Y-Axis label parameters are empty for every display. If you enter any value in any display for either of these parameters, the axes are not maximized.

  • On — In this mode, the axes appear maximized in all displays. Any values entered into the Title and Y-Axis label parameters are hidden.

  • Off — In this mode, none of the axes appear maximized.

Display Pane

The Display pane of the Visuals — Time Domain Properties dialog box appears as follows.

Active display

Specify the active display as an integer to get and set relevant properties. The number of a display corresponds to its column-wise placement index. Set this property to control which display should have its axes colors, line properties, marker properties, and visibility changed.

When you use the Layout option to tile the window into multiple displays, the display highlighted in blue is referred to as the active display. The default setting is 1.

Title

Specify the active display title as a string. By default, the active 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 the legend off, clear the Show legend check box. This parameter applies only when the Spectrum Type is Power or Power density.

You can edit the name of any channel in the legend. To do so, double-click the current name, and enter 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.

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.

Plot signals as magnitude and phase

When you select this check box, the scope splits the display into a magnitude plot and a phase plot. By default, this check box is cleared. If the input signal is complex valued, the scope plots the real and imaginary portions on the same axes. These real and imaginary portions appear as different-colored lines on the same axes, as shown in the following figure.

Selecting this check box and clicking the Apply or OK button changes the display. The magnitude of the input signal appears on the top axes and its phase, in degrees, appears on the bottom axes. See the following figure.

This feature is particularly useful for complex-valued input signals. If the input is a real-valued signal, selecting this check box returns the absolute value of the signal for the magnitude. The phase is 0 degrees for nonnegative input and 180 degrees for negative input.

Y-limits (Minimum)

Specify the minimum value of the y-axis.

When you select the Plot signal(s) as magnitude and phase check box, the value of this property always applies to the magnitude plot on the top axes. The phase plot on the bottom axes is always limited to a minimum value of -180 degrees.

Y-limits (Maximum)

Specify the maximum value of the y-axis.

When you select the Plot signal(s) as magnitude and phase check box, the value of this property always applies to the magnitude plot on the top axes. The phase plot on the bottom axes is always limited to a maximum value of 180 degrees.

Y-label

Specify as a string the text for the scope to display to the left of the y-axis.

This property becomes invisible when you select the Plot signal(s) as magnitude and phase check box. When you enable that property, the y-axis label always appears as Magnitude on the top axes and Phase on the bottom axes.

Style Dialog Box

In the Style dialog box, you can customize the style of displays. You can change the color of the figure containing the displays, the background and foreground colors of display axes, and properties of lines in a display. From the Signal Browser menu, select View > Style to open this dialog box.

Properties

The Style dialog box allows you to modify the following properties of the Signal Browser:

Figure color

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

Plot type

Specify the type of plot to use. The default setting is Line. Valid values for Plot type are:

  • Line — Displays input signal as lines connecting each of the sampled values. This approach is similar to the functionality of the MATLAB line or plot function.

  • Stairs — Displays input signal as a stairstep graph. A stairstep graph is made up of only horizontal lines and vertical lines. Each horizontal line represents the signal value for a discrete sample period and is connected to two vertical lines. Each vertical line represents a change in values occurring at a sample. This approach is equivalent to the MATLAB stairs function. Stairstep graphs are useful for drawing time history graphs of digitally sampled data.

Select display

Specify the active display as a number, where a display number corresponds to the index of the input signal. The number of a display corresponds to its column-wise placement index. The default setting is 1. Set this parameter to control which display should have its axes colors, line properties, marker properties, and visibility changed.

Axes colors

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

Properties for line

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

Visible

Specify whether the selected signal on the active display 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 signal on the active display.

Marker

Specify marks for the selected signal on the active display to show at data points. This parameter is similar to the Marker property for the MATLAB Handle Graphics® plot objects. You can choose any of the marker symbols from the following table.

SpecifierMarker Type
noneNo marker (default)
Circle
Square
Cross
Point
Plus sign
Asterisk
Diamond
Downward-pointing triangle
Upward-pointing triangle
Left-pointing triangle
Right-pointing triangle
Five-pointed star (pentagram)
Six-pointed star (hexagram)

Filter Design and Analysis Tool

The Filter Design and Analysis Tool fdatool allows you to design and edit FIR and IIR filters. To launch fdatool, press either the New button or the Edit button under the Filters list box in SPTool.

    Note   When you open FDATool from SPTool, a reduced version of FDATool that is compatible with SPTool opens.

The Filter Design and Analysis Tool has a Pole/Zero Editor you can access by selecting the icon in the left column of FDATool.

Filter Visualization Tool

The Filter Visualization Tool (fvtool) allows you to view the characteristics of a designed or imported filter, including its magnitude response, phase response, group delay, phase delay, pole-zero plot, impulse response, and step response. To activate FVTool, click the View button under the Filters list box in SPTool.

Spectrum Viewer

The Spectrum Viewer allows you to analyze frequency-domain data graphically using a variety of methods of spectral density estimation, including the Burg method, the FFT method, the multitaper method, the MUSIC eigenvector method, Welch's method, and the Yule-Walker autoregressive method. To activate the Spectrum Viewer:

  • Click the Create button under the Spectra list box to compute the power spectral density for a signal selected in the Signals list box in SPTool. You may need to click Apply to view the spectra.

  • Click the View button to analyze spectra selected under the Spectra list box in SPTool.

  • Click the Update button under the Spectra list box in SPTool to modify a selected power spectral density signal.

In addition, you can right-click in any plot display area to modify signal properties.

Was this topic helpful?