Digital Modulation

Section Overview

Like analog modulation, digital modulation alters a transmittable signal according to the information in a message signal. However, in this case, the message signal is a discrete-time signal that can assume finitely many values. This section describes how to modulate and demodulate digital signals with Communications Blockset.

For background material on the subject of digital modulation, see the works listed in Selected Bibliography for Digital Modulation.

Accessing Digital Modulation Blocks

Open the Modulation library by double-clicking the icon in the main Communications Blockset library. Then open the Digital Baseband sublibrary by double-clicking its icon in the Modulation library.

The Digital Baseband library has sublibraries of its own. Open each of these sublibraries by double-clicking the icon listed in the table below.

Kind of ModulationIcon in Digital Baseband Library
Amplitude modulation AM
Phase modulation PM
Frequency modulation FM
Continuous phase modulation CPM
Trellis-coded modulation TCM

Digital Modulation Features of the Blockset

The figure below shows the modulation techniques that Communications Blockset supports for digital data. All the methods at the far right are implemented in library blocks.

General and Specific Modulation Methods

Some digital modulation sublibraries contain blocks that implement special cases of a more general technique and are, in fact, special cases of a more general block. These special-case blocks use the same computational code that their general counterparts use, but provide an interface that is either simpler or more suitable for the special case. The following table lists special-case modulators, their general counterparts, and the conditions under which the two are equivalent. The situation is analogous for demodulators.

General and Specific Blocks

General ModulatorSpecific ModulatorSpecific Conditions
General QAM Modulator BasebandRectangular QAM Modulator BasebandPredefined constellation containing 2K points on a rectangular lattice
M-PSK Modulator BasebandBPSK Modulator BasebandM-ary number parameter is 2.
QPSK Modulator BasebandM-ary number parameter is 4.
M-DPSK Modulator BasebandDBPSK Modulator BasebandM-ary number parameter is 2.
DQPSK Modulator BasebandM-ary number parameter is 4.
CPM Modulator BasebandGMSK Modulator BasebandM-ary number parameter is 2, Frequency pulse shape parameter is Gaussian.
MSK Modulator BasebandM-ary number parameter is 2, Frequency pulse shape parameter is Rectangular, Pulse length parameter is 1.
CPFSK Modulator BasebandFrequency pulse shape parameter is Rectangular, Pulse length parameter is 1.
General TCM EncoderRectangular QAM TCM EncoderPredefined signal constellation containing 2K points on a rectangular lattice
M-PSK TCM EncoderPredefined signal constellation containing 2K points on a circle

Furthermore, the CPFSK Modulator Baseband block is similar to the M-FSK Modulator Baseband block, when the M-FSK block uses continuous phase transitions. However, the M-FSK features of this blockset differ from the CPFSK features in their mask interfaces and in the demodulator implementations.

Baseband Modulated Signals

For a given modulation technique, two ways to simulate modulation techniques are called baseband and passband. This blockset supports baseband simulation for digital modulation. Baseband simulation, also known as the lowpass equivalent method, requires less computation compared to passband simulation. This is because modeling a high-frequency carrier signal is computationally intensive.

For the mathematical expressions that define baseband signals, see the baseband signal section in the Communications Toolbox documentation.

Representing Signals for Digital Modulation

All digital modulation blocks process only discrete-time signals and use the baseband representation. The data types of inputs and outputs are depicted in the following figure.

Binary-Valued and Integer-Valued Signals

Some digital modulation blocks can accept either integers or binary representations of such integers. The corresponding demodulation blocks can output either integers or their binary representations. This section describes how modulation blocks process binary inputs; the case for demodulation blocks is the reverse.

If a modulator block's Input type parameter is set to Bit, the block accepts binary representations of integers between 0 and M-1. It modulates each group of K bits, called a binary word. Also, the input vector length must be an integer multiple of K. If the input is frame-based, then it must be a column vector.

In binary input mode, the Constellation ordering (or Symbol set ordering, depending on the type of modulation) parameter indicates how the block maps a group of K input bits to a corresponding integer. If this parameter is set to Binary, the block maps [u(1) u(2) ... u(K)] to the integer

and subsequently behaves as if this integer were the input value. u(1) is the most significant bit.

For example, if M = 8, Constellation ordering (or Symbol set ordering) is set to Binary, and the binary input word is [1 1 0], the block internally converts [1 1 0] to the integer 6. The block produces the same output as in the case when the input is 6 and the Input type parameter is Integer.

If Constellation ordering (or Symbol set ordering) is set to Gray, the block uses a Gray-coded arrangement. The explicit mapping is described in the algorithm section on the reference page for the M-PSK Modulator Baseband block.

Delays in Digital Modulation

Digital modulation and demodulation blocks sometimes incur delays between their inputs and outputs, depending on their configuration and on properties of their signals. The following table lists sources of delay and the situations in which they occur.

Delays Resulting from Digital Modulation or Demodulation

Modulation or Demodulation TypeSituation in Which Delay OccursAmount of Delay
All demodulators in AM, PM, and FM sublibraries except OQPSK Sample-based inputOne output period
All demodulators in CPM sublibrary Sample-based input, D = Traceback length parameter D+1 output periods
Frame-based input, D = Traceback length parameterD output periods
OQPSK modulator- demodulator pairFrame-based input One output period
Sample-based inputTwo output periods
Sample-based input, and the model uses a fixed-step solver with Mode parameter set to Auto or MultiTasking.Two output periods
Sample-based input, and the model uses a variable-step solver or the Mode parameter is not set to Auto or MultiTasking.One output period
All demodulators in TCM sublibrary Operation mode set to Continuous, Tr = Traceback depth parameter, and code rate k/n Tr*k output bits

As a result of delays, data that enters a modulation or demodulation block at time T appears in the output at time T+delay. In particular, if your simulation computes error statistics or compares transmitted with received data, it must take the delay into account when performing such computations or comparisons.

First Output Sample in DPSK Demodulation

In addition to the delays mentioned above, the DPSK, DQPSK, and DBPSK demodulators produce output whose first sample is unrelated to the input. This is related to the differential modulation technique, not the particular implementation of it.

Example: Delays from Demodulation

Demodulation in the model below causes the demodulated signal to lag, compared to the unmodulated signal. This delay is typical for sample-based data that the modulator upsamples. When computing error statistics, the model accounts for the delay by setting the Error Rate Calculation block's Receive delay parameter to 1. If the Receive delay parameter had a different value, then the error rate showing at the top of the Display block would be close to 1/2.

To open the completed model, click here in the MATLAB Help browser. To build the model, gather and configure these blocks:

Connect the blocks as shown above. From the model window's Simulation, select Configuration parameters. In the Configuration Parameters dialog box, set Stop time to 100. Then run the model and observe the error rate at the top of the Display block's icon. Your error rate will vary depending on your Initial seed value in the Random Integer Generator block.

Upsampled Signals and Rate Changes

Some digital modulation blocks can output an upsampled version of the modulated signal, while their corresponding digital demodulation blocks can accept an upsampled version of the modulated signal as input. Each block's Samples per symbol parameter, S, is the upsampling factor in both cases. It must be a positive integer. Depending on whether the signal is frame-based or sample-based, the block either changes the signal's vector size or its sample time, as the table below indicates. Only the OQPSK blocks deviate from the information in the table, in that S is replaced by 2S in the scaling factors.

Processing of Upsampled Modulated Data (Except OQPSK Method)

Computation TypeInput Frame StatusResult
Modulation Frame-based Output vector length is S times the number of integers or binary words in the input vector. Output sample time equals the input sample time.
Modulation Sample-based Output vector is a scalar. Output sample time is 1/S times the input sample time.
Demodulation Frame-based Number of integers or binary words in the output vector is 1/S times the number of samples in the input vector. Output sample time equals the input sample time.
Demodulation Sample-based Output signal contains one integer or one binary word. Output sample time is S times the input sample time.

Furthermore, if S > 1 and the demodulator is from the AM, PM, or FM sublibrary, the demodulated signal is delayed by one output sample period. There is no delay if S = 1 or if the demodulator is from the CPM sublibrary.

Illustrations of Size or Rate Changes

The following schematics illustrate how a modulator (other than OQPSK) upsamples a triplet of frame-based and sample-based integers. In both cases, the Samples per symbol parameter is 2.

The following schematics illustrate how a demodulator (other than OQPSK or one from the CPM sublibrary) processes three doubly sampled symbols using both frame-based and sample-based inputs. In both cases, the Samples per symbol parameter is 2. The sample-based schematic includes an output delay of one sample period.

Examples of Digital Modulation

This section builds a few simple example models to illustrate the modulation methods and how Communications Blockset allows you to implement them. The examples are

DQPSK Signal Constellation Points and Transitions

The model below plots the output of the DQPSK Modulator Baseband block. The image shows the possible transitions from each symbol in the DQPSK signal constellation to the next symbol.

To open the completed model, click here in the MATLAB Help browser. To build the model, gather and configure these blocks:

Use the blocks' default parameters unless otherwise instructed. Connect the blocks as in the figure above. Running the model produces the following plot. The plot reflects the transitions among the eight DQPSK constellation points.

This plot illustrates π/4-DQPSK modulation, because the default Phase offset parameter in the DQPSK Modulator Baseband block is pi/4. To see how the phase offset influences the signal constellation, change the Phase offset parameter in the DQPSK Modulator Baseband block to pi/8 or another value. Run the model again and observe how the plot changes.

Rectangular QAM Modulation and Scatter Diagram

The model below uses the M-QAM Modulator Baseband block to modulate random data. After passing the symbols through a noisy channel, the model produces a scatter diagram of the noisy data. The diagram suggests what the underlying signal constellation looks like and shows that the noise distorts the modulated signal from the constellation.

To open the completed model, click here in the MATLAB Help browser. To build the model, gather and configure these blocks:

Connect the blocks as in the figure. From the model window's Simulation menu, select Configuration parameters. In the Configuration Parameters dialog box, set Stop time to 250. Running the model produces a scatter diagram like the following one. Your plot might look somewhat different, depending on your Initial seed value in the Random Integer Generator block. Because the modulation technique is 16-QAM, the plot shows 16 clusters of points. If there were no noise, the plot would show the 16 exact constellation points instead of clusters around the constellation points.

Phase Tree for Continuous Phase Modulation

This example plots a phase tree associated with a continuous phase modulation scheme. A phase tree is a diagram that superimposes many curves, each of which plots the phase of a modulated signal over time. The distinct curves result from different inputs to the modulator.

This example uses the CPM Modulator Baseband block for its numerical computations. The block is configured so that it uses a raised cosine filter pulse shape. The example also illustrates how you can use Simulink and MATLAB together. The example uses MATLAB commands to run a series of simulations with different input signals, to collect the simulation results, and to plot the full data set.

The first step of this example is to build the model. To open the completed model, click here in the MATLAB Help browser. To build the model, gather and configure these blocks:

Do not run the model, because the variable s is not yet defined in the MATLAB workspace. Instead, save the model to a directory on your MATLAB path, using the filename doc_phasetree.

The second step of this example is to execute these commands in MATLAB:

% Parameters from the CPM Modulator Baseband block
M_ary_number = 2;
modulation_index = 2/3;
pulse_length = 2;
samples_per_symbol = 8;
opts = simset('SrcWorkspace','Current',...
   'DstWorkspace','Current');

L = 5;  % Symbols to display
pmat = [];
for ip_sig = 0:(M_ary_number^L)-1
    s = de2bi(ip_sig,L,M_ary_number,'left-msb');
    % Apply the mapping of the input symbol to the CPM
    % symbol 0 -> -(M-1), 1 -> -(M-2), etc.
    s = 2*s'+1-M_ary_number;
    sim('doc_phasetree', .9, opts); % Run model to generate x.
    % Next column of pmat
    pmat(:,ip_sig+1) = unwrap(angle(x(:))); 
end;
pmat = pmat/(pi*modulation_index);
t = (0:L*samples_per_symbol-1)'/samples_per_symbol;
plot(t,pmat); figure(gcf); % Plot phase tree.

The resulting plot follows. Each curve represents a different instance of simulating the CPM Modulator Baseband block with a distinct (constant) input signal.

Setting Noise Variance for Computing LLRs

Some digital demodulation blocks can compute bitwise log-likelihood ratio (LLR) and approximate LLR values that can be used by some decoders (such as the Viterbi Decoder block) to achieve better BER performance. To compute LLR or approximate LLR, these blocks need, along with other parameters, the variance of the noise in the input signal.

If you are adding noise to the transmitted signal using the AWGN Channel block, there are various methods for computing the noise variance at the input of a demodulator block based on the Mode parameter of the AWGN Channel block, as shown in the following figure.

Eb/No Mode

The example model doc_noisevariance_ebno shows the case where the AWGN Channel block's Mode parameter is set to Signal to noise ratio (Eb/No).

To open the model, change your directory to <MATLAB>/help/toolbox/commblks/examples and type doc_noisevariance_ebno at the MATLAB command line, or click here, if you are viewing this in the MATLAB help browser.

The BPSK Demodulator Baseband block's Decision type is set to Log-likelihood ratio, and the Noise variance source is set to Dialog. The Dialog setting enables a field, Noise variance, which is then set to Pi/(10^(EbNo/10)), where Pi is the input signal power, in watts, and EbNo is the ratio of bit energy to noise power spectral density, in decibels.

The AWGN Channel block requires both Eb/No and Input signal power parameters to define the noise that it adds to the signal. Variables such as Pi and EbNo are defined by the example model in the base workspace.

Es/No Mode

The example doc_noisevariance_esno (also found in <MATLAB>/help/toolbox/commblks/examples) shows how to calculate noise variance for the MPSK Demodulator Baseband block, computing approximate LLR when the AWGN Channel block's Mode parameter is set to Signal to noise ratio (Es/No).

The method of computing noise variance remains the same, whether the computation is using LLR or approximate LLR. The noise variance is given as Pi/(10^(EsNo/10)), where Pi is the input signal power, in watts, and EsNo is the ratio of signal energy to noise power spectral density, in decibels.

The AWGN Channel block uses the two parameters, Es/No and Input signal power, along with others, to compute the noise it adds to the signal.

SNR Mode

doc_noisevariance_snr (found in the same directory) demonstrates the use of the Signal to noise ratio (SNR) mode of the AWGN Channel block.

In this example, the Rectangular QAM Demodulator Baseband block, which computes the LLR, is given the noise variance of its input signal as Pi/(10^(SNR/10)), where Pi is the input signal power, in watts, and SNR is the ratio of signal power to noise power, in decibels.

The noise variance is computed using the parameters needed by the AWGN Channel block to define the noise added to the signal.

Constellation Visualization

Some linear modulator blocks now provide the capability to visualize a signal constellation from the block mask. This Constellation Visualization feature allows you to visualize a signal constellation for specific block parameters. The following blocks support constellation visualization:

Clicking View Constellation on a linear modulator block mask, plots the signal constellation using the block's mask parameters. If you set a modulator block to output single or fixed-point data types, clicking View Constellation generates two signal constellations plots overlaid on each other.

The title of the plot indicates the values of significant parameters. You can use the full array of MATLAB plot tools to manipulate plot figures. Selecting Inherit via Backpropagation for the Output Data Type generates a constellation plot with double as the Output data type.

Constellation Visualization Tutorial

In this tutorial, you will make changes to the modulator block. Without actually applying the changes to the model itself, you will observe how these changes affect the signal constellation.

  1. Open the constellation visualization tutorial model by typing doc_CVTutorialModel at the MATLAB command line.

  2. Double-click on the Rectangular QAM Modulator Baseband block.

  3. Next, click View Constellation

    The constellation plot shows that the constellation:

    The constellation plot also shows that the signal has a double precision datatype. Because the Input type is integer, the constellation has integer symbol mapping.

  4. From the block mask, select bit for the Input type parameter.

  5. Select gray for the Constellation ordering parameter.

  6. Click View Constellation, and observe the results. Even though you did not click Apply, making these changes part of the model, but that the constellation plot still updates. The plot indicates gray constellation ordering and a bit representation of symbols.

  7. You can overlay and compare the effect that two different data type selections have on a signal constellation. For example, you can compare the effect of changing Output data type from double to Fixed-point on the signal constellation.

    To compare settings, perform the following tasks:

  8. Click Main tab, and then click View Constellation.

    The plot overlays the fixed-point constellation on top of the double-precision constellation.

  9. You can specify a block parameter value using variables defined in the MATLAB workspace. To define a variable, type M=32 in the MATLAB workspace.

  10. In the block mask, click the Main tab, then type M for the M-ary number parameter. This parameter allows the block to use the variable value you defined in MATLAB workspace.

  11. Click the Data Types tab and then select double for the Output data type parameter.

  12. Click the Main tab. Then, click theView Constellation button and observe the results.

  13. You can use the Constellation Visualization feature when a simulation is running. Type M=16 in the MATLAB workspace, select integer for the Input type and click Apply.

  14. Simulate the model by clicking Start in the Simulink model window.

  15. While the simulation is running, click View Constellation. Compare the signal constellation to the scatter plot generated in the previous step.

  16. End the simulation by clicking the Stop button in the Simulink model window.

    The Constellation Visualization feature provides full access to the MATLAB plotting capabilities, including: capturing a figure, saving a figure in multiple file formats, changing display settings, or saving files for archiving purposes. To capture a figure, select Edit > Copy Figure.

    Using this tutorial, you have generated numerous constellation plots. If you close the Simulink model or delete the modulator block from the model, all the plots will close.

  17. Close the Simulink model, and observe that all of the constellation figures also close.

Selected Bibliography for Digital Modulation

[1] Anderson, J. B., T. Aulin, and C.-E. Sundberg, Digital Phase Modulation, New York, Plenum Press, 1986.

[2] Biglieri, E., D. Divsalar, P.J. McLane, and M.K. Simon, Introduction to Trellis-Coded Modulation with Applications, New York, Macmillan, 1991.

[3] Jeruchim, M. C., P. Balaban, and K. S. Shanmugan, Simulation of Communication Systems, New York, Plenum Press, 1992.

[4] Pawula, R.F., "On M-ary DPSK Transmission Over Terrestrial and Satellite Channels," IEEE Transactions on Communications, Vol. COM-32, July 1984, pp. 752–761.

[5] Smith, J. G., "Odd-Bit Quadrature Amplitude-Shift Keying," IEEE Transactions on Communications, Vol. COM-23, March 1975, pp. 385–389.

  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS