# constellation

System object: comm.RectangularQAMDemodulator
Package: comm

(To be removed) Calculate or plot ideal signal constellation

`comm.RectangularQAMDemodulator` will be removed in a future release. Use `qamdemod` instead.

## Syntax

```y = constellation(h) constellation(h) ```

## Description

`y = constellation(h)` returns the numerical values of the constellation.

`constellation(h)` generates a constellation plot for the object.

## Examples

expand all

Plot QAM reference constellation using the `qammod` and `qamdemod` functions. Show that the `'PlotConstellation,true'` Name,Value pair property works for both `qammod` and `qamdemod` functions. Also show the symbol ordering for Gray and binary code ordering by representing the data in binary format.

Create symbols for a 16-QAM modulator.

```M = 16; % For 16-QAM refSym = (0:M-1)';```

Plot the reference constellation using the `qammod` function.

`qammod(refSym,M,'PlotConstellation',true);`

The default symbol order is Gray code ordering. To highlight the Gray symbol mapping, replot the reference constellation using binary input type. When you specify `'InputType','bit'`, the input signal must contain binary values, and the number of rows must be an integer multiple of `log2(M)`. Tranpose the input vector so that the input symbols map to the column vectors.

```biRefSym = de2bi(refSym); qammod(biRefSym',M,'PlotConstellation',true,'InputType','bit');```

Replot the reference constellation using binary-coded symbol ordering.

```biRefSym = de2bi(refSym); qammod(biRefSym',M,'bin','PlotConstellation',true,'InputType','bit');```

Create symbols for a 64-QAM modulator.

```M = 64; % For 64-QAM refSym = (0:M-1);```

Plot the reference constellation using the `qamdemod` function.

`qamdemod(refSym,M,'PlotConstellation',true);`

Download ebook