# constellation

Calculate or plot ideal signal constellation

## Syntax

``symbols = constellation(obj)``
``constellation(obj)``

## Description

example

````symbols = constellation(obj)` returns the numerical values of the constellation.```
````constellation(obj)` generates a constellation plot for the object.```

## Examples

collapse all

Create a QPSK modulator.

`mod = comm.QPSKModulator;`

Determine the reference constellation points.

`refC = constellation(mod)`
```refC = 4×1 complex 0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i ```

Plot the constellation.

`constellation(mod)` Reconfigure the object for bit input and plot the constellation to show the binary values of the Gray-encoded mapping.

```release(mod) mod.BitInput = true; constellation(mod)``` Create a QPSK demodulator having phase offset set to `0`.

`demod = comm.QPSKDemodulator(0);`

Plot the reference constellation. The `constellation` method works for both modulator and demodulator objects.

`constellation(demod)` Create a PSK modulator.

`mod = comm.PSKModulator;`

Determine the reference constellation points.

`refC = constellation(mod)`
```refC = 8×1 complex 0.9239 + 0.3827i 0.3827 + 0.9239i -0.3827 + 0.9239i -0.9239 + 0.3827i -0.9239 - 0.3827i -0.3827 - 0.9239i 0.3827 - 0.9239i 0.9239 - 0.3827i ```

Plot the constellation.

`constellation(mod)` Create a PSK demodulator having modulation order 16.

`demod = comm.PSKDemodulator(16);`

Plot its reference constellation. The `constellation` method works for both modulator and demodulator objects.

`constellation(demod)` Create a BPSK modulator.

`mod = comm.BPSKModulator;`

Determine the reference constellation points.

`refC = constellation(mod)`
```refC = 2×1 complex 1.0000 + 0.0000i -1.0000 + 0.0000i ```

Plot the constellation.

`constellation(mod)` Create a BPSK demodulator having phase offset set to $\frac{\pi }{2}$.

`demod = comm.BPSKDemodulator(pi/2);`

Determine the reference constellation points.

`refC = constellation(demod)`
```refC = 2×1 complex 0.0000 + 1.0000i -0.0000 - 1.0000i ```

Plot the reference constellation. The `constellation` method works for both modulator and demodulator objects.

`constellation(demod)` ## Input Arguments

collapse all

System object to return constellation for, specified as a modulator System object.

Data Types: `object`

## Output Arguments

collapse all

Constellation points, returned as a complex vector.

Data Types: `double` | `single`
Complex Number Support: Yes

## Version History

Introduced in R2012a