I want to plot the constellation diagram of 64-QAM for a complex signal, x = cos(2*pi*n/N) + 1i*sin(2*pi*n/N) where n=1:1:N; N=1024; % N is total number of samples

But it gives a circular scattered output when doing scatterplot(x). In the MATLAB documentation for ConstellationDiagram and others, integer or binary data is input, and then qammod(data,M) is found. Also doing genqammod(data,x) gives circular scatterplot.

What if I want to give complex data? Is there any way to get a 64-QAM constellation of this complex data?

P.S: I'm a beginner in DSP

  • $\begingroup$ the x you wrote down is not QAM – it's just samples of a complex sinusoid. So, can you explain where you think the QAM is coming into play here? $\endgroup$ Jan 14, 2023 at 16:08

2 Answers 2


Here is a simpler example of a 16QAM waveform, which will hopefully clear up the confusion.

The following is a map of 4 bit binary words (as 0 to 15) to a complex symbol on the 16QAM constellation. The mapping (Gray Code) is done to minimize the number of bit changes for symbol locations that are closer:

qam16 = {
    0: -3-3j,
    1: -1-3j,
    3: 1-3j,
    2: 3-3j,
    4: -3-1j,
    5: -1-1j,
    7: 1-1j,
    6: 3-1j,
    12: -3+1j,
    13: -1+1j,
    15: 1+1j,
    14: 3+1j,
    8: -3+3j,
    9: -1+3j,
    11: 1+3j,
    10: 3+3j

So for 16QAM we have one of 16 possible choices each time we want to transmit a symbol in symbol duration $T$, and thus we can send 4 bits of information in every time interval $T$. The plot of the choice of symbols is given below together with its binary representation:

QAM 16 Constellation

How a modulated signal is typically constructed from this, is the data is mapped to a symbol (such as in the plot I showed), and then from that a time sequence of symbols is created based on the data pattern we wish to transmit. This complex stream is then interpolated to allow for pulse shaping, where we transition from one symbol to the next gradually instead of abruptly, which serves to restrict the amount of bandwidth needed to transmit the signal. Once pulse shaped, this complex waveform can be upconverted to a carrier (either intermediate-frequency IF or the final radio-frequency RF carrier) with appropriate gain and filtering as part of the radio transmitter.

The upper part of the graphic below shows the pulse-shaping for the real portion of the QAM waveform, the imaginary portion would be similarly pulse-shaped for the full complex baseband waveform (given 4 levels on real and 4 level on imaginary).

pulse shaping

If we properly sample the modulated waveform in the receiver (timing recovery), and assuming we removed any carrier offsets (carrier recovery) and properly adjusted the gain (AGC), we can get the samples that are just at the correct constellation locations (which would appear like our constellation prior to pulse shaping) and thereby recover the original data stream.


1.- ONE real signal generates I + 1j*Q this is ; ONE In-phase channel and ONE Quadrature channel that in turn generate ONE constellation, the typical square QAM signals show with scatterplot.

So the quick answer is NO.

I and Q are conveniently coded with complex numbers, the symbols of 1 real signal, because 1j keeps both channels in quadrature, apart, unless operations like * take place.

2.- However, if you plug the real part of the input signal channel of your input signal to the I port of your modulator, and the complex part of the signal to the Q port, then the answer is YES

Provided your modulator has I Q inputs.

This way you are simplifying your design because 2 signals would generate 2xI and 2xQ but there's not need to modulate and plug so much data onto antenna.

You need a modulator with I Q input ports, then you can certainly send a 2-channel signal (the complex signal in the question is a good example) directly feeding the modulator through I Q ports.

3.- MATLAB command qammod does not have I Q ports but if you switch to SIMULINK you can build the above mentioned straight-to I and Q from a 2-channel input signal, with SIMULINK it's easy.

Any good real 3D signal generator has, or should have, I Q ports to precisely do what you asked.

Implementing this in plain MATLAB is also easy.

If you show the MATLAB code you have started with, just attach your MATLAB code to your question, I can certainly help to complete it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.