Practical 4
Object 3: Introduction to Amplitude Modulation
The objectives of this practical are:
To introduce the spectrum analyzer as used in frequency domain analysis.
To identify various types of linear modulated waveforms in time and frequency domain
representations.
To implement theoretically functional circuits using the Communications Module Design
System (CMDS).
Theory
Spectrum Analyzer and Function Generator:
This section deals spectrum of a simple sine wave.
To Start Simulink: Start Matlab then type simulink on the command line. A Simulink Library
Window opens up as shown in figure 1.
Figure 1.1 Spectrum of a simple sine wave
Figure 1.2 Design for viewing the spectrum of a simple sine wave.
Figure 1.3 shows the time-domain sine wave and the corresponding frequency domain is shown
in figure 1.4. The frequency domain spectrum is obtained through a buffered-FFT scope, which
comprises of a Fast Fourier Transform of 128 samples which also has a buffering of 64 of them
in one frame. The property block of the B-FFT is also displayed in figure 1.5.
Figure 1.3 Time domain Sine wave
Figure 1.4 Frequency domain sine wave
Figure 1.5 Property box of the Spectrum Analyzer
From the property box of the B-FFT scope the axis properties can be changed and the Line
properties can be changed. The line properties are not shown in the above. The Frequency range
can be changed by using the frequency range pop down menu and so can be the y-axis. The
amplitude scaling be changed to either real magnitude or the dB (log of magnitude) scale. The
upper limit can be specified as shown by the Min and Max Y-limits edit box. The sampling time
in this case has been set to 1/5000.
Note: The sampling frequency of the B-FFT scope should match with the sampling time of the
input time signal. Also as indicated above the FFT is taken for 128 points and buffered with half
of them for an overlap.
Calculating the Power: The power can be calculated by squaring the value of the voltage of the
spectrum analyzer.
Note: The signal analyzer if chosen with half the scale, the spectrum is the single-sided analyzer,
so the power in the spectrum is the total power.
Similar operations can be done for other waveforms – like the square wave, triangular. These
signals can be generated from the signal generator block.
Procedure
I. Sketch the time and frequency domain representations(magnitude only) of the following:
Program 1: Cos 2ft f = 1kHz
The time and frequency domain of the input signal is shown as below.
A m p lit u d e
3
2
1
0
-1
-2
-3
-5 -4 -3 -2 -1 0 1 2 3 4 5
Time domain
A m p lit u d e
2000
1500
1000
500
0
0 500 1000 1500 2000 2500 3000 3500 4000
Freq domain
Program 2: Square wave period = 1msec, amplitude = 1v
3
Amplitude 2
1
0
-1
-2
-3
-5 -4 -3 -2 -1 0 1 2 3 4 5
Time domain
300
Amplitude
200
100
0
0 50 100 150 200 250 300 350 400
Freq domain
Program 3: Cos2(2ft) f = 1kHz
Cos2(2pift)
3
2
1
Amplitude
0
-1
-2
-3
-5 -4 -3 -2 -1 0 1 2 3 4 5
Time domain
200
150
Amplitude
100
50
0
0 50 100 150 200 250 300
Freq domain
Syntax of modulation function:
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.
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
Original Signal
Modulated Signal
Demodulated Signal
ammod Function (Amplitude modulation)
y = ammod(x,Fc,Fs)
y = ammod(x,Fc,Fs,ini_phase)
y = ammod(x,Fc,Fs,ini_phase,carramp)
Description
y = ammod(x,Fc,Fs) uses the message signal x to modulate a carrier signal with frequency Fc
(Hz) using amplitude modulation. The carrier signal and x have sample frequency Fs (Hz). The
modulated signal has zero initial phase and zero carrier amplitude, so the result is suppressed-
carrier modulation.
Note The x, Fc, and Fs input arguments must satisfy Fs > 2(Fc + BW), where BW is the
bandwidth of the modulating signal x.
y = ammod(x,Fc,Fs,ini_phase) specifies the initial phase in the modulated signal y in radians.
y = ammod(x,Fc,Fs,ini_phase,carramp) performs transmitted-carrier modulation instead of
suppressed-carrier modulation. The carrier amplitude is carramp.
Exercise :
Question 1
Plot the graph to modulate a 10 Hz sine wave which is sampled at 1000 hz.
Question 2
Plot the time and frequency domain representations(magnitude only) of the following:
A. Cos 2ft f = 2kHz
B. Square wave period = 1msec, amplitude = 2v
Question 3
Observe and write down the difference between Program1 and Program3.