Some linear modulator blocks provide the capability to visualize a signal constellation right from the block mask. This Constellation Visualization feature allows you to visualize a signal constellation for specific block parameters. The following blocks support constellation visualization:
Note: To display Fixed-Point settings, you need a Fixed-Point Designer™ user license.
Clicking View Constellation on a linear modulator block mask, plots the signal constellation using the block's mask parameters. If you set a modulator block to output single or fixed-point data types, clicking View Constellation generates two signal constellations plots overlaid on each other.
One plot provides a reference constellation using double precision data type
The other plot provides data whose data type selection is defined in the block mask
The title of the plot indicates the values of significant parameters.
You can use the full array of MATLAB plot tools to manipulate plot
Inherit via back propagation for
the Output Data Type generates a constellation
double as the Output
In this tutorial, you will make changes to the modulator block. Without actually applying the changes to the model, you will observe how these changes effect the signal constellation.
visualization tutorial model by typing
the MATLAB command line.
Double-click the Rectangular QAM Modulator Baseband block.
Next, click View Constellation
The constellation plot shows that the constellation:
Uses a 16-QAM modulation scheme
Uses Binary constellation mapping
Has 0 degree phase offset
Has a minimum distance between two constellation points of 2
The constellation plot also shows that the signal has a double precision data type. Because the Input type is integer, the constellation has integer symbol mapping.
From the block mask, select
the Input type parameter.
Gray for the Constellation
Click View Constellation, and observe the results. Even though you did not click Apply, making these changes part of the model, the constellation plot still updates. The plot indicates gray constellation ordering using a bit representation of symbols.
You can overlay and compare the effect that two different
data type selections have on a signal constellation. For example,
you can compare the effect of changing Output data type from
the signal constellation.
To compare settings, perform the following tasks:
Click the Data Types tab.
Set the Output data type parameter
Set the Output word length parameter
Set the Set Output fraction length to parameter
Click Main tab, and then click View Constellation.
The plot overlays the fixed-point constellation on top of the double-precision constellation.
You can specify a block parameter value using variables
defined in the MATLAB workspace. To define a variable, type
the MATLAB workspace.
Note: The model workspace in Simulink® has priority over the base workspace in MATLAB®.
In the block mask, click the Main tab,
and then type
M for the M-ary number parameter.
This parameter allows the block to use the variable value you defined
in MATLAB workspace.
Click the Data Types tab and then
double for the Output
data type parameter.
Click the Main tab. Then, click the View Constellation button and observe the results.
You can also use the Constellation Visualization feature
while a simulation is running. Type
the MATLAB workspace, select
the Input type and click Apply.
Simulate the model by clicking Run in the Simulink model window.
While the simulation is running, click View Constellation. Compare the signal constellation to the scatter plot generated in the previous step.
End the simulation by clicking the Stop button in the Simulink model window.
The Constellation Visualization feature provides full access to the MATLAB plotting capabilities, including: capturing a figure, saving a figure in multiple file formats, changing display settings, or saving files for archiving purposes. To capture a figure, select Edit > Copy Figure.
Using this tutorial, you have generated numerous constellation plots. If you close the Simulink model or delete the modulator block from the model, all the plots will close.
Tip: If you capture a figure you want to archive for future use, save the figure before closing the model.
Close the Simulink model, and observe that all of the constellation figures also close.