| Communications Blockset™ | ![]() |
| On this page… |
|---|
Communications Blockset provides sinks and display devices that facilitate analysis of communication system performance. You can open the Comm Sinks library by double-clicking its icon in the main Communications Blockset library.
The Error Rate Calculation block compares input data from a transmitter with input data from a receiver. It calculates these error statistics:
Error rate
Number of error events
Total number of input events
The block reports these statistics either as final values in the workspace or as running statistics at an output port.
You can use this block either with binary inputs to compute the bit error rate, or with symbol inputs to compute the symbol error rate. You can use frame-based or sample-based data. If you use frame-based data, you can have the block consider certain samples and ignore others.
The example in the section Example: Soft-Decision Decoding illustrates the use of the Error Rate Calculation block.
The Sinks library contains scopes for viewing three types of signal plots:
The following table lists the scope blocks and the plots they generate.
| Block Name | Plots |
|---|---|
| Discrete-Time Eye Diagram Scope | Eye diagram of a discrete signal |
| Discrete-Time Scatter Plot Scope | Scatter plot of a discrete signal |
| Discrete-Time Signal Trajectory Scope | Signal trajectory of a discrete signal |
An eye diagram is a simple and convenient tool for studying the effects of intersymbol interference and other channel impairments in digital transmission. When this blockset constructs an eye diagram, it plots the received signal against time on a fixed-interval axis. At the end of the fixed interval, it wraps around to the beginning of the time axis. As a result, the diagram consists of many overlapping curves. One way to use an eye diagram is to look for the place where the "eye" is most widely opened, and use that point as the decision point when demapping a demodulated signal to recover a digital message.
The Discrete-Time Eye Diagram Scope block produces eye diagrams. This block processes discrete-time signals. and periodically draws a line to indicate a decision, according to a mask parameter.
Examples appear in Example: Viewing a Sinusoid and Example: Viewing a Modulated Signal.
A scatter plot of a signal plots the signal's value at its decision points. In the best case, the decision points should be at times when the eye of the signal's eye diagram is the most widely open.
The Discrete-Time Scatter Plot Scope block produces scatter plots from discrete-time signals. An example appears in Example: Viewing a Sinusoid.
A signal trajectory is a continuous plot of a signal over time. A signal trajectory differs from a scatter plot in that the latter displays points on the signal trajectory at discrete intervals of time.
The Discrete-Time Signal Trajectory Scope block produces signal trajectories. Unlike the Discrete-Time Scatter Plot Scope block, which displays points on the trajectory at discrete time intervals corresponding to the decision points, the Discrete-Time Signal Trajectory Scope displays a continuous picture of the signal's trajectory between decision points.
The following model produces a scatter plot and an eye diagram from a complex sinusoidal signal. Because the decision time interval is almost, but not exactly, an integer multiple of the period of the sinusoid, the eye diagram exhibits drift over time. More specifically, successive traces in the eye diagram and successive points in the scatter diagram are near each other but do not overlap.

To open the completed model, click here in the MATLAB Help browser. To build the model, gather and configure these blocks:
Sine Wave, in the Signal Processing Sources library (not the Sine Wave block in the Simulink Sources library)
Set Frequency to .502.
Set Output complexity to Complex.
Set Sample time to 1/16.
Discrete-Time Scatter Plot Scope, in the Comm Sinks library
On the Plotting Properties panel, set Samples per symbol to 16.
On the Figure Properties panel, set Scope position to figposition([2.5 55 35 35]);.
Discrete-Time Eye Diagram Scope, in the Comm Sinks library
On the Plotting Properties panel, set Samples per symbol to 16.
On the Figure Properties panel, set Scope position to figposition([42.5 55 35 35]);.
Connect the blocks as shown in the preceding figure. From the model window's Simulation menu, choose Configuration parameters; in the Configuration Parameters dialog box, set Stop time to 250. Running the model produces the following scatter diagram plot.

The points of the scatter plot lie on a circle of radius 1. Note that the points fade as time passes. This is because the box next to Color fading is checked under Rendering Properties, which causes the scope to render points more dimly the more time that passes after they are plotted. If you clear this box, you see a full circle of points.
If you add the Discrete-Time Signal Trajectory Scope block to the model, it displays a circular trajectory.
In the eye diagram, the upper set of traces represents the real part of the signal and the lower set of traces represents the imaginary part of the signal.

This multipart example creates an eye diagram, scatter plot, and signal trajector plot for a modulated signal. It examines the plots one by one in these sections:
The following model modulates a random signal using QPSK, filters the signal with a raised cosine filter, and creates an eye diagram from the filtered signal.

To open the completed model, click here in the MATLAB Help browser. To build the model, gather and configure the following blocks:
Random Integer Generator, in the Random Data Sources sublibrary of the Comm Sources library
Set M-ary number to 4.
Set Sample time to to 0.01.
QPSK Modulator Baseband, in PM in the Digital Baseband sublibrary of the Modulation library of Communications Blockset, with default parameters
AWGN Channel, in the Channels library of Communications Blockset, with the following changes to the default parameter settings:
Set Mode to Signal-to-noise ratio (SNR).
Set SNR (dB) to 15.
Raised Cosine Transmit Filter, in the Comm Filters library
Set Filter type to Normal.
Set Group delay to 3.
Set Rolloff factor to 0.5.
Set Input sampling mode to Sample-based.
Set Upsampling factor to 8.
Discrete-Time Eye Diagram Scope, in the Comms Sinks library
Set Samples per symbol to 8.
Set Symbols per trace to 3. This specifies the number of symbols that are displayed in each trace of the eye diagram. A trace is any one of the individual lines in the eye diagram.
Set Traces displayed to 3.
Set New traces per display to 1. This specifies the number of new traces that appear each time the diagram is refreshed. The number of traces that remain in the diagram from one refresh to the next is Traces displayed minus New traces per display.
On the Rendering Properties panel, set Markers to + to indicate the points plotted at each sample. The default value of Markers is empty, which indicates no marker.
On the Figure Properties panel, set Eye diagram to display to In-phase only.
When you run the model, the Discrete-Time Eye Diagram Scope displays the following diagram. Your exact image varies depending on when you pause or stop the simulation.

Three traces are displayed. Traces 2 and 3 are faded because the Color fading check box under Rendering Properties is selected. This causes traces to be displayed less brightly the older they are. In this picture, Trace 1 is the most recent and Trace 3 is the oldest. Because New traces per display is set to 1, only Trace 1 is appearing for the first time. Traces 2 and 3 also appear in the previous display.
Because Symbols per trace is set to 3, each trace contains three symbols, and because Samples per trace is set to 8, each symbol contains eight samples. Note that trace 1 contains 24 points, which is the product of Symbols per trace and Samples per symbol. However, traces 2 and 3 contain 25 points each. The last point in trace 2, at the right border of the scope, represents the same sample as the first point in trace 1, at the left border of the scope. Similarly, the last point in trace 3 represents the same sample as the first point in trace 2. These duplicate points indicate where the traces would meet if they were displayed side by side, as illustrated in the following picture.

You can view a more realistic eye diagram by changing the value of Traces displayed to 40 and clearing the Markers field.

When the Offset parameter is set to 0, the plotting starts at the center of the first symbol, so that the open part of the eye diagram is in the middle of the plot for most points.
The following model creates a scatter plot of the same signal considered in Eye Diagram of a Modulated Signal.

To build the model, follow the instructions in Eye Diagram of a Modulated Signal but replace the Discrete-Time Eye Diagram block with the following block:
Discrete-Time Scatter Plot Scope, in the Comms Sinks library
Set Samples per symbol to 2.
Set Offset to 0. This specifies the number of samples to skip before plotting the first point.
Set Points displayed to 40.
Set New points per display to 10. This specifies the number of new points that appear each time the diagram is refreshed. The number of points that remain in the diagram from one refresh to the next is Points displayed minus New points per display.
When you run the simulation, the Discrete-Time Scatter Plot Scope block displays the following plot.

The plot displays 30 points. Because the Color fading check box under Rendering Properties is selected, points are displayed less brightly the older they are.
The following model creates a signal trajectory plot of the same signal considered in Eye Diagram of a Modulated Signal.

To build the model, follow the instructions in Eye Diagram of a Modulated Signal but replace the Discrete-Time Eye Diagram block with the following block:
Discrete-Time Signal Trajectory Scope, in the Comms Sinks library
Set Samples per symbol to 8.
Set Symbols displayed to 40. This specifies the number of symbols displayed in the signal trajectory. The total number of points displayed is the product of Samples per symbol and Symbols displayed.
Set New symbols per display to 10. This specifies the number of new symbols that appear each time the diagram is refreshed. The number of symbols that remain in the diagram from one refresh to the next is Symbols displayed minus New symbols per display.
When you run the model, the Discrete-Time Signal Trajectory Scope displays a trajectory like the one below.

The plot displays 40 symbols. Because the Color fading check box under Rendering Properties is selected, symbols are displayed less brightly the older they are.
See Scatter Plot of a Modulated Signal to compare the preceding signal trajectory to the scatter plot of the same signal. The Discrete-Time Signal Trajectory Scope block connects the points displayed by the Discrete-Time Scatter Plot Scope block to display the signal trajectory.
If you increase Symbols displayed to 100, the model produces a signal trajectory like the one below. The total number of points displayed at any instant is 800, which is the product of the parameters Samples per symbol and Symbols displayed.

![]() | Communications Sources | Source Coding | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |