LAB MANUAL
Page | 2
Lab Manual of Analog & Digital Communication
Table of Contents
Sr. No. Description Page No.
1 List of Equipment 4
Page | 3
Lab Manual of Analog & Digital Communication
List of Equipment
2 Function generator
3 Oscilloscope
4 Digital Multi-meter
5 Power supply
6 IC XR-2206
7 IC CD4046
8 IC LM565
9 Capacitors
10 Resistors
11 Diode
12 Probes
Page | 4
Lab Manual of Analog & Digital Communication
EXPERIMENT # 1
Generation of noise and observations of its effect on a sinusoidal signal
Objective
Familiarize students with the contents of the experiment and give them hands on experience regarding
the experiment
To learn the effect of noise on sinusoidal signal
Observe the filter output
Apparatus
Theory
The unwanted signal that gets introduced in a signal when it passes through any communication system is
termed as Noise. Generally Noise is classified with respect to its origin as internal or external noise; the
internal noise is generated by the components of the communication system itself while the external noise is
added to the signal due to the external fields developed due to other communication systems, power lines or
even due to human interference. With proper care the external noise can be minimized and can be even
removed, similarly with proper care the internal noise can be minimized but can never be eliminated. Noise is
one of the basic factors that limit the communication systems in terms of their performance. One of the
important parameters to observe is Signal to Noise ratio (S/N) which plays very important role in any
communication system. Shannon capacity defines maximum possible data rate for systems with noise and
distortion. In white Gaussian noise channels, the capacity of the channel can be given by C=B log (1+S/N).
Noise can also be classified in terms of its spectrum. Thermal noise one of the most common sources of
noise is also known as white noise because its spectrum is flat over the range of frequencies. White noise
analysis can be done stochastically and white noise is modeled as a random variable with probability density
function (pdf) which could be
Gaussian
Uniform
Procedure
1. Generate a sinusoidal wave from the signal generation block. Check its amplitude, set it to 2 V p-p
by using the amplifier block.
2. Now go to Main menu of trainer and select “Noise” then select the type of noise from the menu,
this will enable the noise generation part of the trainer.
3. There are two outputs and one input on the noise generation block, noise can be separately
observed from “Noise output block” where as total output after the addition of noise to the signal
can be extracted from “signal + noise output” block. Remember to connect the sinusoidal signal that
you generated in step1 to the “signal input block”.
4. Get the signal from the noise block and observe it on the oscilloscope.
5. Also observe the output from the signal plus noise block.
Page | 5
Lab Manual of Analog & Digital Communication
6. Using the filter module on the trainer use different filters to remove noise from the signal.
Graphical Analysis:
Sketch the output waveforms of the active and passive low-pass filters as seen on the oscilloscope for both
uniform and Gaussian noises. Also mention the time/div and volts/div for each channel.
Design a simple RC low pass filter and compare the output with your earlier observations.
POST LAB
1. Derive the cutoff frequency expression for a first order RC low pass filter?
2. What will happen if we use high order low pass filter?
Page | 6
Lab Manual of Analog & Digital Communication
EXPERIMENT # 2
Generation of AM signals
Objective
Familiarize students with the contents of the experiment and give them hands on experience regarding
the experiment
To observe the effect of modulation index in amplitude modulation
Apparatus
Theory
An amplitude modulated signal can be obtained by simply multiplying the message signal with the carrier
signal; that is, if is the message signal and is the carrier signal, then we can write the modulated
AM signal as
or
Therefore we need a simple multiplying unit for amplitude modulation. However there are different types of
modulators which include:
1. Multiplier Modulators
These modulators contain a simple a nalog multiplier circuit whose output is directly
proportional to the product of both signals
2. Non-linear modulators
These modulators use nonlinear devices such as semi-conductor diode or a transistor
for the purpose of modulation.
3. Switching modulators
These modulators use the principle of switching to obtain the approximate product of
carrier and the message signal, usually these modulators use square wave as carrier. Ring
modulator is an example of such a modulator.
Procedure
1. Generate a 2Vp-p, 100 Hz sinusoidal signal from the function generator block of communication
trainer.
2. Generate the sinusoidal carrier signal of 2Vp-p, 5 KHz from function generator.
Page | 7
Lab Manual of Analog & Digital Communication
3. Plug in the signal generated in step 1 to the input of DSB board, block labeled as “Modulating signal
input”.
4. Plug in the carrier signal generated in step 2 to the input of DSB board, block labeled as “Carrier
Signal Input”.
5. Get the output from the “modulated signal output” block of DSB board and observe it on
oscilloscope. Using the following three controls achieve the desired modulation.
Amplitude of Modulating Signal (Trainer)
Offset of Modulating Signal (Trainer)
Carrier Null Setting (DSB Board)
Graphical Analysis:
Sketch the waveforms of modulating signal, carrier signal and modulated signal. Also mention the time/div
and volts/div for each channel.
1. Generate a 2Vp-p, 1 kHz sinusoidal signal from the function generator block of RIMS
communication trainer.
2. Generate the sinusoidal carrier signal of 2Vp-p, 10 KHz from function generator.
3. Connect the modulating signal generated in step 1 to the input of “MOD IN-OUT” of function
generator.
4. To achieve the amplitude modulation using modulation block of function generator, keep the
following settings
a. Set the on/off button to “on”
b. Set the Int/Ext button to “Ext”
c. Set the AM/FM button to “AM”
d. Keep modulation knob at “Max"
5. Get the modulated output from the function generator and observe it on oscilloscope.
6. Change the voltage level of message signal to see the effect of modulation due to
increasing modulation index , as per given table
Modulation Index
1 0.75 0.5 0.25 1.25
(V) 1 1 1 1 1
(V)
7. Also decrease the frequency of the carrier signal gradually and observe the effect on the modulated
signal.
Page | 8
Lab Manual of Analog & Digital Communication
Graphical Analysis:
Sketch the modulated waveforms for all cases of modulation index. Also mention the time/div and volts/div
for each channel.
POST LAB
Page | 9
Lab Manual of Analog & Digital Communication
EXPERIMENT # 3
Demodulation of AM signals
Objective
Familiarize students with the contents of the experiment and give them hands on experience regarding
the experiment
To demodulate the modulated wave using envelope detector
Apparatus
Theory
Demodulation of the amplitude modulated signal can be achieved by using the modulators which are the
circuits used for modulation can also be used for demodulation. However we have to make following
changes:
The carrier input is also required. We can classify demodulators as either coherent or non-coherent
demodulators. Coherent demodulators require the carrier signal in addition to the modulated signal for
demodulating AM signal however non-coherent demodulators do not require carrier signal as input. An
example of such a demodulator is known as envelope detector which usually comprises of a diode followed
by a RC circuit.
Page | 10
Lab Manual of Analog & Digital Communication
Procedure
Coherent Demodulation
1. Generate an AM signal as done in part ‘a’ of previous experiment.
2. Using the mixer module on the trainer, demodulate the signal with carrier wave; note that the carrier
should be the same as used in the modulation process.
3. Compare the demodulated signal from the module with the original message signal.
Graphical Analysis:
Sketch the modulated signal and demodulated signal (mixer module) observe on the oscilloscope. Also
mention the time/div and volts/div for each channel.
Non-coherent Demodulation
3. Change different parameters of the modulated signal particularly modulation index and observe the
effect on the response of Envelope Detector.
Page | 11
Lab Manual of Analog & Digital Communication
Graphical Analysis:
Sketch the AM signal (for ) and the demodulated signal obtained from envelope detector. Also mention
the time/div and volts/div for each channel.
POST LAB
Page | 12
Lab Manual of Analog & Digital Communication
EXPERIMENT # 4
Frequency Modulation
Objective
Apparatus
Theory
The requirement of frequency modulation is to vary the frequency of the high frequency carrier signal
according to the amplitude of the message signal Frequency modulated signal can be generated by using
Direct method
Indirect method
1. The output frequency of a voltage controlled oscillator is directly proportional to the input voltage.
So if a message signal is supplied as input then the frequency of the output signal will contain
the amplitude changes of input signal in its frequency. This method is used commonly with a
feedback system which can generate an error voltage if the output frequency deviates far from the
centre frequency.
2. The frequency can be varied with respect to some message signal if the reactance of an LC circuit is
varied in proportion to the magnitude of the message signal
3. A Varactor diode can be used whose reactance changes with the input signal and hence output
frequency can be varied
For indirect method, the signal is first integrated and then phase modulated to get the required FM output.
However this type of modulation gives rise to Narrow Band FM signal which is then converted to
required range and bandwidth by using frequency multipliers and converters.
The modulation index is defined as the ratio of the maximum frequency deviation to the modulating
frequency. The maximum frequency deviation is the shift from center frequency when the amplitude of the
modulating signal is maximum.
Page | 13
Lab Manual of Analog & Digital Communication
Procedure
1. Obtain a 2V, 1 kHz sinusoidal signal from the function generator block.
2. Select the carrier frequency to 5 KHz.
3. Plug in the signal generated in step 1 to the input of modulator block labeled as “FM-IN”.
4. Get the output from the modulator block which will be frequency modulated.
5. Increase the voltage level of the message signal and observe the effect on modulated signal.
6. Also decrease the frequency of the carrier frequency gradually and observe the effect on the
modulated signal.
7. Repeat the experiment for triangular and square wave message signals.
8. Repeat step 7 for carrier signal.
Graphical Analysis:
Draw the message signal, carrier signal and frequency modulated signal as seen on the oscilloscope. Also
mention the time/div and volts/div for each channel.
Using XR-2206
Design a Frequency modulator for carrier frequency of 45 KHz using VCO of XR2206. Data sheet of IC
XR2206 is attached with this manual. You may not use the other sections of the chip. Observe the frequency
modulated signal on oscilloscope and note down the readings in the given table. Find the frequency Deviation
and calculate the Modulation index.
Graphical Analysis:
Draw the message signal, carrier signal and frequency modulated signal as seen on the oscilloscope. Also
mention the time/div and volts/div for each channel.
Experimental Results:
Table 4.1
Amplitude Frequency
Message signal
Carrier Signal
______
_______
Page | 14
Lab Manual of Analog & Digital Communication
Page | 15
Lab Manual of Analog & Digital Communication
Page | 16
Lab Manual of Analog & Digital Communication
Page | 17
Lab Manual of Analog & Digital Communication
Page | 18
Lab Manual of Analog & Digital Communication
Page | 19
Lab Manual of Analog & Digital Communication
Page | 20
Lab Manual of Analog & Digital Communication
Page | 21
Lab Manual of Analog & Digital Communication
EXPERIMENT # 5
Objective
Apparatus
IC CD4046
Resistor
Capacitor
Oscilloscope
Function generator
Theory
PLL stands for 'Phase-Locked Loop' and is basically a closed loop frequency control system, whose
functioning is based on the phase sensitive detection of phase difference between the input and output signals
of the controlled oscillator. The PLL is a useful building block in communication circuits. There are a wide
variety of uses for a PLL including FM and AM detection, phase tracking, frequency synthesis, and frequency
multiplication. The purpose of this lab is to look at the PLL characteristics.
Figure 1 shows the classic configuration of a PLL. It consists of three main components: a voltage-controlled
oscillator (VCO), a phase comparator, and a loop filter.
Page | 22
Lab Manual of Analog & Digital Communication
a) Free Running
When there is no signal or when the feedback loop is open, the VCO operates at a preset frequency
called its natural or free-running frequency (f0).
b) Capture
To be in the capture state there must be an input signal and the feedback loop must be closed. In the
capture state the PLL is in the process of acquiring a lock. The frequency range over which the input
will causes the loop to lock is called the acquisition range or capture range. Pull-in range is the
capture range expressed as a peak value. The lowest frequency the PLL can lock onto is called the
lower capture limit ( ), and the highest frequency the PLL can lock onto is called the upper capture
limit ( ).
The first part of the experiment focuses on the Voltage Controlled Oscillator and measurements will be made
of frequency vs. voltage characteristics of the VCO. The second part entails building a PLL with the VCO
Page | 23
Lab Manual of Analog & Digital Communication
from part one. Here, lock and capture ranges will be measured. We will be using CD4046 chip for VCO and
PLL implementation. Data sheet is provided along with the manual.
In order to design a VCO with specific characteristics, Figure 5-7 of the data sheet provide the necessary
component information. For example figure 5 shows how the center frequency varies with the capacitance C1,
resistance R1, and supply voltage VDD. Figure 6 & 7 gives information about the minimum and maximum
frequency respectively.
Procedure
1. Using the following component values and Figure 3 assemble the VCO on bread board.
2. The INHIBIT pin (Pin 5) must be grounded, and it is suitable for VSS (Pin 8) to be ground as well.
3. Make sure that the supply voltages are turned low and the power supply is initially off.
4. When this setup is complete, turn the power supply on.
5. Observe the output at Pin 4 on oscilloscope.
6. Increase the voltage on Pin 9, VCO in, up to 15V in steps. Record the frequency of the output
waveform at each step in Table 1.
Page | 24
Lab Manual of Analog & Digital Communication
Observations
0.0
1.5
3
4.5
6
7.5
9
10.5
12
13.5
15
To configure the CD4046 chip as a PLL we will use the VCO from the previous part and add the
external circuitry for loop filter. In this part we will observe the functioning of PLL and will measure the lock
and capture range of PLL. The lock range of a PLL is set by the VCO where as the capture range is set by the
loop filter. The capture range can be equal to the lock range or smaller, but never larger. In this experiment
the loop components are chosen to make the capture range equal to the lock range.
Procedure
1. Set up the circuit as shown in figure 4 with following loop filter components.
2. Select square wave from function generator and set the frequency close to center frequency of VCO.
Apply square wave signal at Pin 14 through the capacitor. Observe the applied signal on channel 1,
and the VCO (or PLL) output on channel 2 of oscilloscope. PLL should show a stable waveform and
have the same frequency as the input square wave.
3. To measure the lock range start from the center frequency and slowly decrease the input frequency
until the signals are just unlocking, this is the lower lock limit .
4. Then increase the frequency until the signals start to lock again; this is the lower capture limit .
Note that these frequencies will be pretty close to each other since the loop filter was designed to give
a capture range equal to the lock range.
5. Continue increasing the frequency until the signals are unlocked again this is the upper lock limit .
Page | 25
Lab Manual of Analog & Digital Communication
6. Lastly, decrease the frequency from this point until the signals are locked again; this is the upper
capture limit .
Observations
Table 5.2: PLL Characteristics
Lock range
Capture range
Page | 26
Lab Manual of Analog & Digital Communication
Page | 27
Lab Manual of Analog & Digital Communication
Page | 28
Lab Manual of Analog & Digital Communication
Page | 29
Lab Manual of Analog & Digital Communication
Page | 30
Lab Manual of Analog & Digital Communication
Page | 31
Lab Manual of Analog & Digital Communication
POST LAB
A PLL has a VCO with a free running frequency of 12MHz. As the frequency of the reference input signal is
gradually raised from zero, loop locks at 10MHz and comes out of lock again at 16MHz. Find the capture
range and lock range.
Page | 32
Lab Manual of Analog & Digital Communication
EXPERIMENT # 6
FM Demodulator
Objective
Apparatus
IC LM565
Resistors
Capacitors
DC power supply
Function Generator
Oscilloscope
Connecting probes and cables
Theory
Frequency demodulator, also called frequency discriminator, is a circuit, which converts instantaneous
frequency variations to linear voltage changes. There are many types of circuit used in communication system
as FM to AM conversion, balanced, and phase discriminators and phase-locked loop (PLL) frequency
demodulators.
1) Slope Detection
An operational amplifier differentiator followed by an envelope detector can serve the purpose of FM
demodulator.
A simple tuned circuit followed by an envelope detector can serve the purpose of demodulator because its
frequency response below or above the tuned frequency is approximately linear this method of
demodulation is known as slope detection. However the slope of |H (ω)| for such a demodulator is linear only
for a small band this problem can be removed by using Balanced discriminator or ratio detectors.
2) Zero-crossing detector
These are the frequency counters designed to measure the instantaneous frequency by counting the number
of zero crossings. The rate of zero crossings is equal to the instantaneous frequency of the signal.
Page | 33
Lab Manual of Analog & Digital Communication
3) Phase-locked loop
A basic phase locked loop is a simple control loop, which locks a VCO (voltage controlled
oscillator) to some reference frequency. The VCO in an oscillator with output frequency proportional to
input control voltage. We consider here only the process by which the loop stays “in lock” and the VCO
tracks the phase/frequency of the reference input. Therefore, the VCO adjusts itself so that the error signal
e(t) tends to zero. When e(t) is close to zero, r(t)~s(t) and v(t) ~m(t) (the message signal).
In this experiment we will introduce the operations of PLL frequency demodulator using LM565. The PLL
circuit of Figure 1 can be used as a frequency demodulator.
Procedure
Page | 34
Lab Manual of Analog & Digital Communication
Graphical Analysis
Sketch the frequency modulated and frequency demodulated waveforms as seen on the oscilloscope. Also
mention the time/div and volts/div for each channel.
POST LAB
1. What effect does changing the amplitude of the modulation signal have on the demodulated output?
2. Referring to Figure 4. How would you change the VCO free-running frequency from 20 to 50 KHz?
3. Why VCO control voltage used as the demodulated output?
Page | 35
Lab Manual of Analog & Digital Communication
Experiment # 7
Objective
Apparatus
XR2206
Oscilloscope
Function Generator
Power supply
Resistors
Capacitors
Theory
FSK modulation requires the swapping of frequency from one level to another. A “0” is transmitted by a
pulse of frequency and “1” is transmitted by using a pulse of frequency as show in figure 1. Hence the
binary information
1
is contained in the frequency of the carrier wave.
FSK signal can be generated by using two oscillators tuned at two different frequencies but connected to
single output terminal. ‘0’ can be transmitted by selecting the output of one of the oscillators while ‘1’ can be
transmitted by selecting the other oscillator. The selection between the two oscillators will be determined by
the message signal.
We will be using XR-2206 for Frequency Shift Keying. Data sheet is provided along with the manual. The
XR-2206 can be operated with two separate timing resistors and , connected to timing Pins 7 and 8
respectively, as shown in Figure 2. Depending on the polarity of the logic signal at Pin 9, either one or the
other of these timing resistors is activated. If Pin 9 is open-circuited or connected to a bias voltage , only
is activated. Similarly, if the voltage level at Pin 9 is , only is activated. Thus, the output
frequency can be keyed between two levels, and , as
and
Page | 36
Lab Manual of Analog & Digital Communication
Procedure
1. Design an FSK modulator to have f1 = 50,000 Hz and f2 = 10,000 Hz. Use any values of resistors or
capacitors. But remember to look at data sheet very carefully.
Table 7.1
=
C=
=
Graphical Analysis
Sketch the message signal and FSK modulated signal as seen on the oscilloscope. Also mention the time/div
and volts/div for each channel.
POST LAB
1. What will happen if we remove the resistor between 13 and 14 pin of XR-2206 IC?
2. What does variable resistor do in the given figure 2.
Page | 37
Lab Manual of Analog & Digital Communication
Experiment # 8
Pre-Emphasis & De-Emphasis
Objective
Learn how the characteristics of pre-emphasis and De-emphasis differ from each other
Apparatus
Oscilloscope
Function Generator
Resistors
Capacitors
Theory
The noise has an effect on the higher modulating frequencies than on the lower ones. Thus, if the higher
frequencies were artificially boosted at the transmitter and correspondingly cut at the receiver, an
improvement in noise immunity could be expected, thereby increasing the SNR ratio. This boosting of the
higher modulating frequencies at the transmitter is known as pre-emphasis and the compensation at the
receiver is called de-emphasis.
Procedure
Pre-emphasis
Page | 38
Lab Manual of Analog & Digital Communication
1k
3k
5k
7k
10 k
13 k
15 k
17 k
20 k
Graphical Analysis
Plot the graph between gain in dB vs. frequency of pre-emphasis network.
De-emphasis
Page | 39
Lab Manual of Analog & Digital Communication
1k
3k
5k
7k
10 k
13 k
15 k
17 k
20 k
Graphical Analysis
Plot the graph between gain (in dB) Vs. frequency of de-emphasis network.
POST LAB
Page | 40
Lab Manual of Analog & Digital Communication
Experiment # 9
Objective
Familiarize students with the contents of the experiment and give them hands on experience regarding
the experiment
To generate the pulse code modulated and demodulated signals
Apparatus
Theory
Pulse code modulation is basically the conversion of an analog signal to digital signal. A signal in its Analog
form can take on infinite number of values however it can attain only limited values in its digital form. An
analog signal can be converted to digital signal by means of sampling and quantization, which is rounding
off the sampled value to one of its closest number called quantization Levels.
The stream of pulses and non-pulse streams of 1’s and 0’s are not easily affected by interference and noise.
Even in the presence of noise, the presence or absence of a pulse can be easily determined. Since PCM is
digital, a more general reason would be that digital signals are easy to process by cheap standard techniques.
This makes it easier to implement complicated communication systems such as telephone networks (covered
later in this course).
The practical implementation of PCM makes use of other processes. The processes are carried out in the
order in which they appear below:
Filtering
Sampling
Quantizing
Encoding
The fil teri ng stage r emoves f requencies above the hi ghest si gnal frequency. These frequencies
if not removed, may cause problems when the signal is going through the stage of sampling. Generally, while
modulating a signal for PCM a simple A/D converter can be used.
Procedure
1. Generate a sinusoidal signal from the trainer and connect it to the analogue input part of the
“PAM\PCM” module on the trainer.
2. Observe the output of the “analogue Output” block.
3. Now Connect a square wave to the clock section of the module and move the selector switch to “ext”.
Page | 41
Lab Manual of Analog & Digital Communication
POST LAB
Page | 42
Lab Manual of Analog & Digital Communication
EXPERIMENT # 10
MATLAB Basics for Communication System Design
Objective
To understand the use of MATLAB for solving communication engineering problems.
Learn the basics of MATLAB as used in Analogue Communication.
To develop understanding of MATLAB environment, commands and syntax.
MATLAB
MATLAB is a powerful tool that is utilized by the engineers and others professionals in development and
testing of various projects. It is versatile software, with the help of which you can solve and develop any sort
of engineering problem. The name MATLAB stands for MATRIX LABORAORY. All the work done in
MATLAB is basically in the form of matrices. Scalars are referred as 1-to-1 matrix and vectors are matrices
having more than 1 row and column. MATLAB is programmable and have the same logical, relational,
conditional and loop structures as in other programming languages, such as C, Java etc. It’s very easy to use
MATLAB, all we need is to practice it and become a friend of it.
Summary:
Scalars
Vectors
Matrices
Plotting
m-files
functions
Getting Started:
a) Go to the start button, then programs, MATLAB and then start MATLAB. It is preferred that you
have MATLAB7. You can then start MATLAB by double clicking on its icon on Desktop, if there is
any.
b) The Prompt:
>>
The operator shows above is the prompt in MATLAB. MATLAB is interactive language like C, Java
etc. We can write the commands over here.
c) In MATLAB we can see our previous commands and instructions by pressing the up key. Press the
key once to see the previous entry, twice to see the entry before that and so on. We can also edit the
text by using forward and back-word keys.
Help in MATLAB
In order to use the built-in help of the MATLAB we use the help keyword. Write it on the prompt and see the
output.
Page | 43
Lab Manual of Analog & Digital Communication
Also try
Scalars
A scalar is a single number. A scalar is stored in the MATLAB as a 1 x 1 matrix. Try these on the prompt.
>> A = 2;
>> B = 3;
>> C = A^B
>> C = A*B
>> C = A+B
>> C = A-B
>> C = A/B
>> C = A\B
Try to implement these two relations and show the result in the provided space
a = 2.5, b = 5, c = -6
Vectors
Vectors are also called arrays in MATLAB. Vectors are declared in the following format.
>> X = [1 2 3 4]
>> Y = [2 5 8 9]
Page | 44
Lab Manual of Analog & Digital Communication
________________________________________________________________________________________
>> X’ = __________________
Also try some new instructions for this like and notice the outputs in each case.
There is an important operator, the colon operator (:), it is very important operator and frequently used during
these labs. Try this one.
>> X = [0:0.1:1]
What did the first and second number represent in the output of last instruction?
________________________________________________________________________________________
____________________________________________________________________
Page | 45
Lab Manual of Analog & Digital Communication
Length = ____________________
Size = ____________________
Try ‘help ones’ and ‘help zeros’ as well, and note down its important features.
MATRICES
>> B = [1,2,3;4,5,6;7,8,9]
Is there any difference between the two? Try to implement 2-to-3 matrix and 3-to-2 matrix.
Also take help on mod, rem, det, inv and eye and try to implement them. Try to use length and size
commands with these matrices as well and see the results.
1. 6x + 12y + 4z = 70
7x – 2y + 3z= 5
2x + 8y -9z = 64
2. A = [2 3 4 5; 1 8 9 0; 2 3 1 3; 5 8 9 3]
Solve 6A – 2I + A2 =
PLOTTING
Plotting is very important as we have to deal with various type of waves and we have to view them as well.
Try these and have a look on the results.
>> x = [0:0.1:10];
>> y = sin (x);
>> z = cos (x);
>> subplot (3,1,1);
>> plot (x,y);
>> grid on;
>> subplot (3,1,2);
>> plot (x,z);
>> grid on; hold on;
>> subplot (3,1,3);
Page | 46
Lab Manual of Analog & Digital Communication
See help on plot, figure, grid, hold, subplot, stem and other features of it.
Figure 10.1
Page | 47
Lab Manual of Analog & Digital Communication
M-FILES
MATLAB can execute a sequence of statements stored in disk files. Such files are called M-files because they
must have the file type ‘.m’. Lot of our work will be done with creation of m-files.
Script Files
We can use script files in order to write long programs such as one on the previous page. A script file may
contain any command that can be entered on the prompt. Script files can have any name but they should be
saved with “.m” extension. In order to excurse an m-file from the prompt, just type its name on the prompt.
You can make an m-file by typing edit on the prompt or by clicking on the file then new and m-file. See an
example of m-file. Write it and see the results.
% This is comment
clear;
clc;
x = [0:0.1:10];
y = sin (x);
subplot (2,2,1);
plot (x,y, ,'r');
grid on;
z = cos (x);
subplot (2,2,2);
plot (x,z);
grid on;
w = 90;
yy = 2*pi*sin (x+w)
subplot (2,2,3);
plot (x,yy);
grid on;
zz = sin (x+2*w);
subplot (2,2,4);
stem (x,zz, ,'g');
hold on;
stem (x,y, ,'r');
grid on;
Page | 48
Lab Manual of Analog & Digital Communication
Figure 10.2
Function Files
MATLAB have many built-in functions including trigonometry, logarithm, calculus and hyperbolic functions
etc. In addition we can define our own functions and we can use built-in functions in our functions files as
well. The function files should be started with the function definition and should be saved with the name of
function. The general format of the function file is
y = factorial (x);
POST LAB
Try to develop a function that will compute the maximum and minimum of two numbers.
Page | 49
Lab Manual of Analog & Digital Communication
Experiment # 11
Objective
To the use of MATLAB for generation of different signals important in communication theory.
Learn the basics of signals and its operations as used in Analogue Communication.
To develop understanding of communication signals and their properties.
Generation of Signals
Signals are represented mathematically as a function of one or more independent variables. We will generally
refer to the independent variable as time. Therefore we can say a signal is a function of time. Write these
instructions in m-file as execute to see the result.
Sinusoidal Sequence:
% Example 2.1
% Generation of sinusoidal signals
% 2sin( 2πτ-π/2)
t=[-5:0.01:5];
x=2*sin((2*pi*t)-(pi/2));
plot(t,x)
grid on;
axis([-6 6 -3 3])
ylabel ('x(t)')
xlabel ('Time(sec)')
title ('Figure 2.1')
Figure 11.1
See the output, change the phase shift value and observe the differences.
Page | 50
Lab Manual of Analog & Digital Communication
Figure 11.2
=0 n≠0
We are making a function named imseq and we further use this function in next experiments of this lab. The
MATLAB code is given below:
x = [(n-n0) == 0];
Page | 51
Lab Manual of Analog & Digital Communication
It is defined as
u(n) = 1 n ≥ 0
0 n≤0
We require an array operator “ .^ ” to implement a real exponential sequence. See the MATLAB code below
>> n = [0:10];
>> x = (0.9).^n;
It is define as:
Where a is called the attenuation and b is the frequency in radians. It can be implemented by following
MATLAB script.
>> n = [0:10];
Random Sequence:
Many practical sequences cannot be described by the mathematical expressions like above, these are called
random sequences. They depend upon the parameters like probability density function or their statistical
moments. In MATLAB two types of random sequences are available. See the code below:
And
Page | 52
Lab Manual of Analog & Digital Communication
The above instruction generates a length N random sequence whose elements are uniformly distributed
between [0,1]. And the last instruction, randn generates a length N Gaussian random sequence with mean 0
and variance 1. Plot these sequences.
% example 2.3
Figure 11.3
Periodic Sequences:
A sequence is periodic if it repeats itself after equal interval of time. The smallest interval is called the
fundamental period. Implement code given below and see the periodicity.
% Example 2.4
Page | 53
Lab Manual of Analog & Digital Communication
n = [0:4];
x = [1 1 2 -1 0];
subplot (2,1,1);
stem (n,x);
grid on;
axis ([0 14 -1 2]);
xlabel ('n');
ylabel ('x(n)');
title ('Figure 2.4(a)');
xtilde = [x,x,x];
length_xtilde = length (xtilde);
n_new = [0:length_xtilde-1];
subplot (2,1,2);
stem (n_new,xtilde,'r');
grid on;
xlabel ('n');
ylabel ('perodic x(n)');
title ('Figure 2.4(b)');
Figure 11.4
SIGNALS OPERATIONS:
Signal Addition
Page | 54
Lab Manual of Analog & Digital Communication
The length of x1 and x2 should be equal. See the MATLAB code below:
y1 = zeros(1,length(n)); % initialization
y2 = y1;
y = y1 + y2;
% Example 2.5
clear;
clc;
n1 = [0:10];
x1 = sin (n1);
n2 = [-5:7];
x2 = 4*sin(n2);
[y,n] = sigadd(x1,n1,x2,n2);
subplot (3,1,1);
stem (n1,x1);
grid on;
axis ([-5 10 -5 5]);
xlabel ('n1'); ylabel ('x1(n)');
title ('1st signal');
subplot (3,1,2);
stem (n2,x2);
grid on; hold on;
axis ([-5 10 -5 5]);
xlabel ('n2'); ylabel ('x2(n)');
title ('2nd signal');
subplot (3,1,3); stem (n,y,'r');
grid on;
Page | 55
Lab Manual of Analog & Digital Communication
Figure 11.5
Signal Multiplication:
The multiplication of two signals is basically sample by sample multiplication or you can say dot
multiplication. By definition it is
It is implemented by the array operator ‘ .* ‘ that we studied in last lab. A signal multiplication function is
developed that is similar to the sigadd function. See the code below:
_______________________________________________________
Page | 56
Lab Manual of Analog & Digital Communication
y1 = zeros(1,length(n)); % initialization
y2 = y1;
y = y1 .* y2;
% Example 2.6
clear;
clc;
n1 = [0:0.1:10];
x1 = sin (n1);
n2 = [-5:0.1:7];
x2 = 4*sin (n2);
[y,n] = sigmult(x1,n1,x2,n2);
subplot (3,1,1);
stem (n1,x1);
grid on;
axis ([-5 10 -5 5]);
xlabel ('n1');
ylabel ('x1(n)');
title ('1st signal');
subplot (3,1,2);
stem (n2,x2);
grid on;
hold on;
axis ([-5 10 -5 5]);
xlabel ('n2');
ylabel ('x2(n)');
title ('2nd signal');
subplot (3,1,3);
stem (n,y,'r');
grid on;
axis ([-5 10 -5 5]);
xlabel ('n');
ylabel ('y(n)');
title ('Multiplied Signals');
Page | 57
Lab Manual of Analog & Digital Communication
Figure 11.6
POST LAB
You are not allowed to multiply impulse sequences with a number. Implement this by using impseq, stepseq
and sigadd functions.
Page | 58
Lab Manual of Analog & Digital Communication
Experiment # 12
Communication Signals: Operations
Objective
SUMMARY
Signal operations (Scaling, Shifting, Folding, Sample Summation, Sample product, Energy, Even
and Odd sequences, Convolution)
SIGNAL OPERATIONS:
1. Scaling:
In this operation the samples of the signal is multiplied by a scalar α. The mathematical operator * is
used for the implementation of the scaling property.
α{x(n)} = { α x(n)}
>> a = 2;
>> y = a*x;
2. Shifting
In this operation, each sample of the signal is shifted by k to get a shifted signal. By definition:
y(n) = {x (n-k)}
In this operation there is no change in the array or vector x, that contains the samples of the signal. Only n
is changed be adding k to each element. The function is given below:
Page | 59
Lab Manual of Analog & Digital Communication
% [y,n] = sigshift(x,m,n0)
n = m+n0;
y = x;
% Example 3.1
% This example demonstrate the use of stepseq, sigshift, sidadd & sigmult function
clc; clear;
%--------------------------------------------
subplot (3,2,1);
stem (n,x);
grid on;
xlabel ('n');
ylabel ('x(n)');
%----------------------------------------------
[y1,n1] = sigshift(x,n,2.5);
subplot (3,2,2);
stem (n1,y1);
grid on;
xlabel ('n');
ylabel ('y1(n)');
Page | 60
Lab Manual of Analog & Digital Communication
%-----------------------------------------------
subplot (3,2,4);
stem (n2,y2);
grid on;
xlabel ('n');
ylabel ('y2(n)');
%-------------------------------------------------
[y_add,n_add] = sigadd(y1,n1,y2,n2);
subplot (3,2,6);
stem (n_add,y_add,'r');
grid on;
xlabel ('n');
%---------------------------------------------------
[y_mul,n_mul] = sigmult(y1,n1,y2,n2);
subplot (3,2,5);
stem (n_mul,y_mul,'k');
grid on;
xlabel ('n');
%---------------------------------------------------
Page | 61
Lab Manual of Analog & Digital Communication
Figure 12.1
3. Folding:
In this operation each sample of x(n) is flipped around n=0 to obtain a folded signal y(n).
y (n) = {x(-n)}
In MATLAB, this function is implemented by using a built-in function fliplr(x) and –fliplr(x). Its
implementation is given below:
% [y,n] = sigfold(x,n)
y = fliplr(x);
n = -fliplr (n);
Page | 62
Lab Manual of Analog & Digital Communication
4. Sample Summation:
This operation is different from sigadd function. In this operation we add all the sample values of any
signal x(n) between any two of its index values. By definition
In MATLAB it is implemented by the sum(x(n1:n2)) command. See the code below for the demonstration of
above function.
>> sum(x(2:7))
5. Sample Product:
This operation also differs from the sigmult function. It implies the sample values over the range n1:n2. It is
implemented by the prod(x(n1:n2)). See the code below.
>> x = [0 1 2 3 4 5]
>> prod(x(2:5))
6. Energy:
Where the subscript * is used for complex conjugate of the signal x. The energy of the finite duration signal is
computed in MATLAB as.
Or
A real valued sequence xe(n) is called even if the following condition satisfies.
xe(-n) = xe(n)
xo(-n) = -xo(n)
% example 3.2
n1 = [0:0.01:1];
Page | 63
Lab Manual of Analog & Digital Communication
x1 = 2*n1;
n2 = [1:0.01:2];
x2 = -2*n2+4;
n = [n1,n2];
x = [x1,x2];
%Even Signal
[xe,ne] = sigfold(x,n);
subplot (3,1,1);
plot (n,x);
grid on;
subplot (3,1,2);
plot (n,x/2,ne,xe/2);
grid on;
xo = -xe;
no = ne;
subplot (3,1,3);
plot (n,x/2,no,xo/2);
grid on;
Page | 64
Lab Manual of Analog & Digital Communication
Figure 12.2
The above example shows to develop the even and odd signals from a given signal. Now we are going to
develop a function to compute the even and odd signals for ourselves. See the code of function file below:
% [xe,xo,m] = evenodd(x,n)
% xe = even signal
% xo = odd signal
% m = indexes
% x = original signal
if any(imag(x)~=0)
end
m = -fliplr(n);
m1 = min([m,n]);
m2 = max([m,n]);
m = m1:m2;
nm = n(1)-m(1);
Page | 65
Lab Manual of Analog & Digital Communication
n1 = 1:length(n);
x1 = zeros(1,length(m));
x1(n1+nm) = x;
x = x1;
xe = 0.5*(x+fliplr(x));
xo = 0.5*(x-fliplr(x));
Now change the example 3.2 code to implement the same example with this function.
8. Convolution:
The convolution is very important operation as far the system as their impulse responses are concern. It is
mathematically defines as:
Where h(n) is the impulse response of the system. The above definition is best depicted by the following
diagram.
>> x = [1 5 3 9 1 2 3 8 5 -3 0 4];
>> h = [1 0 2 3];
>> y = conv(x,h);
A function is developed which will evaluate convolution in a more precise form and also calculate the indexes
to help us plot the sequences.
% [y,ny] = conv_m(x,nx,h,nh)
% x = original signal
% nx = index values
Page | 66
Lab Manual of Analog & Digital Communication
ny = [nyb:nye];
y = conv(x,h);
POST LAB
a. x(n) = u(n) – u(n-5). Decompose into even and odd components and plot them.
b. The impulse response of LTI system is h (n) = delta (n-2), if the input to this system is a arbitrary
sequence x(n) of length 10, then plot the original and the convolved outputs of the system. What is the
change if the h(n) = x(n) and input signal is now the previous impulse response of the system.
c. n = [-2:2]
x1 = [3,2,1,-2,-3];
x2 = [1,1,1,1,1]
Implement y = x1*x2
Page | 67
Lab Manual of Analog & Digital Communication
Experiment # 13
Objective
This section deals with looking at the spectrum of simple waves. We first look at the 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 13.1.
Figure 4
Figure 13.1
Spectrum of a simple sine wave: - Figure 13.2 shows the design for viewing the spectrum of a simple sine
wave.
Page | 68
Lab Manual of Analog & Digital Communication
Figure 13.2
Figure 13.3 shows the time-domain sine wave and the corresponding frequency domain is shown in figure
13.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 13.5.
Figure 13.3
Page | 69
Lab Manual of Analog & Digital Communication
Figure 13.4
Figure 13.5
Page | 70
Lab Manual of Analog & Digital Communication
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.
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.
Figure 13.6
Page | 71
Lab Manual of Analog & Digital Communication
The following figure demonstrates the waveform multiplication. A sine wave of 1 kHz is generated using a
sine wave generator and multiplied with a replica signal. The input signal and the output are shown in figures.
It can be seen that the output of the multiplier in time domain is basically a sine wave but doesn’t have the
negative sides since they get cancelled out in the multiplication.
Figure 13.7
The spectral output of the spectrum is shown below. It can be seen that there are two side
components in spectrum. The components at fc + fm and –(fc + fm) can be seen along with a central
impulse.
Figure 13.8
Page | 72
Lab Manual of Analog & Digital Communication
Figure 13.9
Figure 13.10
Page | 73
Lab Manual of Analog & Digital Communication
The output is shown below. It can be seen that the output consists of just two side bands at +(fc +
fm) and the other at –(fc + fm) , i.e. at 9kHz and 11kHz.
Figure 13.11
By multiplying the carrier signal and the message signal, we achieve modulation.
We observe the output to have no 10 KHz component i.e., the carrier is not present. The output contains a
band at 9 KHz (fc-fm) and a band at 11 KHz (fc + fm). Thus we observe a double side band suppressed
carrier. All the transmitted power is in the 2 sidebands.
By varying the carrier and message signal frequencies, we observe that the 2 sidebands move according
to equation fc ± fm.
Now, using a square wave as modulating signal, we see that DSBSC is still achieved.
The output from spectrum analyzer was slightly different from the theoretical output. In the result from
the spectrum analyzer, there is a small peak at frequency = 10kHz (the carrier frequency) and other 2
peak at 0 and 1000 Hz. This may caused by the incorrectly calibrated multiplier.
Next, the changes to the waveform parameters have been made and then the outputs have been observed.
And here are the changes that have been made
Page | 74
Lab Manual of Analog & Digital Communication
Figure 13.12
Amplitude Modulation
This experiment is the amplitude modulation for modulation index a = 1 and 0.5.
From the equation of the AM
y = km (1 + a ⋅ cos(2π (1000)t) ⋅ cos(2π (10000)t
The representation of the signal in both time-domain and frequency domain when km=1 for a=1 and
a=0.5 were found to be as shown in figures.
The experimental set up for generating an AM signal looks like this: -
Page | 75
Lab Manual of Analog & Digital Communication
Figure 13.12
Figure 13.13
Page | 76
Lab Manual of Analog & Digital Communication
Figure 13.14
Figure 13.15
It must be noted here that the A.M signal can be converted into a DSB-SC signal by making the constant
= 0.
The waveforms at various levels of modulation are shown in the following figures.
Page | 77
Lab Manual of Analog & Digital Communication
Figure 13.16
Figure 13.17
Page | 78
Lab Manual of Analog & Digital Communication
Figure 13.18
The results from the experiment were shown. The results from the experiment are pretty much the same
as in the theoretical ones except there are 2 other peaks at 0 and 1000 kHz. This is the same as earlier
experiment. The cause of this problem is probably the multiplier.
The last experiment in this section is the two tone modulation. In this experiment, the 2 kHz signal had
been added to the modulating signal in the above experiment. Theoretically, the representation of the
modulated signal in time-domain and frequency domain would have been as in the figure below. In the
figure, 1 kHz and 2 kHz signals were modulated with 10 kHz carrier.
Figure 13.19
Page | 79
Lab Manual of Analog & Digital Communication
Figure 13.20
Figure 13.21
The two-tone signal is amplitude modulated using the same block model discussed in the previous
section. The output spectrum is shown in figure. In this case the signals of 1 kHz and 2 kHz are modulated
by a 10kHz carrier. The output spectrum is shown in figure
Page | 80
Lab Manual of Analog & Digital Communication
Figure 13.21
The result from the experiment was shown. The highest peak is at the carrier frequency as in the theoretical
result. But there were differences on the sidebands. In the figure from MATLAB, both frequencies in the
sidebands have the same magnitude, but from the experiment, the components at 9000Hz and 11000Hz have
higher magnitude than the components at 8000Hz and 12000 Hz. There’re also many small peaks of about
1000Hz apart in the experiment result. This might come from the incorrectly calibrated multiplier.
The final experiment in this section is to change the carrier frequency and the modulating frequency. When
the carrier frequency increases, the spectrum of the modulated signal is expected to have the two
sidebands centered at the new carrier frequency. And when one of the two modulating signals changes in
frequency, the spectrum of the output signal should have two components move away from their original
positions according to the change in frequency. The result from the experiment was shown. Both change in
carrier frequency and modulating frequency is shown.
The output is going to be a side band. The output of this setup before and after the Filtering is shown in
figures and figure. It can be noted that the output of the SSB signal before filtering has the higher order
frequency components which are eliminated by the filter.
Figure 13.23
Instead of using a filter, the same task can be achieved by using a phase shifter and summer in conjunction
with the existing circuit. Operating the summer as an adder causes the USB to be produced. If the summer
is operated as an inverter, then, the LSB will be retained.
Without filtering
Figure 13.24
Page | 82
Lab Manual of Analog & Digital Communication
After filtering the higher order components are removed and we get a wave form of the form shown in
figure
Figure 13.25
Figure shows the experimental setup for the Phase Shift SSB Modulation. The signal consists of four
input sine waves.
Figure 13.26
Page | 83
Lab Manual of Analog & Digital Communication
The output of the difference block in both the time domain and the frequency domain is of importance
to us.
When the sign is +-, it represents the lower side band and the wave form for ++ represents the upper-side
bands respectively. The output spectrum is shown in figure.
Figure 13.27
Figure 13.28
Conclusion
We learnt how to operate the spectrum analyzer, oscilloscope and the function generator to generate and
view different waveforms. We also performed the different modulation schemes – DSBSC, AM and SSB.
We conclude that the DSBSC modulating system is better as no power is lost in the carrier. SSB permits
more of the information to be transmitted over the same channel by chopping off the duplicate sideband.
Page | 84
Lab Manual of Analog & Digital Communication
POST LAB
1. If message and carrier signal is a square and sine wave having frequency 1KHz and 10Khz
respectively. Then Sketch the spectrum of modulated signal?
2. Draw simulink block diagram of given spectrum?
Magnitude Response
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
Frequency (in hertz) 4
x 10
Figure 13.29
Page | 85
Lab Manual of Analog & Digital Communication
Experiment # 14
In this first part of the lab we will focus on a couple of simple examples and plot their spectrum, in
time and in frequency domain. In second part of this lab we will write the code for Amplitude
modulation with carrier and suppress carrier and then focus on two tune modulation and at the end
of this lab we will write a code for single side band.
Sketch the time and frequency domain representations (magnitude only) of the following
The time and frequency domain of the input signal is shown as below.
CODE:
%% Time specifications: 1
Fs = 10000;
dt = 1/Fs; 0.5
Magnitude
StopTime = 0.5;
t = (0:dt:StopTime-dt)'; 0
N = size(t,1);
-0.5
Fc = 1000;
x = cos(2*pi*Fc*t); -1
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
Time
subplot(2,1,1)
plot(t,x); 0.8
axis([0 1/100 -1 1]);
xlabel('Time'); 0.6
Magnitude
ylabel('Magnitude')
%% Fourier Transform: 0.4
X = fftshift(fft(x));
%% Frequency specifications: 0.2
dF = Fs/N;
f = -Fs/2:dF:Fs/2-dF; 0
%% Plot the spectrum: -5000 -4000 -3000 -2000 -1000 0 1000 2000 3000 4000 5000
subplot(2,1,2) Frequency (in hertz)
plot(f,abs(X)/N);
xlabel('Frequency (in hertz)'); Figure 14.1 Spectrum of cos 2000πt
ylabel('Magnitude')
Page | 86
Lab Manual of Analog & Digital Communication
Fs = 1000000; 2
dt = 1/Fs;
StopTime = 0.5; 1
Magnitude
t = (0:dt:StopTime-dt)';
N = size(t,1); 0
Fc = 1000; -1
x = SQUARE(2*3.14*Fc*t);
-2
subplot(2,1,1) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
plot(t,x); Time -3
axis([0 1/200 -2 2]); x 10
xlabel('Time');
ylabel('Magnitude');
%% Fourier Transform: 0.4
X = fftshift(fft(x));
Magnitude
C. Cos2(2πft) f = 1kHz
1
Fs = 30000; 0.5
Magnitude
dt = 1/Fs;
StopTime = 0.5; 0
t = (0:dt:StopTime-dt)';
N = size(t,1); -0.5
Fc = 1000; -1
x = cos(2*pi*Fc*t); 0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
x=x.*x; Time
subplot(2,1,1)
plot(t,x);
xlabel('Time'); 0.6
ylabel('Magnitude');
Magnitude
Page | 87
Lab Manual of Analog & Digital Communication
Fs = 30000; 1
dt = 1/Fs;
StopTime = 0.5; 0.5
Magnitude
t = (0:dt:StopTime-dt)';
N = size(t,1); 0
Fc1 = 300;
x1 = cos(2*pi*Fc1*t); -0.5
Fc2 = 5000;
x2 = cos(2*pi*Fc2*t);
x=x1.*x2; -1
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
subplot(2,1,1) Time
plot(t,x);
axis([0 1/100 -1 1]);
xlabel('Time');
ylabel('Magnitude'); 0.4
Magnitude
X = fftshift(fft(x)); 0.3
dF = Fs/N;
0.2
f = -Fs/2:dF:Fs/2-dF;
subplot(2,1,2) 0.1
plot(f,abs(X)/N);
axis([-6000 6000 0 0.5]); 0
xlabel('Frequency (in hertz)'); -6000 -4000 -2000 0 2000 4000 6000
ylabel('Magnitude'); Frequency (in hertz)
Fs = 30000; 2
dt = 1/Fs;
StopTime = 0.5; 1
t = (0:dt:StopTime-dt)';
Magnitude
N = size(t,1);
Fc1 = 300; 0
x1 = cos(2*pi*Fc1*t);
Fc2 = 5000; -1
x2 = cos(2*pi*Fc2*t);
x=(1+x1).*x2;
subplot(2,1,1) -2
0 0.002 0.004 0.006 0.008 0.01
plot(t,x);
axis([0 1/100 -2 2]); Time
xlabel('Time');
ylabel('Magnitude')
X = fftshift(fft(x)); 0.4
Magnitude
dF = Fs/N;
f = -Fs/2:dF:Fs/2-dF;
%% Plot the spectrum:
subplot(2,1,2) 0.2
plot(f,abs(X)/N);
xlabel('Frequency (in hertz)');
ylabel('Magnitude') 0
-6000 -4000 -2000 0 2000 4000 6000 8000
Frequency (in hertz)
Figure 14.5 Spectrum of AM-WC (µ = 1)
Page | 88
Lab Manual of Analog & Digital Communication
Magnitude
t = (0:dt:StopTime-dt)';
N = size(t,1); 0
Fc1 = 300;
x1 = cos(2*pi*Fc1*t); -1
Fc2 = 5000;
x2 = cos(2*pi*Fc2*t);
-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
x=(1+0.5*x1).*x2;
Time
subplot(2,1,1)
plot(t,x);
axis([0 1/100 -2 2]);
xlabel('Time');
ylabel('Magnitude'); 0.6
Magnitude
X = fftshift(fft(x)); 0.4
dF = Fs/N; 0.2
f = -Fs/2:dF:Fs/2-dF;
subplot(2,1,2)
plot(f,abs(X)/N);
zoom on -6000 -4000 -2000 0 2000 4000 6000
xlabel('Frequency (in hertz)'); Frequency (in hertz)
ylabel('Magnitude'); Figure 14.6 Spectrum of AM-WC (µ = 0.5)
StopTime = 0.5;
t = (0:dt:StopTime-dt)'; 0
N = size(t,1);
Fc1 = 1000; -1
x1 = cos(2*pi*Fc1*t);
Fc2 = 2000;
x2 = cos(2*pi*Fc2*t); -2
Fc3 = 10000; 0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
x3 = cos(2*pi*Fc3*t); Time
x=(x1+x2).*x3; 0.4
subplot(2,1,1)
plot(t,x); 0.3
Magnitude
xlabel('Time');
ylabel('Magnitude');
axis([0 1/100 -2 2]); 0.2
X = fftshift(fft(x)); 0.1
dF = Fs/N;
f = -Fs/2:dF:Fs/2-dF; 0
subplot(2,1,2) -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
plot(f,abs(X)/N); Frequency (in hertz) 4
x 10
xlabel('Frequency (in hertz)'); Figure 14.7 Spectrum of Two Tune Modulation (SC)
ylabel('Magnitude');
Page | 89
Lab Manual of Analog & Digital Communication
Fs = 40000;
2
dt = 1/Fs;
StopTime = 1;
t = (0:dt:StopTime-dt)'; 1
Magnitude
N = size(t,1);
Fc1 = 1000; 0
x1 = cos(2*pi*Fc1*t);
Fc2 = 2000; -1
x2 = cos(2*pi*Fc2*t);
Fc3 = 10000; -2
x3 = cos(2*pi*Fc3*t); 0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
Time
x=(1+(x1+x2)).*x3;
0.8
subplot(2,1,1)
plot(t,x);
0.6
xlabel('Time');
Magnitude
ylabel('Magnitude');
axis([0 1/100 -2 2]); 0.4
0.2
X = fftshift(fft(x));
dF = Fs/N;
f = -Fs/2:dF:Fs/2-dF; 0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
subplot(2,1,2) Frequency (in hertz) 4
plot(f,abs(X)/N); x 10
xlabel('Frequency (in hertz)'); Figure 14.8 Spectrum of Two Tune Modulation ( µ =1)
ylabel('Magnitude');
-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
0.8
Amplitude
0.6
0.4
0.2
-1 -0.5 0 0.5 1
Frequency (in hertz) 4
x 10
Figure 14.9 Spectrum of Two Tune Modulation ( µ = 0.5)
Page | 90
Lab Manual of Analog & Digital Communication
-2
0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01
0.5
0
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
4
x 10
Uper Side Band (USB)
1
0.5
0
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
4
x 10
Figure 14.8 Spectrum of SSB
POST LAB
Page | 91
Lab Manual of Analog & Digital Communication
Notice:
Copying and plagiarism of lab reports is a serious academic misconduct. First instance of copying
may entail ZERO in that experiment. Second instance of copying may be reported to DC. This may
result in awarding FAIL in the lab course.
Page | 92
Lab Manual of Analog & Digital Communication
Remember that the voltage of the electricity and the available electrical current in EE labs
has enough power to cause death/injury by electrocution. It is around 50V/10 mA that the
“cannot let go” level is reached. “The key to survival is to decrease our exposure to energized
circuits.”
If a person touches an energized bare wire or faulty equipment while grounded, electricity
will instantly pass through the body to the ground, causing a harmful, potentially fatal, shock.
Each circuit must be protected by a fuse or circuit breaker that will blow or “trip” when its
safe carrying capacity is surpassed. If a fuse blows or circuit breaker trips repeatedly while in
normal use (not overloaded), check for shorts and other faults in the line or devices. Do not
resume use until the trouble is fixed.
It is hazardous to overload electrical circuits by using extension cords and multi-plug outlets.
Use extension cords only when necessary and make sure they are heavy enough for the job.
Avoid creating an “octopus” by inserting several plugs into a multi-plug outlet connected to a
single wall outlet. Extension cords should ONLY be used on a temporary basis in situations
where fixed wiring is not feasible.
Dimmed lights, reduced output from heaters and poor monitor pictures are all symptoms of
an overloaded circuit. Keep the total load at any one time safely below maximum capacity.
If wires are exposed, they may cause a shock to a person who comes into contact with them.
Cords should not be hung on nails, run over or wrapped around objects, knotted or twisted.
This may break the wire or insulation. Short circuits are usually caused by bare wires
touching due to breakdown of insulation. Electrical tape or any other kind of tape is not
adequate for insulation!
Electrical cords should be examined visually before use for external defects such as: Fraying
(worn out) and exposed wiring, loose parts, deformed or missing parts, damage to outer
jacket or insulation, evidence of internal damage such as pinched or crushed outer jacket. If
any defects are found the electric cords should be removed from service immediately.
Pull the plug not the cord. Pulling the cord could break a wire, causing a short circuit.
Plug your heavy current consuming or any other large appliances into an outlet that is not
shared with other appliances. Do not tamper with fuses as this is a potential fire hazard. Do
not overload circuits as this may cause the wires to heat and ignite insulation or other
combustibles.
Keep lab equipment properly cleaned and maintained.
Ensure lamps are free from contact with flammable material. Always use lights bulbs with
the recommended wattage for your lamp and equipment.
Be aware of the odor of burning plastic or wire.
ALWAYS follow the manufacturer recommendations when using or installing new lab
equipment. Wiring installations should always be made by a licensed electrician or other
qualified person. All electrical lab equipment should have the label of a testing laboratory.
Be aware of missing ground prong and outlet cover, pinched wires, damaged casings on
electrical outlets.
Page | 93
Lab Manual of Analog & Digital Communication
Inform Lab engineer / Lab assistant of any failure of safety preventive measures and safe
practices as soon you notice it. Be alert and proceed with caution at all times in the
laboratory.
Conduct yourself in a responsible manner at all times in the EE Labs.
Follow all written and verbal instructions carefully. If you do not understand a direction or
part of a procedure, ASK YOUR LAB ENGINEER / LAB ASSISTANT BEFORE
PROCEEDING WITH THE ACTIVITY.
Never work alone in the laboratory. No student may work in EE Labs without the presence
of the Lab engineer / Lab assistant.
Perform only those experiments authorized by your teacher. Carefully follow all
instructions, both written and oral. Unauthorized experiments are not allowed.
Be prepared for your work in the EE Labs. Read all procedures thoroughly before entering
the laboratory. Never fool around in the laboratory. Horseplay, practical jokes, and pranks
are dangerous and prohibited.
Always work in a well-ventilated area.
Observe good housekeeping practices. Work areas should be kept clean and tidy at all times.
Experiments must be personally monitored at all times. Do not wander around the room,
distract other students, startle other students or interfere with the laboratory experiments of
others.
Dress properly during a laboratory activity. Long hair, dangling jewelry, and loose or baggy
clothing are a hazard in the laboratory. Long hair must be tied back, and dangling jewelry
and baggy clothing must be secured. Shoes must completely cover the foot.
Know the locations and operating procedures of all safety equipment including fire
extinguisher. Know what to do if there is a fire during a lab period; “Turn off equipment, if
possible and exit EE lab immediately.”
Page | 94
Lab Manual of Analog & Digital Communication
Introduction
An RC circuit is a first order circuit that utilizes a capacitor as an energy storage element whereas a
resistor as an energy wastage element. RC circuits are building blocks of electronic devices and their
thorough understanding is important in comprehending advance engineering systems such as
transistors and transmission lines.
An RC circuit can be operated with both DC and AC sources. In this lab we study transient response
of RC circuits with a square wave as a DC source. During the DC operation of an RC circuit the
voltage across the capacitor or the resistor show energy storing (capacitor charging) and dissipating
(capacitor discharging via resistor) mechanisms of the circuit. The capacitor charging or discharging
curves then lead to determine time constant of the circuit where the time constant signifies time
required by the RC circuit to store or waste energy.
Objective:
To study transient response of a series RC circuit
Measurements:
The circuit used for the experiment is shown in Fig. 1.
Page | 95
Lab Manual of Analog & Digital Communication
Both input (a square wave) and output (voltage across capacitor) waveforms are monitored on an
oscilloscope. The capacitor charging is observed during "on" part of the square waveform whereas
the capacitor discharging is observed during "off" part of the square waveform (Fig. 2). We measure
the time constant from the capacitor charging or discharging curve. While keeping the capacitor
value constant, we also measure time constants with various resistor values (Table I).
Resistance
270 330 470 1k 2.2 k 3.3 k
(Nominal)
Time constant
(Calculated)
Time constant
(Measured)
Conclusions:
From the measurements following conclusions can be drawn:
Both of the above conclusions are also easily verifiable by solving differential equation for the RC
circuit.
Applications:
An RC circuit can be employed for a camera flash. The capacitor discharges through the flash light
during a picture taking event.
Page | 96