## Analog Passband Modulation

### Analog Modulation Features

In most communication medium, only a fixed range of frequencies is available for transmission. One way to communicate a message signal whose frequency spectrum does not fall within that fixed frequency range, or one that is otherwise unsuitable for the channel, is to alter a transmittable signal according to the information in your message signal. This alteration is called modulation, and it is the modulated signal that you transmit. The receiver then recovers the original signal through a process called demodulation. This section describes how to modulate and demodulate analog signals using blocks.

Open the Modulation library by double-clicking its icon in the main Communications Toolbox™ block library. Then, open the Analog Passband sublibrary by double-clicking its icon in the Modulation library.

The following figure shows the modulation techniques that Communications Toolbox supports for analog signals. As the figure suggests, some categories of techniques include named special cases.

For a given modulation technique, two ways to simulate modulation techniques are called baseband and passband. This product supports passband simulation for analog modulation.

The modulation and demodulation blocks also let you control such features as the initial phase of the modulated signal and post-demodulation filtering.

### Represent Signals for Analog Modulation

Analog modulation blocks in this product process only sample-based scalar signals. The input and output of the analog modulator and demodulator are all real signals.

All analog demodulators in this product produce discrete-time, not continuous-time, output.

#### Representing Analog Signals Using MATLAB

To modulate an analog signal using MATLAB®, start with a real message signal and a sampling rate `Fs` in hertz. Represent the signal using a vector `x`, the entries of which give the signal's values in time increments of 1/`Fs`. Alternatively, you can use a matrix to represent a multichannel signal, where each column of the matrix represents one channel.

For example, if `t` measures time in seconds, then the vector `x` below is the result of sampling a sine wave 8000 times per second for 0.1 seconds. The vector `y` represents the modulated signal.

```Fs = 8000; % Sampling rate is 8000 samples per second. Fc = 300; % Carrier frequency in Hz t = [0:.1*Fs]'/Fs; % Sampling times for .1 second x = sin(20*pi*t); % Representation of the signal y = ammod(x,Fc,Fs); % Modulate x to produce y. figure; subplot(2,1,1); plot(t,x); % Plot x on top. subplot(2,1,2); plot(t,y)% Plot y below.```

As a multichannel example, the code below defines a two-channel signal in which one channel is a sinusoid with zero initial phase and the second channel is a sinusoid with an initial phase of `pi/8`.

```Fs = 8000; t = [0:.1*Fs]'/Fs; x = [sin(20*pi*t), sin(20*pi*t+pi/8)];```

#### Analog Modulation with Additive White Gaussian Noise (AWGN) Using MATLAB

This example illustrates the basic format of the analog modulation and demodulation functions. Although the example uses phase modulation, most elements of this example apply to other analog modulation techniques as well.

The example samples an analog signal and modulates it. Then it simulates an additive white Gaussian noise (AWGN) channel, demodulates the received signal, and plots the original and demodulated signals.

```% Prepare to sample a signal for two seconds, % at a rate of 100 samples per second. Fs = 100; % Sampling rate t = [0:2*Fs+1]'/Fs; % Time points for sampling % Create the signal, a sum of sinusoids. x = sin(2*pi*t) + sin(4*pi*t); Fc = 10; % Carrier frequency in modulation phasedev = pi/2; % Phase deviation for phase modulation y = pmmod(x,Fc,Fs,phasedev); % Modulate. y = awgn(y,10,'measured',103); % Add noise. z = pmdemod(y,Fc,Fs,phasedev); % Demodulate. % Plot the original and recovered signals. figure; plot(t,x,'k-',t,z,'g-'); legend('Original signal','Recovered signal');```

Other examples using analog modulation functions appear in the reference pages for `ammod`, `amdemod`, `ssbdemod`, and `fmmod`.

### Sampling Issues in Analog Modulation

The proper simulation of analog modulation requires that the Nyquist criterion be satisfied, taking into account the signal bandwidth.

Specifically, the sample rate of the system must be greater than twice the sum of the carrier frequency and the signal bandwidth.

### Filter Design Issues

After demodulating, you might want to filter out the carrier signal. The particular filter used, such as `butter`, `cheby1`, `cheby2`, and `ellip`, can be selected on the mask of the demodulator block. Different filtering methods have different properties, and you might need to test your application with several filters before deciding which is most suitable.

#### Varying Filter's Cutoff Frequency Using Simulink

In many situations, a suitable cutoff frequency is half the carrier frequency. Because the carrier frequency must be higher than the bandwidth of the message signal, a cutoff frequency chosen in this way properly filters out unwanted frequency components. If the cutoff frequency is too high, the unwanted components may not be filtered out. If the cutoff frequency is too low, it might narrow the bandwidth of the message signal.

The following example modulates a sawtooth message signal, demodulates the resulting signal using a Butterworth filter, and plots the original and recovered signals. The Butterworth filter is implemented within the SSB AM Demodulator Passband block.

To open this model , enter `doc_filtercutoffs` at the MATLAB command line.

This example generates the following output:

There is invariably a delay between a demodulated signal and the original received signal. Both the filter order and the filter parameters directly affect the length of this delay.

Other Filter Cutoffs.  To see the effect of a lowpass filter with a higher cutoff frequency, set the Cutoff frequency of the SSB AM Demodulator Passband block to `49`, and run the simulation again. The new result is shown below. The higher cutoff frequency allows the carrier signal to interfere with the demodulated signal.

To see the effect of a lowpass filter with a lower cutoff frequency, set the Cutoff frequency of the SSB AM Demodulator Passband block to `4`, and run the simulation again. The new result is shown in the following figure. The lower cutoff frequency narrows the bandwidth of the demodulated signal.