Main Content

comm.CPMDemodulator

Demodulate signal using CPM method and Viterbi algorithm

Description

Thecomm.CPMDemodulatorSystem object™ demodulates an input signal that was modulated using the continuous phase modulation (CPM) method. The input is a baseband representation of the modulated signal. For more information about the demodulation and filtering applied, seeCPM Demodulation MethodandPulse Shape Filtering.

To demodulate a signal that was modulated using the CPM method:

  1. Create thecomm.CPMDemodulatorobject and set its properties.

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

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

Creation

Description

cpmdemod = comm.CPMDemodulatorcreates a demodulator System object to demodulate input CPM signals using the Viterbi algorithm.

example

cpmdemod = comm.CPMDemodulator(Name,Value)sets properties using one or more name-value arguments. For example,'SymbolMapping','Gray'specifies gray-ordered symbol mapping for the modulated symbols.

example

cpmdemod = comm.CPMDemodulator(M,Name,Value)sets theModulationOrderproperty toMand optional name-value arguments.

Properties

expand all

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

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

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

Modulation order, specified as a power-of-two scalar. The modulation order,M= 2kspecifies the number of points in the signal constellation, wherekis a positive integer indicating the number of bits per symbol.

Data Types:double

Option to output data as bits, specified as a logical0(false) or1(true).

  • Set this property tofalseto output data as integers.

  • Set this property totrueto output data as bits.

For more information, seeInteger-Valued and Binary-Valued Output Signals.

Data Types:logical

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

  • Set this property to'Binary'地图符号使用自然二进制编码排序.

  • Set this property to'Gray'to map symbols using Gray-coded ordering.

For more information, seeInteger-Valued and Binary-Valued Output Signals.

Dependencies

To enable this property, set theBitOutputproperty totrue.

Modulation index, specified as a nonnegative scalar or column vector. For more information, seeCPM Demodulation Method.

Data Types:double

Type of frequency pulse shaping used by the modulator to smooth the phase transitions of the modulated signal, specified as'Rectangular','Raised Cosine','Spectral Raised Cosine','Gaussian', or'Tamed FM'. For more information, seePulse Shape Filtering.

Main lobe duration of the largest lobe in the spectral raised cosine pulse, specified as a positive integer representing the number of symbol intervals used by the demodulator to pulse-shape the modulated signal.

Dependencies

To enable this property, set theFrequencyPulseproperty to'Spectral Raised Cosine'.

Data Types:double

Roll-off factor of the spectral raised cosine pulse, specified as a scalar in the range [0, 1].

Dependencies

To enable this property, set theFrequencyPulseproperty to'Spectral Raised Cosine'.

Data Types:double

Product of the bandwidth and symbol time of the Gaussian pulse shape, specified as a positive scalar. UseBandwidthTimeProductto reduce the bandwidth, at the expense of increased intersymbol interference.

Dependencies

To enable this property, set theFrequencyPulseproperty to'Gaussian'.

Data Types:double

Length of the frequency pulse shape in symbol intervals, specified as a positive integer. For more information on the frequency pulse length, refer toLTPulse Shape Filtering.

Data Types:double

Symbol prehistory, specified as scalar or vector with odd integer elements in the range [– (ModulationOrder– 1), (ModulationOrder– 1)]. This property defines the data symbols used by the modulator prior to the first call of the object in reverse chronological order. When you specify this property as a vector, the length must be (PulseLength– 1).

Data Types:double

Initial phase offset in radians of the modulated waveform, specified as a scalar.

Data Types:double

Number of samples per input symbol, specified as a positive integer. This property represents the number of samples input for each integer or binary word output. For all nonbinary schemes, as defined by the pulse shapes, this value must be greater than 1.

Data Types:double

Traceback depth for the Viterbi algorithm, specified as a positive integer representing the number of trellis branches that the Viterbi algorithm uses to construct each traceback path. The value of this property is also the output delay and the number of zero symbols that precede the first meaningful demodulated symbol in the output. For more information, seeTraceback Depth and Output Delays.

Data Types:double

Data type of the output, specified as one of these values.

  • When you set theBitOutputproperty tofalse, you can set the output data type to'double','int8','int16', or'int32'.

  • When you set theBitOutputproperty totrue, you can set the output data type to'logical'or'double'.

Usage

Description

y= cpmdemod(x)applies CPM demodulation method to the input signal and returns the demodulated signal.

Input Arguments

expand all

CPM-modulated signal, specified as a column vector with a length equal to an integer multiple of theSamplesPerSymbolproperty.

Data Types:double|single

Output Arguments

expand all

Output signal, returned as a column vector or matrix. To specify whether the object outputs values as integers or bits, use theBitOutputproperty. To specify the output data type, use theOutputDataTypeproperty.

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 namedobj, use this syntax:

release(obj)

expand all

step RunSystem object算法
release Release resources and allow changes toSystem objectproperty values and input characteristics
reset Reset internal states ofSystem object

Examples

collapse all

Create CPM modulator, and CPM demodulator System objects.

cpmmodulator = comm.CPMModulator(8,...'BitInput',true,...'SymbolMapping','Gray');cpmdemodulator = comm.CPMDemodulator (8,...'BitOutput',true,...'SymbolMapping','Gray');

Create an error rate calculator System object™, that accounts for the delay caused by the Viterbi algorithm.

delay = log2(cpmdemodulator.ModulationOrder)...* cpmdemodulator.TracebackDepth; errorRate = comm.ErrorRate('ReceiveDelay',delay);

Transmit 100 3-bit words and print the error rate results.

forcounter = 1:100 data = randi([0 1],300,1); modSignal = cpmmodulator(data); noisySignal = awgn(modSignal,0); receivedData = cpmdemodulator(noisySignal); errorStats = errorRate(data,receivedData);endfprintf('Error rate = %f\nNumber of errors = %d\n',...errorStats(1),errorStats(2))
Error rate = 0.004006 Number of errors = 120

Using thecomm.CPMModulatorandcomm.CPMDemodulatorSystem objects, apply Gaussian frequency-shift keying (GFSK) modulation and demodulation to random bit data.

Create a GFSK modulator and demodulator pair.

gfskMod = comm.CPMModulator(...'ModulationOrder',2,...'FrequencyPulse','Gaussian',...'BandwidthTimeProduct',0.5,...'ModulationIndex',1,...'BitInput',true); gfskDemod = comm.CPMDemodulator(...'ModulationOrder',2,...'FrequencyPulse','Gaussian',...'BandwidthTimeProduct',0.5,...'ModulationIndex',1,...'BitOutput',true);

Generate random bit data and apply GFSK modulation. Use a scatter plot to view the constellation.

numSym = 100; x = randi([0 1],numSym*gfskMod.SamplesPerSymbol,1); y = gfskMod(x); eyediagram(y,16)

数字Eye Diagram contains 2 axes objects. Axes object 1 with title Eye Diagram for In-Phase Signal contains an object of type line. This object represents In-phase. Axes object 2 with title Eye Diagram for Quadrature Signal contains an object of type line. This object represents Quadrature.

Demodulate the GFSK-modulated data. To verify that the demodulated signal data is equal to the original data, account for the delay introduced by the Gaussian filtering in the GFSK modulation and demodulation processes.

z = gfskDemod(y); delay = finddelay(x,z); isequal(x(1:end-delay),z(delay+1:end))
ans =logical1

More About

expand all

参考文献

[1]Anderson, John B., Tor Aulin, and Carl-Erik Sundberg.Digital Phase Modulation. New York: Plenum Press, 1986.

Extended Capabilities

Version History

Introduced in R2012a