Quadrature amplitude modulation


y = qammod(x,M)
y = qammod(x,M,ini_phase)
y = qammod(x,M,ini_phase,symbol_order)


y = qammod(x,M) outputs the complex envelope y of the modulation of the message signal x using quadrature amplitude modulation. M is the alphabet size and must be an integer power of 2. The message signal must consist of integers between 0 and M-1. The signal constellation is rectangular or cross-shaped, and the nearest pair of points in the constellation is separated by 2. If x is a matrix with multiple rows, the function processes the columns independently.

y = qammod(x,M,ini_phase) specifies the initial phase of the modulated signal in radians.

y = qammod(x,M,ini_phase,symbol_order) specifies how the function assigns binary words to corresponding integers. If symbol_order is set to 'bin' (default), the function uses a natural binary-coded ordering. If symbol_order is set to 'gray', it uses a Gray constellation ordering.


collapse all

Modulate Data using QAM

Modulate data using QAM and display the result in a scatter plot.

Set the modulation order to 16 and create a data vector containing each of the possible symbols.

M = 16;
x = (0:M-1)';

QAM modulate the data using the qammod function.

y = qammod(x,M);

Display the modulated signal constellation using the scatterplot function.


Modulate the data with an initial phase of $\pi$/4 and display its scatter plot. The constellation is shifted by 45 degrees.

y = qammod(x,M,pi/4);

Set the modulation order to 256 and display the scatter plot of the modulated signal.

M = 256;
x = (0:M-1)';
y = qammod(x,M);

Normalize QAM Signal by Average and Peak Power

QAM modulate random data symbols and normalize the modulator output by the average and peak power.

Set the modulation order and generate random data.

M = 64;
x = randi([0 M-1],1000,1);

Modulate the data.

y = qammod(x,M);

Determine the average and peak power for the modulated signal.

meanPower = mean(abs(y).^2);
peakPower = max(abs(y).^2);

Normalize the modulated signal, y, and plot the resulting constellations.

yAvg = y/sqrt(meanPower);
yPeak = y/sqrt(peakPower);

title('64-QAM, Average Power = 1 W')

title('64-QAM, Peak Power = 1 W')

Introduced before R2006a

Was this topic helpful?