Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

comm.OQPSKModulator System object

Modulation using OQPSK method

Description

The comm.OQPSKModulator object modulates the input signal using the offset quadrature phase shift keying (OQPSK) method and applies pulse shape filtering to the output waveform. The output is a baseband representation of the modulated signal.

To modulate a signal using offset quadrature phase shift keying:

  1. Create the comm.OQPSKModulator 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? (MATLAB).

Creation

Syntax

oqpskmod = comm.OQPSKModulator
oqpskmod = comm.OQPSKModulator(demod)
oqpskmod = comm.OQPSKModulator(Name,Value)
oqpskmod = comm.OQPSKModulator(phase,Name,Value)

Description

oqpskmod = comm.OQPSKModulator creates a modulator System object™. This object applies offset quadrature phase shift keying (OQPSK) modulation and pulse shape filtering to the input signal.

example

oqpskmod = comm.OQPSKModulator(demod) creates a modulator System object with symmetric configuration to the OQPSK demodulator object, demod.

example

oqpskmod = comm.OQPSKModulator(Name,Value) sets properties using one or more name-value pairs. Enclose each property name in single quotes.

Example: comm.OQPSKModulator('BitInput',true)

oqpskmod = comm.OQPSKModulator(phase,Name,Value) sets the PhaseOffset property of the created object to phase and sets any other specified Name, Value pairs.

Example: comm.OQPSKModulator(0.5*pi,'SymbolMapping','Binary')

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 (MATLAB).

Phase of zeroth point of constellation shifted from π/4 radians, specified as a scalar.

Data Types: double

Option to provide input in bits, specified as false or true.

  • When this property is set to false, the input values must be integer representations of two-bit input segments and range from 0 to 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

Signal constellation bit mapping, specified as 'Gray', 'Binary', or a custom 4-element numeric vector of integers with values from 0 to 3.

SettingConstellation MappingComment

Gray

The signal constellation mapping is a Gray-encoded integer.

Binary

The signal constellation mapping for the input integer m (0 ≤ m ≤ 3) is the complex value e(j*(PhaseOffset+π/4) + j*2*π*m/4).

Custom 4-element numeric vector of integers with values from 0 to 3

Elements [a b c d] must be composed of the set of values [0, 1, 2, 3] in any order.

Data Types: char | double

Filtering pulse shape, specified as 'Half sine', 'Normal raised cosine', 'Root raised cosine', or 'Custom'.

Data Types: char

Raised cosine filter rolloff factor, specified as a scalar from 0 to 1.

Dependencies

This property applies when PulseShape is 'Normal raised cosine' or 'Root raised cosine'.

Data Types: double

Filter length in symbols, specified as a scalar. An ideal raised cosine filter has an infinite impulse response. However, to realize a practical implementation of this filter, the object truncates the impulse response to FilterSpanInSymbols symbols.

Dependencies

This property applies when PulseShape is 'Normal raised cosine' or 'Root raised cosine'.

Data Types: double

Filter numerator, specified as a row vector.

Dependencies

This property applies when PulseShape is 'Custom'.

Data Types: double
Complex Number Support: Yes

Number of samples per symbol, specified as a positive even integer.

Data Types: double

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

Data Types: char

Usage

For versions earlier than R2016b, use the step function to run the System object™ algorithm. The arguments to step are the object you created, followed by the arguments shown in this section.

For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Syntax

waveform = oqpskmod(insignal)

Description

example

waveform = oqpskmod(insignal) returns baseband-modulated output. The output waveform is pulse shaped according to the configuration properties PulseShape and SamplesPerSymbol.

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

Output Arguments

expand all

Output waveform, returned as a vector. The output waveform is pulse-shaped according to the configuration properties PulseShape and SamplesPerSymbol.

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)
stepRun System object algorithm
cloneCreate duplicate System object
getNumInputsNumber of inputs required to call the System object
getNumOutputsNumber of outputs from calling the System object
isLockedDetermine if System object is locked
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

expand all

Create an OQPSK modulator and demodulator pair. Create an AWGN channel object having two bits per symbol.

oqpskmod = comm.OQPSKModulator('BitInput',true);
oqpskdemod = comm.OQPSKDemodulator('BitOutput',true);
channel = comm.AWGNChannel('EbNo',4,'BitsPerSymbol',2);

Create an error rate calculator. To account for the delay between the modulator and demodulator, set the ReceiveDelay property to 2.

errorRate = comm.ErrorRate('ReceiveDelay',2);

Process 300 frames of data looping through these steps.

  • Generate vectors with 100 elements of random binary data.

  • OQPSK-modulate the data. The data frames are processed as 50 sample frames of 2-bit binary data.

  • Pass the modulated data through the AWGN channel.

  • OQPSK-demodulate the data.

  • Collect error statistics on the frames of data.

for counter = 1:300
    txData = randi([0 1],100,1);
    modSig = oqpskmod(txData);
    rxSig = channel(modSig);
    rxData = oqpskdemod(rxSig);
    errorStats = errorRate(txData,rxData);
end

Display the error statistics.

ber = errorStats(1)
ber = 3.3336e-05
numErrors = errorStats(2)
numErrors = 1
numBits = errorStats(3)
numBits = 29998

Use an OQPSK demodulator object to initialize an OQPSK modulator object while creating it.

Create an OQPSK demodulator, assigning it a phase offset of .

phase = 0.5*pi;
oqpskdemod = comm.OQPSKDemodulator(phase)
oqpskdemod = 
  comm.OQPSKDemodulator with properties:

   Modulation
         PhaseOffset: 1.5708
       SymbolMapping: 'Gray'
           BitOutput: false

   Filtering
          PulseShape: 'Half sine'
    SamplesPerSymbol: 4

      OutputDataType: 'double'

Use the demodulator object to initialize an OQPSK modulator while creating it.

oqpskmod = comm.OQPSKModulator(oqpskdemod)
oqpskmod = 
  comm.OQPSKModulator with properties:

   Modulation
         PhaseOffset: 1.5708
       SymbolMapping: 'Gray'
            BitInput: false

   Filtering
          PulseShape: 'Half sine'
    SamplesPerSymbol: 4

      OutputDataType: 'double'

Perform OQPSK modulation and demodulation and apply root raised cosine filtering to a waveform.

System initialization

Define simulation parameters and create objects for OQPSK modulation and demodulation.

sps = 12; % samples per symbol
bits = randi([0, 1], 800, 1); % transmission data

modulator = comm.OQPSKModulator('BitInput',true,'SamplesPerSymbol',sps,'PulseShape','Root raised cosine');
demodulator = comm.OQPSKDemodulator(modulator);

Waveform transmission and reception

Use the modulator object to apply OQPSK modulation and transmit filtering to the input data.

oqpskWaveform = modulator(bits);

Pass the waveform through a channel.

snr = 0;
rxWaveform = awgn(oqpskWaveform, snr);

Use the demodulator object to apply receive filtering and OQPSK demodulation to the waveform.

demodData = demodulator(rxWaveform);

Compute the bit error rate to confirm the quality of the data recovery.

delay = (1+modulator.BitInput)*modulator.FilterSpanInSymbols;
[~, ber] = biterr(bits(1:end-delay), demodData(delay+1:end))
ber = 0

Definitions

expand all

Extended Capabilities

Introduced in R2012a

Was this topic helpful?