A scatter plot or constellation diagram is used to visualize the constellation of a digitally modulated signal.
To produce a scatter plot from a signal, use the
scatterplot function or use the
System object. A scatter
plot or constellation diagram can be useful when comparing system
performance to a published standard, such as 3GPP or DVB.
You create the
in two ways: using a default object or by defining name-value pairs.
For more information, see the
This example shows how to use constellation diagrams to view QPSK transmitted and received signals which are pulse shaped with a raised cosine filter.
Create a QPSK modulator.
hMod = comm.QPSKModulator;
Create a raised cosine transmit filter with an upsample rate of 16.
Rup = 16; % upsampling rate hRCTxFilter = comm.RaisedCosineTransmitFilter(... 'Shape','Normal', ... 'RolloffFactor',0.5, ... 'FilterSpanInSymbols',Rup, ... 'OutputSamplesPerSymbol',Rup);
Generate data symbols and apply QPSK modulation.
data = randi([0 3],100,1); modData = step(hMod,data);
Create a constellation diagram and set the
SamplesPerSymbol property to the upsampling rate of the signal.
hScope = comm.ConstellationDiagram('SamplesPerSymbol',Rup);
Pass the modulated data through the raised cosine transmit filter.
txSig = step(hRCTxFilter,modData);
Display the constellation diagram of the transmitted signal.
One way to create a better match between the two signals is to normalize the filter. Determine the required gain for the filter.
gain = 1/max(hRCTxFilter.coeffs.Numerator);
Apply a normalized filter the modulated signal.
txSig = gain*step(hRCTxFilter,modData);
Release the constellation diagram,
hScope. This is necessary because the input signal has been changed. Display the constellation diagram of the normalized signal. Observe that the data points and reference constellation overlay one another.
To view the transmitted signal more clearly, turn off the reference constellation by setting the
ShowReferenceConstellation property to
hScope.ShowReferenceConstellation = false; step(hScope,txSig)
Create a noisy signal by Passing
txSig through an AWGN channel.
rcv = awgn(txSig,20,'measured');
Turn on the reference constellation and display the received signal's constellation diagram.
release(hScope) hScope.ShowReferenceConstellation = true; step(hScope,rcv)
This example simulates RF impairments for a signal that was
modulated using differential quaternary phase shift keying (DQPSK). Open the example modelOpen the example model by
doc_receiverimpairments_dqpsk at the MATLAB® command
The model does the following:
Modulates a random signal using DQPSK modulation.
Applies impairments to the signal using the blocks from the RF Impairments library.
Forks the signal into two paths, and processes one path with an automatic gain control (AGC) to compensate for the free space path loss and the I/Q imbalance.
Displays the trajectory of the signal with AGC and the trajectory of the signal without AGC.
Demodulates both signals and calculates their error rates.
You can see the effect of the automatic gain by comparing the trajectories of the signals with and without AGC, as shown in the following figure.
Signal With (Left) and Without (Right) AGC
The trajectory of the signal with AGC more closely matches the undistorted trajectory for DQPSK, shown in the following figure, than does than the signal without AGC. Consequently, the error rate for the signal with AGC is much lower than the error rate for the signal without AGC.
In this example, the error rate for the demodulated signal without AGC is primarily caused by free space path loss and I/Q imbalance. The QPSK modulation minimizes the effects of the other impairments.