| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Toolbox |
| Contents | Index |
| Learn more about Communications Toolbox |
| On this page… |
|---|
A scatter plot of a signal shows the signal's value at a given decision point. In the best case, the decision point should be at the time when the eye of the signal's eye diagram is the most widely open.
To produce a scatter plot from a signal, use commscope.ScatterPlot.
Scatter plots are often used to visualize the signal constellation associated with digital modulation. For more information, see Plotting Signal Constellations. A scatter plot can be useful when comparing system performance to a published standard, such as 3GPP or DVB standards.
The scatter plot feature is part of the commscope package. Users can create the scatter plot object in two ways: using a default object or by defining parameter-value pairs. For more information, see the commscope.ScatterPlot help page.
In this example, you will observe the received signals for a QPSK modulated system. The output symbols are pulse shaped, using a raised cosine filter.
Create a QPSK modulator object. Type the following at the MATLAB command line:
hMod = modem.pskmod('M', 4, 'PhaseOffset', pi/4);Create an upsampling filter, with an upsample rate of 16. Type the following at the MATLAB command line:
Rup = 16; % up sampling rate hFilDesign = fdesign.pulseshaping(Rup,'Raised Cosine', ... 'Nsym,Beta',Rup,0.50); hFil = design(hFilDesign);
Create the transmit signal. Type the following at the MATLAB command line:
d = randi([0 hMod.M-1], 100, 1); % Generate data symbols sym = modulate(hMod, d); % Generate modulated symbols xmt = filter(hFil, upsample(sym, Rup));
Create a scatter plot and set the samples per symbol to the upsampling rate of the signal. Type the following at the MATLAB command line:
hScope = commscope.ScatterPlot hScope.SamplesPerSymbol = Rup;
In this simulation, the absolute sampling rate or symbol rate is not specified. Use the default value for SamplingFrequency, which is 8000. This results in 2000 symbols per second symbol rate.
Set the constellation value of the scatter plot to the expected constellation. Type the following at the MATLAB command line:
hScope.Constellation = hMod.Constellation;
Since the pulse shaping filter introduces a delay, discard these transient values by setting MeasurementDelay to the group delay of the filter, which is four symbol durations or 4/Rs seconds. Type the following at the MATLAB command line:
groupDelay = (hFilDesign.NumberOfSymbols/2); hScope.MeasurementDelay = groupDelay /hScope.SymbolRate;
Update the scatter plot with transmitted signal by typing the following at the MATLAB command line:
update(hScope, xmt)

The Figure window updates, displaying the transmitted signal.
Display the ideal constellation and evaluate how closely it matches the transmitted signal. To display the ideal constellation, type the following at the MATLAB command line:
hScope.PlotSettings.Constellation = 'on';

The Figure window updates, displaying the ideal constellation and the transmitted signal.
One way to create a better match between the two signals is to normalize the filter. Normalize the filter by typing the following at the MATLAB command line:
hFil.Numerator = hFil.Numerator / max(hFil.Numerator);
Refilter the signal using a normalized filter.
xmt = filter(hFil, upsample(sym, Rup));
Reset the scope before displaying the transmitted signal. Resetting the scope also resets the counter for measurement delay, discarding the transient filter values. To reset the scope, type the following at the MATLAB command line:
reset(hScope)
Update the scatter plot so it displays the signal.
update(hScope, xmt)

The match between the ideal constellation points and the transmitted signal is nearly identical.
To view the transmitted signal more clearly, turn off the ideal constellation by clicking Constellation in the Figure window.

The Figure window updates, displaying only the transmitted signal.
View the signal trajectory. Type the following at the MATLAB command line:
hScope.PlotSettings.SignalTrajectory = 'on';

The Figure window updates, displaying the trajectory. An alternate way to display the signal trajectory is to click the Signal Trajectory.
Change the line style. Type the following at the MATLAB command line:
hScope.PlotSettings.SignalTrajectoryStyle = ':m';

The Figure window updates, changing the line style making up the signal trajectory.
Autoscale the scatter plot display to fit the entire plot. Type the following at the MATLAB command line:
autoscale(hScope)

The Figure window updates. An alternate way to autoscale the fit is to click the Autoscale Axes button.
Create a noisy signal by Passing xmt through an AWGN channel. Type the following at the MATLAB command line:
rcv = awgn(xmt, 20, 'measured'); % Add AWGN
Send the received signal to the scatter plot. Before sending the signal, reset the scatter plot to remove the old data. Type the following at the MATLAB command line:
reset(hScope) update(hScope, rcv)

The Figure window updates, displaying the noisy signal.
Turn off the signal trajectory by clicking Signal Trajectory in the Figure window.

The Figure window updates, displaying the signal plot without the signal trajectory. An alternate way to turn off the signal trajectory is typing the following at the MATLAB command line:
hScope.PlotSettings.SignalTrajectory = 'off';
View the constellation by clicking Constellation in the Figure window.

The Figure window updates, displaying both the ideal constellation and the transmitted signal. An alternate way to view the constellation is by typing the following at the MATLAB command line:
hScope.PlotSettings.Constellation = 'on';
Print the scatter plot by making the following selection in the Figure window: File > Print

When you print the scatter plot, you print the axes, not the entire GUI.
![]() | Eye Diagrams | Adjacent Channel Power Ratio (ACPR) Measurements | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |