|On this page…|
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:
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 figures. Selecting Inherit via back propagation for the Output Data Type generates a constellation plot with double as the Output data type.
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.
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 Bit for the Input type parameter.
Select Gray for the Constellation ordering parameter.
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 double to Fixed-point on the signal constellation.
To compare settings, perform the following tasks:
Click the Data Types tab.
Set the Output data type parameter to Fixed-point.
Set the Output word length parameter to 16.
Set the Set Output fraction length to parameter to Best precision.
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 M=32 in the MATLAB workspace.
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 select 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 M=16 in the MATLAB workspace, select Integer for 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.
Close the Simulink model, and observe that all of the constellation figures also close.