Documentation

# comm.QPSKModulator

Modulate using QPSK method

## Description

The `QPSKModulator` object modulates using the quadrature phase shift keying method. The output is a baseband representation of the modulated signal.

To modulate a signal using quadrature phase shift keying:

1. Define and set up your QPSK modulator object. See Construction.

2. Call `step` to modulate the signal according to the properties of `comm.QPSKModulator`. The behavior of `step` is specific to each object in the toolbox.

### Note

Starting in R2016b, instead of using the `step` method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, ```y = step(obj,x)``` and `y = obj(x)` perform equivalent operations.

## Construction

`H = comm.QPSKModulator` creates a modulator System object, `H`. This object modulates the input signal using the quadrature phase shift keying (QPSK) method.

`H = comm.QPSKModulator(Name,Value)` creates a QPSK modulator object, `H`, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (`Name1`,`Value1`,...,`NameN`,`ValueN`).

`H = comm.QPSKModulator(PHASE,Name,Value)` creates a QPSK modulator object, `H`. This object has the `PhaseOffset` property set to `PHASE` and the other specified properties set to the specified values.

## Properties

 `PhaseOffset` Phase of zeroth point in constellation Specify the phase offset of the zeroth point in the constellation, in radians, as a real scalar value. The default is pi/4. `BitInput` Assume bit inputs Specify whether the input is bits or integers. The default is `false`. When you set this property to `true`, the `step` method input must be a column vector of bit values. This vector must have a length that is an integer multiple of `2`. This vector contains bit representations of integers between `0` and `3`. When you set this property to `false`, the step method input must be a column vector of integer symbol values between 0 and 3. `SymbolMapping` Constellation encoding Specify how the object maps an integer or a group of two input bits to the corresponding symbol as one of `Binary` | `Gray`. The default is `Gray`. When you set this property to `Gray`, the object uses a Gray-encoded signal constellation. When you set this property to `Binary`, the input integer m, between $0\le m\le 3$, maps to the complex value exp(j$×$`PhaseOffset` + j$×$2$×$$\pi ×m}{4}$). `OutputDataType` Data type of output Specify the output data type as one of `double` | `single` | `Custom`. The default is `double`.

## Methods

 constellation Calculate or plot ideal signal constellation step Modulate using QPSK method
Common to All System Objects
`release`

Allow System object property value changes

## Examples

expand 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)`

Create a PSK demodulator having 0 phase offset.

`demod = comm.QPSKDemodulator('PhaseOffset',0);`

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

`constellation(demod)`

Create a QPSK modulator object and a phase noise object.

```qpskModulator = comm.QPSKModulator; phNoise = comm.PhaseNoise('Level',-55,'FrequencyOffset',20,'SampleRate',1000); ```

Generate random QPSK data. Pass the signal through the phase noise object.

```d = randi([0 3],1000,1); x = qpskModulator(d); y = phNoise(x); ```

Display the constellation diagram of the QPSK signal. The phase noise has introduced a rotational distortion on the constellation diagram.

```constDiagram = comm.ConstellationDiagram; constDiagram(y) ```

## Algorithms

This object implements the algorithm, inputs, and outputs described on the QPSK Modulator Baseband block reference page. The object properties correspond to the block parameters.