Contenuto principale

Communications Applications

Modulation

Modulation varies the amplitude, phase, or frequency of a carrier signal with reference to a message signal. The modulate function modulates a message signal with a specified modulation method.

The basic syntax for the modulate function is

y = modulate(x,fc,fs,'method',opt)

where:

  • x is the message signal.

  • fc is the carrier frequency.

  • fs is the sampling frequency.

  • method is a flag for the desired modulation method.

  • opt is any additional argument that the method requires. (Not all modulation methods require an option argument.)

The table below summarizes the modulation methods provided; see the documentation for modulate, demod, and vco for complete details on each.

Method

Description

amdsb-sc or am

Amplitude modulation, double sideband, suppressed carrier

amdsb-tc

Amplitude modulation, double sideband, transmitted carrier

amssb

Amplitude modulation, single sideband

fm

Frequency modulation

pm

Phase modulation

ppm

Pulse position modulation

pwm

Pulse width modulation

qam

Quadrature amplitude modulation

If the input x is an array rather than a vector, modulate modulates each column of the array.

To obtain the time vector that modulate uses to compute the modulated signal, specify a second output parameter:

[y,t] = modulate(x,fc,fs,'method',opt)

Demodulation

The demod function performs demodulation, that is, it obtains the original message signal from the modulated signal:

The syntax for demod is

x = demod(y,fc,fs,'method',opt)

demod uses any of the methods shown for modulate, but the syntax for quadrature amplitude demodulation requires two output parameters:

[X1,X2] = demod(y,fc,fs,'qam')

If the input y is an array, demod demodulates all columns.

Try modulating and demodulating a signal. A 50 Hz sine wave sampled at 1000 Hz is

t = (0:1/1000:2);
x = sin(2*pi*50*t);

With a carrier frequency of 200 Hz, the modulated and demodulated versions of this signal are

y = modulate(x,200,1000,'am');
z = demod(y,200,1000,'am');

To plot portions of the original, modulated, and demodulated signal:

figure; plot(t(1:150),x(1:150)); title('Original Signal');
figure; plot(t(1:150),y(1:150)); title('Modulated Signal');
figure; plot(t(1:150),z(1:150)); title('Demodulated Signal');

Original Signal

Modulated Signal

Demodulated Signal

Note

The demodulated signal is attenuated because demodulation includes two steps: multiplication and lowpass filtering. The multiplication produces a component with frequency centered at 0 Hz and a component with frequency at twice the carrier frequency. The filtering removes the higher frequency component of the signal, producing the attenuated result.

Voltage Controlled Oscillator

The voltage controlled oscillator function vco creates a signal that oscillates at a frequency determined by the input vector. The basic syntax for vco is

y = vco(x,fc,fs)

where fc is the carrier frequency and fs is the sampling frequency.

To scale the frequency modulation range, use

y = vco(x,[Fmin Fmax],fs)

In this case, vco scales the frequency modulation range so values of x on the interval [-1 1] map to oscillations of frequency on [Fmin Fmax].

If the input x is an array, vco produces an array whose columns oscillate according to the columns of x.

See FFT-Based Time-Frequency Analysis for an example using the vco function.