Main Content

Amplitude Modulation Examples

These examples demonstrate amplitude modulation (AM) techniques.

QAM Constellation Shape Dependency on Modulation Orders

Plot various M-QAM constellations to demonstrate the shape depends on the modulation order.

Define a vector of vlaues for modulation order, M, from the number of bits/symbol, k.

k = 1:7;  % Number of bits per symbol
M = 2.^k; % Modulation order

Use a for loop to create a data sequence that includes a complete set of symbols for the modulation scheme, modulate the data, and plot the constellation for each modulation order in the range of values in vector k. Note the constellation shape for depends on the number of bits per symbol, k.

  • For even values of k, the constellation is a square.

  • For odd values of k>3, the constellation is a cross.

  • For k=1 and k=3, the constellation is a rectangle.

for ii = 1:length(M)
    disp(['k = ',num2str(k(ii))])
    d = 0:M(ii)-1;
    y = qammod(d,M(ii),PlotConstellation=true);
    
end
k = 1

Figure contains an axes object. The axes object with title 2-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 5 objects of type line, text. One or more of the lines displays its values using only markers

k = 2

Figure contains an axes object. The axes object with title 4-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 7 objects of type line, text. One or more of the lines displays its values using only markers

k = 3

Figure contains an axes object. The axes object with title 8-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 11 objects of type line, text. One or more of the lines displays its values using only markers

k = 4

Figure contains an axes object. The axes object with title 16-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 19 objects of type line, text. One or more of the lines displays its values using only markers

k = 5

Figure contains an axes object. The axes object with title 32-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 35 objects of type line, text. One or more of the lines displays its values using only markers

k = 6

Figure contains an axes object. The axes object with title 64-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 67 objects of type line, text. One or more of the lines displays its values using only markers

k = 7

Figure contains an axes object. The axes object with title 128-QAM, Gray Mapping, UnitAveragePower=false, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 131 objects of type line, text. One or more of the lines displays its values using only markers

Compute Symbol Error Rate

In this example, you generate a random digital signal, modulate it, add noise, demodulate the noisy signal, and compute the symbol error rate. Then you plot the noisy, modulated data in a constellation diagram. The numerical results and plot may vary due to the random input data.

Create a random digital message and a constellation diagram System object™.

M = 16; % Alphabet size, 16-QAM
x = randi([0 M-1],5000,1);

cdpts = qammod(0:M-1,M);
constDiag = comm.ConstellationDiagram( ...
    ReferenceConstellation=cdpts, ...
    AxesLimits=[-4 4]);

Apply 16-QAM modulation and transmit the signal through an AWGN channel.

y = qammod(x,M);
ynoisy = awgn(y,15,'measured');

Demodulate the noisy data, ynoisy, to recover the message and check the symbol error rate.

z = qamdemod(ynoisy,M);
[num,errrate] = symerr(x,z)
num = 
73
errrate = 
0.0146

Plot the noisy data in a constellation diagram. The signal reference constellation has 16 precisely located points, but the noise added to the transmitted signal causes the scatter plot to have a small cluster of points scattered around each reference constellation point.

constDiag(ynoisy)

See Also

Functions

Objects

Blocks

Topics