Main Content

comm.QPSKModulator

Modulate using QPSK method

Description

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

To modulate using the QPSK method:

  1. Create the comm.QPSKModulator object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

example

qpskmod = comm.QPSKModulator creates a System object™ to modulate input signals using the QPSK method.

example

qpskmod = comm.QPSKModulator(Name,Value) sets properties using one or more name-value arguments. For example, 'OutputDataType'='single' specifies output of the modulated signal values in single precision data type.

qpskmod = comm.QPSKModulator(phase,Name,Value) sets the PhaseOffset property to phase and optional name-value arguments. Specify phase in radians.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Phase of zeroth point of the signal constellation in radians, specified as a scalar.

Example: 'PhaseOffset',0 aligns the QPSK signal constellation points on the axes, {(1,0), (0,j), (-1,0), (0,-j)}.

Data Types: double

Option to provide input in bits, specified as a logical 0 (false) or 1 (true).

  • When this property is set to false, the input values must be integer representations of two-bit input segments in the range [0, 3].

  • When this property is set to true, the input must be a binary vector of even length. Element pairs are binary representations of integers.

Data Types: logical

Symbol encoding mapping of constellation bits, specified as 'Gray' or 'Binary'.

SettingConstellation Mapping for IntegersConstellation Mapping for BitsComment

Gray

Map symbols using Gray-coded ordering.

Binary

Map symbols using natural binary-coded ordering. The signal constellation maps to the complex value ej(PhaseOffset + (2πm/4)), where m is an integer in the range [0, 3].

Data Types: char

Data type assigned to output, specified as 'double', 'single', or 'Custom'.

Data Types: char

Fixed-Point Properties

Fixed-point data type of output, specified as a numerictype (Fixed-Point Designer) object with a signedness of Auto.

Dependencies

This property applies when you set the OutputDataType property to 'Custom'.

Usage

Description

example

y = qpskmod(x) returns baseband-modulated output.

Input Arguments

expand all

Input signal, specified as an NS-element column vector of integers or bits, where NS is the number of samples.

The setting of the BitInput property determines the interpretation of the input vector.

Data Types: double | int8 | logical | fi

Output Arguments

expand all

Output QPSK-modulated signal, returned as a complex-valued vector.

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

constellationCalculate or plot ideal signal constellation
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System 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)

Figure contains an axes object. The axes object with title Constellation: QPSK,Gray Mapping,PhaseOffset=0.7854rad contains 7 objects of type line, text.

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)

Figure contains an axes object. The axes object with title Constellation: QPSK,Gray Mapping,PhaseOffset=0.7854rad contains 7 objects of type line, text.

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)

Figure contains an axes object. The axes object with title Constellation: QPSK,Gray Mapping,PhaseOffset=0rad contains 7 objects of type line, text.

Create a QPSK modulator object and a phase noise object.

qpskmod = 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 = qpskmod(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)

Create QPSK modulator object setting the BitInput property to true. Display the properties.

qpskmod = comm.QPSKModulator('BitInput',true)
qpskmod = 
  comm.QPSKModulator with properties:

       PhaseOffset: 0.7854
          BitInput: true
     SymbolMapping: 'Gray'
    OutputDataType: 'double'

Determine the reference constellation points.

refC = constellation(qpskmod)
refC = 4×1 complex

   0.7071 + 0.7071i
  -0.7071 + 0.7071i
  -0.7071 - 0.7071i
   0.7071 - 0.7071i

Plot the constellation. Since BitInput is true, the constellation symbols are label with bit values.

constellation(qpskmod)

Figure contains an axes object. The axes object with title Constellation: QPSK,Gray Mapping,PhaseOffset=0.7854rad contains 7 objects of type line, text.

Create QPSK modulator object with default properties settings. Display the properties.

qpskmod2 = comm.QPSKModulator
qpskmod2 = 
  comm.QPSKModulator with properties:

       PhaseOffset: 0.7854
          BitInput: false
     SymbolMapping: 'Gray'
    OutputDataType: 'double'

Plot constellation with default settings. Since BitInput is false, the constellation symbols are label with integer values.

constellation(qpskmod2)

Figure contains an axes object. The axes object with title Constellation: QPSK,Gray Mapping,PhaseOffset=0.7854rad contains 7 objects of type line, text.

Extended Capabilities

Version History

Introduced in R2012a