Main Content


Modulate using CPFSK method


The CPFSKModulator object modulates using the continuous phase frequency shift keying method. The output is a baseband representation of the modulated signal.

To modulate a signal using the continuous phase frequency shift keying method:

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

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


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.


H = comm.CPFSKModulator creates a modulator System object, H. This object modulates the input signal using the continuous phase frequency shift keying (CPFSK) modulation method.

H = comm.CPFSKModulator(Name,Value) creates a CPFSK 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.CPFSKModulator(M,Name,Value) creates a CPFSK modulator object, H. This object has the ModulationOrder property set to M, and the other specified properties set to the specified values.



Size of symbol alphabet

Specify the size of the symbol alphabet. The value of this property requires a power of two, real, integer scalar. The default is 4.


Assume bit inputs

Specify whether the input is bits or integers. The default is false. When you set this property to false, the step method input must be a double-precision or signed integer data type column vector. This vector comprises odd integer values between –(ModulationOrder–1) and ModulationOrder–1.

When you set this property to true, the step method input must be a column vector of P-length bit words, where P = log2(ModulationOrder). The input data must be double precision or logical data type. The object maps each bit word to an integer K between 0 and ModulationOrder–1, using the mapping specified in the SymbolMapping property. The object then maps the integer K to the intermediate value 2K–(ModulationOrder–1) and proceeds as in the case when you set the BitInput property to false.


Symbol encoding

Specify the mapping of bit inputs as one of Binary | Gray. The default is Binary. This property determines how the object maps each input P-length bit word, where P = log2(ModulationOrder), to an integer between 0 and ModulationOrder–1.

When you set this property to Binary, the object uses a natural binary-coded ordering.

When you set this property to Gray, the object uses a Gray-coded ordering.

This property applies when you set the BitInput property to true.


Modulation index

Specify the modulation index. The default is 0.5. The value of this property can be a scalar, h, or a column vector, [h0, h1, …. hH-1]

where H-1 represents the length of the column vector. The phase shift over a symbol is π × h.

When hi varies from interval to interval, the object operates in multi-h. When the object operates in multi-h, hi must be a rational number.


Initial phase offset

Specify the initial phase of the modulated waveform in radians as a real, numeric scalar. The default is 0.


Number of samples per output symbol

Specify the upsampling factor at the output as a real, positive, integer scalar. The default is 8. The upsampling factor is the number of output samples that the step method produces for each input sample.


Data type of output

Specify output data type as one of double | single. The default is double.


stepModulate using CPFSK method
Common to All System Objects

Allow System object property value changes


Reset internal states of System object


collapse all

Create a CPFSK modulator, an AWGN channel, and a CPFSK demodulator. Configure the modulator and demodulator with modulation order set to 8, bit input, and Gray-encoded symbol mapping.

M = 8;
cpfskMod = comm.CPFSKModulator(M,'BitInput',true, ...
awgnChan = comm.AWGNChannel('NoiseMethod', ...
    'Signal to noise ratio (SNR)', ...
cpfskDemod = comm.CPFSKDemodulator(M,'BitOutput',true, ...

Define simulation parameters. Create an error rate calculator, accounting for the delay caused by the Viterbi algorithm used by the CPFSK demodulator.

numFrames = 1000; % Number of frames transmitted
k = log2(M);      % Bits per symbol 
spf = 100;        % Symobls per frame

delay = log2(M)*cpfskDemod.TracebackDepth;
errorRate = comm.ErrorRate( ...
for counter = 1:numFrames
    data = randi([0 1],k*spf,1);
    modSignal = cpfskMod(data);
    noisySignal = awgnChan(modSignal);
    receivedData = cpfskDemod(noisySignal);
    errorStats = errorRate(data,receivedData);

fprintf('Error rate = %f\nNumber of errors = %d\n', ...
Error rate = 0.004247
Number of errors = 1274


This object implements the algorithm, inputs, and outputs described on the CPFSK Modulator Baseband block reference page. The object properties correspond to the block parameters. For CPFSK the phase shift per symbol is π × h, where h is the modulation index.

Extended Capabilities

Version History

Introduced in R2012a