| Communications Toolbox | ![]() |
The code below is similar to the example from the section Example: Eye Diagrams. It produces a scatter plot from the received analog signal, instead of an eye diagram.
% Define the M-ary number and sampling rates. M = 16; Fd = 1; Fs = 10; N = Fs/Fd; Pd = 200; % Number of points in the calculation msg_d = randint(Pd,1,M); % Random integers in the range [0,M-1] % Modulate using square QAM. msg_a = qammod(msg_d,M); % Upsample the modulated signal. msg_a = rectpulse(msg_a,N); % Assume the channel is equivalent to a raised cosine filter. rcv = rcosflt(msg_a,Fd,Fs); % Create the scatter plot of the received signal, % ignoring the first three and the last four symbols. rcv_a = rcv(3*N+1:end-4*N,:); h = scatterplot(rcv_a,N,0,'bx');
Varying the third parameter in the scatterplot command changes the offset. An offset of zero yields optimal results, shown below.

The image below illustrates two offsets that are not optimal. The x's and +'s reflect offsets that are too late and too early, respectively. Notice that in the diagram, the dots are the actual constellation points, while the other symbols are perturbations of those points.
hold on; scatterplot(rcv_a,N,N+1,'r+',h); % Plot +'s scatterplot(rcv_a,N,N-1,'mx',h); % Plot x's scatterplot(rcv_a,N,0,'b.',h); % Plot dots

| Scatter Plots | Selected Bibliography for Performance Evaluation | ![]() |
© 1994-2005 The MathWorks, Inc.