Contenuto principale

comm.CPFSKModulator

Modulate using CPFSK method

Description

The comm.CPFSKModulator System object™ modulates a signal using the continuous phase frequency shift keying (CPFSK) method. The output is a baseband representation of the modulated signal. For more information about the demodulation and filtering applied, see Algorithms.

To modulate using the CPFSK method:

  1. Create the comm.CPFSKModulator 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

cpfskMod = comm.CPFSKModulator creates a modulator System object that modulates the input signal using the CPFSK modulation method.

cpfskMod = comm.CPFSKModulator(Name=Value) creates a CPFSK modulator object and sets properties using one or more name-value arguments. For example, comm.CPFSKModulator(InitialPhaseOffset=pi/4), configures the object with an initial phase offset of pi/4 radians.

cpfskMod = comm.CPFSKModulator(M,Name=Value) sets the ModulationOrder property to M, and optional name-value arguments.

example

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.

Modulation order, specified as a power-of-two scalar. The modulation order M = 2k specifies the number of points in the symbol alphabet. k is a positive integer indicating the number of bits per symbol.

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

  • Set this property to false to input data as integers.

  • Set this property to true to input data as bits.

For more information, see Integer-Valued and Binary-Valued Input Signals.

Symbol mapping, specified as 'Binary' or 'Gray'. This property determines how each integer maps to a group of output bits.

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

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

For more information, see Integer-Valued and Binary-Valued Input Signals.

Dependencies

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

Modulation index {hi}, specified as a nonnegative scalar or column vector. The modulator operates in multi-h. For more information, see CPFSK Method.

Initial phase offset in radians, specified as a numeric scalar. This parameter value is initial phase offset of the modulated waveform.

Symbol sampling rate, specified as a positive integer. This property specifies the output symbol upsampling factor for each input sample.

Data type of the output, specified as 'double' or 'single'.

Usage

Description

Y = cpfskMod(X) applies CPFSK method to the input signal and returns the modulated CPFSK baseband signal.

Input Arguments

expand all

Input data, specified as an integer scalar or column vector.

  • When you set BitInput to false, the object accepts odd integers in the range [ –(M–1), (M–1)]. M is the modulation order specified by the ModulationOrder property.

  • When you set BitInput to true, the input data must be double-precision or logical.

For more information, see Integer-Valued and Binary-Valued Input Signals.

This object accepts variable-size inputs. After the object is locked, you can change the frame size (number of rows) of the signal during simulation. For more information, see Variable-Size Signals in Code.

Data Types: double | int8 | int16 | int32 | logical

Output Arguments

expand all

CPFSK-modulated baseband output, returned as a column vector. The modulated output symbols are oversampled by the SamplesPerSymbol property value. Use the OutputDataType property to specify the output data type.

Data Types: double | single
Complex Number Support: Yes

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

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 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; % Modulation order
cpfskMod = comm.CPFSKModulator(M, ...
    BitInput=true, ...
    SymbolMapping='Gray');
awgnChan = comm.AWGNChannel( ...
    NoiseMethod='Signal to noise ratio (SNR)', ...
    SNR=0);
cpfskDemod = comm.CPFSKDemodulator(M, ...
    BitOutput=true, ...
    SymbolMapping='Gray');

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

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( ...
    ReceiveDelay=delay);
for counter = 1:numFrames
    data = randi([0 1],k*spf,1);
    modSignal = cpfskMod(data);
    noisySignal = awgnChan(modSignal);
    receivedData = cpfskDemod(noisySignal);
    errorStats = errorRate(data,receivedData);
end

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

More About

expand all

Algorithms

expand all

References

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

[2] Proakis, John G. Digital Communications. 5th ed. New York: McGraw Hill, 2007.

Extended Capabilities

expand all

Version History

Introduced in R2012a

expand all