| Signal Processing Blockset™ | ![]() |
Display vector or matrix of time-domain, frequency-domain, or user-defined data
Signal Processing Sinks
dspsnks4
The Vector Scope block is a comprehensive display tool similar to a digital oscilloscope. The block can display time-domain, frequency-domain, or user-defined signals. You can use the Vector Scope block to plot consecutive time samples from a frame-based vector, or to plot vectors containing data such as filter coefficients or spectral magnitudes. To compute and plot the periodogram of a signal with a single block, use the Spectrum Scope block.
The input to the Vector Scope block can be any real-valued M-by-N matrix, column or row vector, or 1-D (unoriented) vector, where 1-D vectors are treated as column vectors. Regardless of the input frame status, the block treats each column of an M-by-N input as an independent channel of data with M consecutive samples.
The block plots each sample of each input channel sequentially across the horizontal axis of the plot.
The Scope Properties pane enables you to plot time-domain, frequency-domain, or user-defined data, and adjust the horizontal display span of the plot. The scope displays frames of data, and updates the display for each new input frame.
The Input domain parameter specifies the domain of the input data. If you select Time, for M-by-N inputs containing time-domain data, the block treats each of the N input frames (columns) as a succession of M consecutive samples taken from a time series. That is, each data point in the input frame is assumed to correspond to a unique time value. Also, the Time display span (number of frames) parameter appears on the pane. Enter a scalar value greater than or equal to one that corresponds to the number of frames to be displayed across the width of the scope window.
If you select Frequency for the Input domain parameter, for M-by-N inputs containing frequency-domain data, the block treats each of the N input frames (columns) as a vector of spectral magnitude data corresponding to M consecutive ascending frequency indices. That is, when the input is a single column vector, u, each value in the input frame, u(i), is assumed to correspond to a unique frequency value, f(i), where f(i+1)>f(i).
If you select User-defined for the Input domain parameter, the block does not assume that the input frame data is time-domain or frequency-domain data. You can plot the data in the appropriate manner. Also, the Horizontal display span (number of frames) parameter appears on the pane. Enter a scalar value greater than or equal to one that corresponds to the number of frames to be displayed across the width of the scope window.

The Display Properties pane enables you to control how the block displays your data.
The Show grid parameter toggles the background grid on and off.
If you select the Persistence check box, the window maintains successive displays. That is, the scope does not erase the display after each frame (or collection of frames), but overlays successive input frames in the scope display.
If you select the Frame number check box, the block displays the number of the current frame in the input sequence on the scope window, and the block increments the count as each new input is received. Counting starts at 1 with the first input frame, and continues until the simulation stops.
If you select the Channel legend check box, a legend indicating the line color, style, and marker of each channel's data is added. When the input signal is labeled, that label is displayed in the channel legend. When the input signal is not labeled, but comes from a Concatenate block with labeled inputs, those labels are displayed in the channel legend. Otherwise, each channel in the legend is labeled with the channel number (CH 1, CH 2, etc.). Click-and-drag the legend to reposition it in the scope window; double-click on the line label to edit the text. If you rerun the simulation, the labels revert to the defaults.
If you select the Compact display check box, the scope completely fills the figure window. The scope does not display menus and axis titles, and it shows the numerical axis labels within the axes. If you clear the Compact display check box, the scope displays the axis labels and titles in a gray border surrounding the scope axes, and the window's menus and toolbar are visible.
If you select the Open scope at start of simulation check box, the scope opens at the start of the simulation. If you clear this parameter, the scope does not open automatically during the simulation. To view the scope, double-click the Vector Scope block, which brings up the scope as well as the block parameter dialog box. Use this feature when you have several scope blocks in a model and you do not want to view all the associated scopes during the simulation.
If the scope is not open during the simulation and you select the Open scope immediately check box, the block opens the scope and clears the check box.
The Scope position parameter specifies a four-element vector of the form
[left bottom width height]
specifying the position of the scope window on the screen, where (0,0) is the lower-left corner of the display. See the MATLAB® figure function for more information.
The parameters that are available on the Axis Properties pane depend on the setting of the Input domain parameter on the Scope Properties pane.
Time Domain Inputs
When Time display limits is set to Auto, the block scales the horizontal axis of time-domain
signals automatically. The range of the time axis is
, where Tfi is the input frame period, and S is the Time display span (number of frames) parameter on the Scope Properties pane.
The spacing between time points is
, where M is the number of samples
in each consecutive input frame.
When Time display limits is set to User-defined, the Minimum X-limit and Maximum X-limit parameters set the range of the horizontal axis. Setting these parameters is analogous to setting the xmin and xmax values of the MATLAB axis function.
Minimum Y-limit and Maximum Y-limit parameters set the range of the vertical axis. Setting these parameters is analogous to setting the ymin and ymax values of the MATLAB axis function.
The Y-axis title is the text displayed to the left of the y-axis.
Frequency Domain Inputs
The Frequency units parameter specifies
whether the frequency axis values should be in units of Hertz or rad/sec.
When the Frequency units parameter is set to Hertz, the spacing between frequency points is
, where Ts is the sample time of the original
time-domain signal. When the Frequency units parameter
is set to rad/sec, the spacing between
frequency points is
.
The Frequency range parameter specifies
the range of frequencies over which the magnitudes in the input should
be plotted. The available options are [0..Fs/2], [-Fs/2..Fs/2], and [0..Fs], where Fs is the original time-domain signal's
sample frequency. The Vector Scope block assumes that the input data
spans the range
,
which is the same as the output from an FFT. To plot over the range [0..Fs/2] the scope truncates the input vector, leaving
only the first half of the data, then plots these remaining samples
over half the frequency range. To plot over the range [-Fs/2..Fs/2], the scope reorders the input vector
elements such that the last half of the data becomes the first half,
and vice versa; then it relabels the x-axis accordingly.
If you select the Inherit sample time from input check box for frequency domain inputs, the block scales the frequency axis by reconstructing the frequency data from the frame-period of the frequency-domain input. This is valid when the following conditions hold:
Each frame of frequency-domain data shares the same length as the frame of time-domain data from which it was generated; for example, when the FFT is computed on the same number of points as are contained in the time-domain input.
The sample period of the time-domain signal in the simulation is equal to the period with which the physical signal was originally sampled.
Consecutive frames containing the time-domain signal do not overlap each other; that is, a particular signal sample does not appear in more than one sequential frame.
In cases where not all of these conditions hold, specify the appropriate value for the Sample time of original time series parameter.
When Frequency display limits is set to Auto, the block scales the horizontal axis of frequency-domain signals automatically. To do this, the Vector Scope block needs to know the sample period of the original time-domain sequence represented by the frequency-domain data. Specify this period by entering a value for the Sample time of original time series parameter.
When Frequency display limits is set to User-defined, the Minimum X-limit and Maximum X-limit parameters set the range of the horizontal axis. Setting these parameters is analogous to setting the xmin and xmax values of the MATLAB axis function.
The Amplitude scaling parameter allows you to select Magnitude or dB scaling along the y-axis.
Minimum Y-limit and Maximum Y-limit parameters set the range of the vertical axis. Setting these parameters is analogous to setting the ymin and ymax values of the MATLAB axis function.
The Y-axis title is the text displayed to the left of the y-axis.
User-Defined Inputs
If you select the Inherit sample increment from input check box for user-defined input domains, the block scales the horizontal axis by computing the horizontal interval between samples in the input frame from the frame period of the input. For example, when the input frame period is 1, and there are 64 samples per input frame, the interval between samples is computed to be 1/64. Computing the interval this way is usually only valid when the following conditions hold:
The input is a nonoverlapping time series; the x-axis on the scope represents time.
The input's sample period (1/64 in the above example) is equal to the period with which the physical signal was originally sampled.
In cases where not all of these conditions hold, use the X display offset and Increment per sample in input parameters.
The X-axis title is the text displayed below the x-axis.
When X display limits is set to Auto, the block scales the horizontal axis of user-defined
domain signals automatically. To do this, the Vector Scope block needs
to know the spacing of the input data. Specify this spacing using
the Increment per sample in input parameter, Is. This parameter represents the
numerical interval between adjacent x-axis points
corresponding to the input data. The range of the horizontal axis
is
, where M is the number of samples in each consecutive input frame,
and S is the Horizontal display span
(number of frames) parameter that you specify in the Scope Properties pane.
When X display limits is set to User-defined, the Minimum X-limit and Maximum X-limit parameters set the range of the horizontal axis. Setting these parameters is analogous to setting the xmin and xmax values of the MATLAB axis function.
Minimum Y-limit and Maximum Y-limit parameters set the range of the vertical axis. Setting these parameters is analogous to setting the ymin and ymax values of the MATLAB axis function.
The Y-axis title is the text displayed to the left of the y-axis.
Use the parameters on the Line Properties pane to help you distinguish between two or more independent channels of data on the scope.
The Line visibilities parameter specifies which channel's data is displayed on the scope, and which is hidden. The syntax specifies the visibilities in list form, where the term on or off as a list entry specifies the visibility of the corresponding channel's data. The list entries are separated by the pipe symbol, |.
For example, a five-channel signal would ordinarily generate five distinct plots on the scope. To disable plotting of the third and fifth lines, enter the following visibility specification in the Line visibilities parameter.
![]()
Note that the first (leftmost) list item corresponds to the first signal channel (leftmost column of the input matrix).
The Line styles parameter specifies the line style with which each channel's data is displayed on the scope. The syntax specifies the channel line styles in list form, with each list entry specifying a style for the corresponding channel's data. The list entries are separated by the pipe symbol, |.
For example, a five-channel signal would ordinarily generate all five plots with a solid line style. To plot each line with a different style, enter
![]()
These settings plot the signal channels with the following styles.
| Line Style | Command to Type in Line Style Parameter | Appearance |
|---|---|---|
Solid | - |
|
Dashed | -- |
|
Dotted | : |
|
Dash-dot | -. |
|
No line | none | No line appears |
Note that the first (leftmost) list item, '-', corresponds to the first signal channel (leftmost column of the input matrix). See the LineStyle property of the MATLAB line function for more information about the style syntax.
The Line markers parameter specifies the marker style with which each channel's samples are represented on the scope. The syntax specifies the channels' marker styles in list form, with each list entry specifying a marker for the corresponding channel's data. The list entries are separated by the pipe symbol, |.
For example, a five-channel signal would ordinarily generate all five plots with no marker symbol (that is, the individual sample points are not marked on the scope). To instead plot each line with a different marker style, you could enter
![]()
These settings plot the signal channels with the following styles.
| Marker Style | Command to Type in Marker Style Parameter | Appearance |
|---|---|---|
Asterisk | * |
|
Point | . |
|
Cross | x |
|
Square | s |
|
Diamond | d |
|
Note that the leftmost list item, '*', corresponds to the first signal channel or leftmost column of the input matrix. See the Marker property of the MATLAB line function for more information about the available markers.
To produce a stem plot for the data in a particular channel, type the word stem instead of one of the basic marker shapes.
The Line colors parameter specifies the color in which each channel's data is displayed on the scope. The syntax specifies the channel colors in list form, with each list entry specifying a color (in one of the MATLAB ColorSpec formats) for the corresponding channel's data. The list entries are separated by the pipe symbol, |.
For example, a five-channel signal would ordinarily generate all five plots in the color black. To instead plot the lines with the color order below, enter
![]()
or
![]()
These settings plot the signal channels in the following colors (8-bit RGB equivalents shown in the center column).
| Color | RGB Equivalent | Appearance |
|---|---|---|
Black | (0,0,0) |
|
Blue | (0,0,255) |
|
Red | (255,0,0) |
|
Green | (0,255,0) |
|
Dark purple | (192,0,192) |
|
Note that the leftmost list item, 'k', corresponds to the first signal channel or leftmost column of the input matrix. See the MATLAB function ColorSpec for more information about the color syntax.
The title in the window title bar is the same as the block title. In addition to the standard MATLAB figure window menus such as File, Window, and Help, the Vector Scope window contains Axes and Channels menus.
The parameters that you set using the Axes menu apply to all channels. Many of the parameters in this menu are also accessible through the block parameters dialog box. For descriptions of these parameters, see Display Properties Pane. Below are descriptions of other parameters in the Axes menu:
Refresh erases all data on the scope display, except for the most recent trace. This command is useful in conjunction with the Persistence setting.
Autoscale resizes the y-axis to best fit the vertical range of the data. The numerical limits selected by the autoscale feature are displayed in the Minimum Y-limit and Maximum Y-limit parameters in the parameter dialog box. You can edit these values.
Save position automatically updates the Scope position parameter in the Axis properties field to reflect the scope window's current position and size. To make the scope window open at a particular location on the screen when the simulation runs, drag the window to the desired location, resize it, and select Save position. Note that the parameter dialog box must be closed when you select Save position in order for the Scope position parameter to be updated.
The properties listed in the Channels menu apply to a particular channel. All of the parameters in this menu are also accessible through the block parameters dialog box. For descriptions of these parameters, see Line Properties Pane.
Many of these options can also be accessed by right-clicking with the mouse anywhere on the scope display. The menu that is displayed contains a combination of the options available in both the Axes and Channels menus.
Note When you select Compact display from the Axes menu, the Axes and Channels menus are no longer visible. Right-click in the Vector Scope window and click Compact display in order to make the menus reappear. |

Select the domain of the input. Your choices are Time, Frequency, or User-defined. Tunable.
The number of consecutive frames to display (horizontally) on the scope at any one time. This parameter is visible when the Input domain parameter is set to Time.
The number of consecutive frames to display (horizontally) on the scope at any one time. This parameter is visible when the Input domain parameter is set to User-defined.

Toggle the scope grid on and off. Tunable.
Select this check box to maintain successive displays. That is, the scope does not erase the display after each frame (or collection of frames), but overlays successive input frames in the scope display. Tunable.
If you select this check box, the number of the current frame in the input sequence appears in the Vector Scope window. Tunable.
Toggles the legend on and off. Tunable.
Resizes the scope to fill the window. Tunable.
Select this check box to open the scope at the start of the simulation. When this parameter is cleared, the scope does not open automatically during the simulation. Tunable.
If the scope is not open during simulation, select this check box to open it. This parameter is visible only while the simulation is running.
A four-element vector of the form [left bottom width height] specifying the position of the scope window. (0,0) is the lower-left corner of the display. Tunable.
The parameters that are available on the Axis Properties pane depend on the setting of the Input domain parameter on the Scope Properties pane. When Time is selected for the Input domain parameter, the following parameters are available on the Axis Properties pane:

Select Auto to have the limits of the x-axis set for you automatically, or User-defined to set the limits yourself in the Minimum X-limit and Maximum X-limit parameters.
Specify the minimum value of the x-axis. Setting this parameter is analogous to setting the xmin value of the MATLAB axis function. This parameter is only visible if the Time display limits parameter is set to User-defined. Tunable.
Specify the maximum value of the x-axis. Setting this parameter is analogous to setting the xmax value of the MATLAB axis function. This parameter is only visible if the Time display limits parameter is set to User-defined. Tunable.
Specify the minimum value of the y-axis. Setting this parameter is analogous to setting the ymin value of the MATLAB axis function. Tunable.
Specify the maximum value of the y-axis. Setting this parameter is analogous to setting the ymax value of the MATLAB axis function.Tunable.
Specify text to be displayed to the left of the y-axis. Tunable.
When Frequency is selected for the Input domain parameter, the following parameters are available on the Axis Properties pane:

Choose the frequency units for the x-axis, Hertz or rad/sec. Tunable.
Specify the frequency range over which to plot the data. Tunable.
If you select this check box, the block computes the time-domain sample period from the frame period and frame size of the frequency-domain input. Use this parameter only when the length of the each frame of frequency-domain data is the same as the length of the frame of time-domain data from which it was generated. Tunable.
Enter the sample period, Ts, of the original time-domain signal. This parameter is only visible when the Inherit sample time from input check box is not selected. Tunable.
Select Auto to have the limits of the x-axis set for you automatically, or User-defined to set the limits yourself in the Minimum X-limit and Maximum X-limit parameters.
Specify the minimum value of the x-axis. Setting this parameter is analogous to setting the xmin value of the MATLAB axis function. This parameter is only visible if the Frequency display limits parameter is set to User-defined. Tunable.
Specify the maximum value of the x-axis. Setting this parameter is analogous to setting the xmax value of the MATLAB axis function. This parameter is only visible if the Frequency display limits parameter is set to User-defined. Tunable.
Choose the scaling for the y-axis, dB or Magnitude. Tunable.
Specify the minimum value of the y-axis. Setting this parameter is analogous to setting the ymin value of the MATLAB axis function. Tunable.
Specify the maximum value of the y-axis. Setting this parameter is analogous to setting the ymax value of the MATLAB axis function.Tunable.
Specify text to be displayed to the left of the y-axis. Tunable.
When User-defined is selected for the Input domain parameter, the following parameters are available on the Axis Properties pane:

When you select this check box, the block scales the horizontal axis by computing the horizontal interval between samples in the input frame from the frame period of the input. Use this parameter only when the input's sample period is equal to the period with which the physical signal was originally sampled. Tunable.
Specify an offset for the x-axis display. This parameter is only visible when the Inherit sample increment from input check box is not selected. Tunable.
Enter the numerical interval between adjacent x-axis points corresponding to the user-defined input data. This parameter is only visible when the Inherit sample increment from input check box is not selected. Tunable.
Enter the text to be displayed below the x-axis. Tunable.
Select Auto to have the limits of the x-axis set for you automatically, or User-defined to set the limits yourself in the Minimum X-limit and Maximum X-limit parameters.
Specify the minimum value of the x-axis. Setting this parameter is analogous to setting the xmin value of the MATLAB axis function. This parameter is only visible if the X display limits parameter is set to User-defined. Tunable.
Specify the maximum value of the x-axis. Setting this parameter is analogous to setting the xmax value of the MATLAB axis function. This parameter is only visible if the X display limits parameter is set to User-defined. Tunable.
Specify the minimum value of the y-axis. Setting this parameter is analogous to setting the ymin value of the MATLAB axis function. Tunable.
Specify the maximum value of the y-axis. Setting this parameter is analogous to setting the ymax value of the MATLAB axis function.Tunable.
Specify text to be displayed to the left of the y-axis. Tunable.

Enter on or off to specify the visibility of the various channels' scope traces. Separate your choices for each channel with by a pipe (|) symbol. Tunable.
Enter the line styles of the various channels' scope traces. Separate your choices for each channel with by a pipe (|) symbol. Tunable.
Enter the line markers of the various channels' scope traces. Separate your choices for each channel with by a pipe (|) symbol. Tunable.
Enter the colors of the various channels' scope traces using the ColorSpec formats. Separate your choices for each channel with by a pipe (|) symbol. Tunable.
| Port | Supported Data Types |
|---|---|
Input |
|
| Matrix Viewer | Signal Processing Blockset |
| Spectrum Scope | Signal Processing Blockset |
![]() | Vector Quantizer Encoder | Waterfall | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |