Anda di halaman 1dari 94

Lab Manual

Communication Systems
(EE – 03306)

Revised By:
Faraz Hasan Khan

Revised On:
19th April, 2018

Department of Electrical Engineering


The University of Lahore.
1-Km Defence Road, Lahore. Pakistan

1|Page
Revision History:

Revised Date Revised By Revised Topics

1. Introduction to MATLAB with


February 20, 2014 Onaiza Yousaf Special Emphasis on Signal
Generation
2. Estimation of Signal Energy in
MATLAB
3. Calculating Correlation of Signals in
MATLAB
4. Calculation of Essential Bandwidth
by Numerical Method

Aqib N Malik 1. Except first two Experiments in each


February 10, 2015 experiments hardware part is
included.
2. According to HEC contents list
Digital communication experiments
at the end are also included.
3. Hardware based assignments are
added at the end to most of labs.
December 1,2015 Saba Zia 1. The manual has been modified to target
software based solutions as hardware
based experiments have a
separate solution manual.
December 1,2016 Faraz Hasan Khan 1. No revision required for software
based labs.
2. CT-3000’s lab manual will be followed
for hardware based labs.

November 23, 2018 Arooj Unbreen 1. Labs 1 to 6, 8 & 9 has been modified
as per OBE guidelines.
Rabia Arshad 2. Open Ended Labs (Lab 7 and 16)
and Labs 10 to 15 has been modifies
as per OBE guidelines.
April 19,2019 Faraz Hasan Khan 1. All the labs were updated by adding
hardware experiments based on CT-
300 hardware trainers.

2|Page
CERTIFICATE OF APPROVAL

It is certified that the lab manual titled “Communication System”, in scope and in quality,
covers the objectives and topics defined in the course outline.

Remarks: -------------------------------------------------
Dr. Nasir Khan
Professor
Department of Electrical Engineering
The University of Lahore

Remarks by HOD: -------------------------------------------------


Col. Salamat Ullah
HOD
Department of Electrical Engineering
The University of Lahore

3|Page
Course Learning Outcomes:
After successful completion of the course, a student should be able to:
Taxonomy Mapped
CLO# CLO Description Domain
Level PLO
Investigate the performance of various techniques
CLO5 Cognitive 5 PLO4
used in communication system via MATLAB.
Seek to manage project in an allotted time Affective 3
CLO7 PLO11

List of Lab Experiments:


Lab # Lab Title Mapped CLO(s)
1 Introduction and Revision of Basic Signals Operations CLO 5
2 Fourier Series Computation CLO 5
3 Implement modulation and demodulation of AM signal CLO 5
4 To design and implement the AM Modulator by balanced modulator CLO 5
5 Implement modulation and demodulation of signal using DSB-SC CLO 5
6 Implement modulation and demodulation of signal using SSB-SC CLO 5
7 An Open Ended Lab CLO 5
8 Implement modulation and demodulation of signal using FM CLO 5
9 Sampling and reconstruction of low-pass signal CLO 5
10 Digitization of Analog Signal using Quantization CLO 5
11 Implement Pulse code modulation technique CLO 5
12 Implement the phase shift keying CLO 5
13 Implement the frequency shift keying CLO 5
14 Implement the frequency hopping spread spectrum communication CLO 5
15 Implement the source coding using Hamming code CLO 5
16 An Open Ended Lab CLO 5
17 Project CLO 7

4|Page
Contents

Lab 1: Introduction and Revision of Basic Signals Operation. .............................. 6


Lab 2: Fourier Series Computation. ..................................................................... 21
Lab 3: Implement modulation and demodulation of AM signal .......................... 33
Lab 4: Implement the AM Modulator by using balanced modulator................... 27
Lab 5: Implement modulation and demodulation of signal using DSB-SC ........ 38
Lab 6: Implement modulation and demodulation of signal using SSB-SC ......... 44
Lab 7: Open-Ended Lab ....................................................................................... 50
Lab 8: Implement modulation and demodulation of signal using FM ................. 52
Lab 9: Sampling and Reconstruction of low-pass Signal .................................... 58
Lab 10: Digitization of Analog Signal using Quantization ................................... 60
Lab 11: Implement the Pulse Code Modulation (PCM) Technique .................... 66
Lab 12: Implement the Phase Shift Keying.......................................................... 74
Lab 13: Implement the Frequency Shift Keying. ................................................. 82
Lab 14: Implement the Frequency Hopping Spread Spectrum (FHSS)
Communication. .................................................................................................... 87
Lab 15: Implement the Source Coding using Huffman Code. ............................. 89
Lab 16: Open-Ended Lab ..................................................................................... 91

5|Page
Lab 1: Introduction and Revision of Basic Signals Operation.
Objective

To become familiar with the use of some basic signals (unit step and delta) and signal
operations such as time scaling, time shifting, inversion or folding.

Pre-Lab
Sound Knowledge of Signals and basic signal operations.

Equipment/Software used
Computer System with installed MATLAB

Introduction
Signals are represented mathematically as functions of one or more independent variables. For
convenience, we generally refer to the independent variable as time. Signals are broadly
classified into analog and discrete signals.
An analog signal will be denoted by 𝑥𝑎 (𝑡) in which the variable represents time in seconds.
A discrete signal will be denoted by x(n) in which the variable is integer and represents discrete
instances in time. It is also represented as
𝑋(𝑛) = {𝑥(𝑛)} = {… , 𝑥(−1), 𝑥(0), 𝑥(1), … } (1.1)

Where the up-arrow indicates the sample at n=0. In MATLAB we can represent a finite–
duration sequence by a row vector of appropriate values. However, such a vector doesn’t have
any information about sample position n. Therefore, a correct representation of x(n) would
require two vectors, one each for "x" and "n".

Unit Impulse Sequence:


The unit impulse signal is defined as

Figure 1.1: Unit Impulse

The response of this signal is shown in figure 1.1

6|Page
Unit Step Sequence:
The unit step function is defined as and its response is also shown in figure 1.2

Figure 1.2: Unit Step

Similarly, Sine & Cosine signals are also considered as basic signals.

SIGNAL OPERATIONS:

 Shifting
 Folding
 Scaling

Shifting:
In this operation each sample of x(n) is shifted by an amount to obtain a shifted sequence y(n).
𝑦(𝑛) = {𝑥(𝑛 − 𝑘 )} (1.2)
If we let m= n−k, then n=m+k and the above operation is given by
𝑦(𝑚 + 𝑘) = {𝑥(𝑚)} (1.3)
Hence this operation has no effect on the vector x, but the vector n is changed by adding k to
each element. This is shown in the function sigshift.
function [y,n] = sigshift(x,m,n0)

% implements y(n)=(n-n0)
% [y,n] = sigshift(x,m,nO)

n = m+n0
y=x

Folding:
In this operation each sample of x(n) is flipped around n = 0 to obtain a folded sequence y(n).
𝑦(𝑛) = {𝑥(−𝑛)} (1.4)
In MATLAB this operation is implemented by fliplr(x) function for sample values and by -
fliplr(n) function for sample positions. Complete the following sigfold function.
function [y,n] = sigfold(x,n)

% implements y(n) = x(-n)


% [y,n] = sigfold(x,n)
7|Page
Scaling:
In this operation each sample is multiplied by a scalar “a”.
{𝑥(𝑛)} = 𝑥(𝑎𝑛) (1.5)
An arithmetic operator ".*" is used to implement the scaling operation in MATLAB.

Procedure
 Construct the given signals in Q1 to 5 in MATLAB using MATLAB code.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.

Observation and Results


 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate the sketch of delta and step function in MATLAB with respect to
scaling, shifting, and inversion.

Communication Trainer CT-3000 Introduction

CT-3000 is a low cost, high performance communication teaching system. It is design to


provide all the basic tools necessary to conduct experiments in the field of digital and
analog communication engineering. It can also be used for R&D projects in
communication.

Basic Tools of CT-3000

• Input voltage 220V 50Hz AC


• 10.245 MHz crystal controlled RF signal source Low distortion 500Hz/1KHz±50Hz AF
signal source Clock with variable frequency about 100 Hz to 6 KHz.
• 1 Breadboard
• DC Supply voltage +12V, -12V at 100mA and +5V at 1A 6 sockets for modules.

Add on Modules

• AM-SSB Modulation/Demodulation.
• Manchester and RZ Encoder/Decoder.
• Clock & Data Recovery Modules.
• Delta Modulation /Demodulation.
8|Page
• QPSK Modulation/Demodulation.

Special Features of the CT-3000 Trainer

Regulated Power Supply


Power supply that provides regulated fixed voltages of +5V, +12V and –12V with power
indication and short circuit and ac input protection fuse.

RF Source

10.245 MHz crystal-controlled oscillator with buffer is provided as RF source for carrying
out experiments in analog communication. The output of the RF source is available
through a BNC connector and it amplitude can be controlled through a control knob.

Audio Frequency Source

This is a simple AF source, which provides sine wave signal of 500/1000Hz (selectable
with a slide switch) frequency. The output of the AF source is available through a BNC
connector and sockets # 4 & 6, for direct connection with modules.

Noise Source (Optional)

A Noise Source is provided which generate the white noise. The output of this source is
available through a BNC type connector.

Clock Timer

A clock signal is used as pulse source. The frequency is adjusted by turning the variable pot
provided on the left bottom of the trainer. The output is available through socket # 1 for
direct connection to the module inserted in it.

Description of modules

Data Generator Module:


This module outputs three distinct serial patterns of NRZ data at J4, J5, and J6 when clock
signal (square wave) is applied to J2 terminal. A clock signal is output from J6
synchronous to the input clock at J2. The frequency of the output at J7 is 1/2 of the
input clock at J2. The output at J7 is complement of J3.The module also contains
internal clock of frequency xx KHz with output at J1. The pattern of NRZ data at J4, J5
and J6 is as under:

9|Page
Sampling Module:
This module contains two identical sampling circuits independent of each other. Jack J1
through J3 are related to one circuit and jack J4 through J6 are related to the other. The
output of the sampling circuit (J3& J6) is a PAM pulse train whose amplitude is
proportional to the amplitude of the signal input (at J1 & J4). The output pulses are
synchronous to the sampling signal pulses input (at J2 & J5).

4 ϕ Clock:
This module outputs pulse trains of phases 0, 90, 180 and 270 at J2, J3, J4 & J5,
respectively when clock signal is input at terminal J1.

10 | P a g e
Encoder Module:
The two inputs of encoder module are NRZ data input at J1 and a clock input at J2. The
two outputs from the encoder are J3 and J4. J3 is the return-to-zero (RZ) data
representation of NRZ data at J1. J4 is the Manchester data representation of J1 input.

Decoder Module:
The two inputs to the decoder circuit are J1 and J2. J1 is the input for the RZ or
Manchester data. J2 is the input clock. The two outputs from the decoder are J3 and J4.
J3 is the NRZ decoded output of RZ data input at J1. J4 is the NRZ decoded output of
the Manchester data input at J2.

Clock Synchronizer and Decoder Module:


This module accepts Manchester coded data at J1 input. The data is passed through an
edge detector which converts and all positive and negative going transitions to narrow
pulses. These pulses are applied to an AND gate, which lets only those pulses to pass
through which occurs at the midpoint of each bit time. The filtered pulses are input to
PLL with VCO at twice the clock frequency. VCO signal is fed to a divide by two
counter and thus clock signal synchronized with the transmitter clock is generated.
VCO signal is output to J2. The recovered clock is output to J4. The clock along with
Manchester data is then fed to a D type flip flop and thus NRZ data is generated and
output through J3.

11 | P a g e
FSK Modulator Module:
This module is basically a sine wave oscillator with output at
FSK output. The frequency of the oscillator depends upon digital data (1s and 0s) signal
input at DATA input. The Frequency Adjust Low potentiometer of 100K controls the
frequency of the signal representing a binary 0. The Frequency Adjust High
potentiometer of 10K controls the frequency of the signal representing binary1. The
module uses 1200 Hz to represent binary 0 and 2200 Hz to represent binary 1. The FSK
modulator can accept data rate up to 1200 Bauds.

FSK Demodulator Module:


This module is basically a PLL which tracks the input signal input at DATA input. Its
data output is logic compatible, which eliminates the need to shape up the signal before
application to the receiving digital system. The FSK demodulator provides an
acceptable output with input signal levels from 2 mV to 3 V. To set VCO frequency, the
potentiometer is adjusted. Usually, it is set at mean of 1 & 0 frequencies of the FSK
signal to be received.

PSK/ASK Modulator Module:


The module generates ASK (Amplitude Shift Keying) and PSK (Phase Shift Keying)
signals for given data input at J4 and carrier input at J1. The ASK signal with binary 1
12 | P a g e
and 0 represented by presence and absence of fixed amplitude carrier is output at J2.
The PSK signal with binary 1 and 0 represented by fixed amplitude carrier with phase
difference of 180ϕ is output at J2. The ASK and PSK outputs are activated by a jumper
provided on the module. A clock signal synchronized with the carrier is available at J3.
The clock is used for generating NRZ data in the Data Module.

Balanced Modulator:
The balanced modulator multiplies two input signals applied at J1 and J2. It is used in
synchronous demodulation of PSK and AMSC (Amplitude Modulation with
Suppressed Carrier) signals. The signal is applied to J1 while the carrier is applied to J2.
The product of two signals is output at J3.

Carrier Synchronizer Module:


This module generates carrier from input PSK signal at J1. The carrier is then used for
demodulation of PSK signals. The input PSK signal is amplified and full wave rectified.
The rectified signal with frequency equal to twice the carrier frequency is phase locked
in a PLL. The output of the PLL VCO, is divided by 2 and shifted in phase by 90 , to
generate the carrier and output at J2.

13 | P a g e
Low Pass Filters Module:
This module contains two 2nd order active low pass filters with cut off frequencies of
500 Hz and 1 KHz. The input and outputs for 500 Hz cut off filter are at J1 and J3,
respectively. The input and output of 1 KHz cut off filter are J2 and J4, respectively.

Amplitude Modulator Module:


This module generates amplitude modulated signal with carrier. The module is tuned to
10.24 MHz carrier applied at lower BNC connector RF (C1). The modulating signal is
applied to J1. AM signal is output at BNC upper connector (C2) .The 50K
potentiometer is adjusted to reduced carrier in generated AM signal.

Peak Detector Module:


This module pre-amplifies, detects and filters AM signal input at BNC connector C3.
The filter capacitor used in peak detector is connected externally to CAPACITOR
terminals. The detected filtered AF signal is output at AF out.
14 | P a g e
AF Generator Module:
This module generates 3 to 5 KHz sine voltage waveform at port J1. This audio signal
is used in SSB experiment as a modulating signal. The signal amplitude can vary with
the help of upper 10K potentiometer and frequency with lower 10K POT.
Power Divider Module:
This module is also used in SSB experiment for dividing single input signal 10.24MHz
to dual output.

SSB Modulator:
SSB (Single Side Modulation) module generates SSB signal when RF carrier signal of
10.24 MHz is applied to BNC I/P connector and AF modulating signal is applied to J1.
AF signal generates AMSC (Amplitude Modulation Suppressed Carrier) signal using a
balance modulator. The AMSC signal is then passed through a crystal BPF to suppress
the undesired sideband and generate SSB signal. The SSB signal is output at BNC O/P
connector.

FM Module:
This module generates frequency modulated carrier of center frequency about
88 KHz at terminal J2 when AF modulating signal is applied at terminal J1. The
modulator is a VCO with exceptional linearity.

FM Carrier Synchronizer:
This module was designed on special request of a customer. The module generates AF
signal (with both sine and square waveforms with outputs at J2 & J3 terminals
respectively), phase locked with FM carrier signal input at J1. The simultaneous display
of AF and FM signals on scope results in stable waveforms on scope, clearly indicating
frequency variations in FM signal with variations of AF signal amplitude.

PLL/FM demodulator:
This module can demodulate FM signal by phase Locked Loop applied at J1 and audio
out at J2.

PCM Encoder:
This module generates pulse code modulated digital signal at terminal J2, for sampled and
15 | P a g e
hold AF signal applied to terminal J1. Clock signal is applied to terminal J4. The
encoder also output frame sync. Signal at J3 terminal which is used to sample and hold
AF signal. The module encodes every AF signal sample into 8 bit binary pattern. The
module contains an ADC, parallel to serial converter and timing and control circuits.

PCM Decoder:
This module generates sample and hold (staircase) waveform and output at
J1 when PCM waveform is input at J2 and clock signal and sampling sync. signals are
input at terminals J4 and J3, respectively. The module contains DAC, serial to parallel
converter and timing and control circuits.

Sample and Hold:


This module samples AF signal applied at J1 terminal with sampling signal applied to
J3 terminal and outputs sampled signal from J2 terminal. If a capacitor of 4700PF is
attached across the terminals J4 and J5 then the module acts as sample-and–hold circuit
by changing the position of jumper downward and outputs staircase waveform from J2
terminal.

Pulse Time Modulation:


This module generates Pulse Width Modulation (PWM) and
Pulse Position Modulation (PPM) signal when sample-and-hold AF signal and sampling
signal reapplied to J1 and J2 terminals respectively. PWM and PPM signals are output
from terminals J3 and J4, respectively.

16 | P a g e
Clock to Sine Converter:
This module generates synchronous sine and square waves output signals with
controllable output amplitude and frequency 1/8th of the input clock signal.

Familiarization with CT-3000

Equipment/Tools

• 20 MHz scope.
• Digital multimeter.

Description

All experiments included in this manual have been performed on the CT-3000
communication Trainer. Before starting actual experiments, let us first familiarize our
self with the use of CT-3000 communication Trainer.

Measuring Power Supplies

Connect the CT-3000 communication to the 220V AC power source and turn ON the
Trainer. Measure +5V, +12V, and -12V supply voltage using a multimeter and record
the results below:

17 | P a g e
Measured
+5 V
supply
voltage
Measured
+12 V
supply
voltage
Measured –
12 V
supply
voltage

RF Source

Connect the output of the RF source to oscilloscope. Verify that the scope displays
sinusoidal signal of 10.245 MHz frequency. Turn the control knob in CW direction and
see that the amplitude of the output signal varies without effecting the waveform. Using
scope measures the frequency of the RF signal and records the results below:

Frequency of
RF signal
Maximum pk
to pk
amplitude

AF Source

Connect the output of the AF source to oscilloscope. Verify that the scope displays
sinusoidal signal of 500Hz in extreme left position of slide switch and 1000Hz in other.
Using control knob verifies that the amplitude of the AF signal varies. Record the
results below:

Measured AF with slide


switch in left
position
Measured AF with slide
switch in right
position
Maximum pk to pk
amplitude of AF
signal
18 | P a g e
Clock

Clock signal is available through pin #3 of socket # 1. Connect the output of the clock to
scope. Verify the scope displays square wave signal with amplitude of 0 to 5 Volts and
its frequency varies, approximately between 150 to 6000Hz frequency ranges. Record
the frequency range below:

Minimum Clk
Frequency
Maximum
Clk
Frequency

NOTE: (6 ports for external modules)

Each port has four sockets. The top left socket of each port is connected to –12 V supply
bus. The top right socket of each port, is connected to +12 V supply. The bottom right
socket of each port is connected to ground. Verify that all ports have the supplies
mentioned above in their relevant sockets. The bottom left socket of port # 1 is
connected to Clk signal. The bottom left sockets of ports # 4 & 6 are connected to AF
signal. Rest of the sockets is left open for future improvement/modification in the
trainer system.

19 | P a g e
-12V +12V GND

Questions
1. Write MATLAB codes which can generate Unit Impulse signal having amplitude 1 and
range of n is from -5 to 5. Now evaluate the resultant signal obtain from adding the above
two signals.
2. Write MATLAB code which can serve as an example for Unit Step signal. Decide the
interval at your own.
3. Write MATLAB code which can serve as an example for Shifting of the original signal.
Decide the interval at your own.
4. Write MATLAB code which can serve as an example for Folded Version of the original
signal. Decide the interval at your own.
5. Write MATLAB code which can serve as an example for Scaled Version of the original
signal. Decide the interval at your own.

20 | P a g e
Lab 2: Fourier Series Computation.

Objective
The goal of this section is to give hands-on introduction to Simulink and to become familiar
with computing the coefficient of Fourier series and also plot the magnitude and phase spectra.

Pre-Lab
Chapter #3 of B.P.Lathi

Equipment/Software Used:
Simulink

Introduction
Transforms are used extensively in engineering to change the frame of reference between the
time domain and the frequency domain. Fourier series and the Fourier transform play a vital
role in many areas of engineering such as communications and signal processing. These
representations are among the most powerful and most common methods of analyzing and
understanding signals. A solid understanding of Fourier series and the Fourier transform is
critical to the design of filters and is beneficial in developing the understanding of many natural
phenomena.
Almost all periodic signals can be represented as an infinite sum of sine and cosines. This sum
is called a Fourier series representation and is defined for a periodic function x(t) of period T

𝑎0 2𝜋𝑛𝑡 2𝜋𝑛𝑡
𝑥(𝑡) = + ∑∞
𝑛=1 (𝑎𝑛 cos + 𝑏𝑛 sin ) (2.1)
2 𝑇 𝑇

Where a0, an and bn are the Fourier series coefficients. These coefficients can be calculated by
applying the following equation

2 𝑇 2𝜋𝑛𝑡
𝑎𝑛 = ∫0 𝑥(𝑡) cos 𝑑𝑡 (2.2)
𝑇 𝑇

And
2 𝑇 2𝜋𝑛𝑡
𝑏𝑛 = 𝑇 ∫0 𝑥(𝑡) sin 𝑑𝑡 (2.3)
𝑇

If the Fourier coefficients are written as a single complex number 𝑐𝑛 with real part representing
the coefficients of the cosine series and imaginary parts representing coefficients of the sine
series, we can write the complex form of the Fourier series as following
𝑥(𝑡) = ∑+∞−∞ 𝐶𝑛 𝑒
(𝑗2𝜋𝑛𝑡/𝑇)
(2.4)

Where
1 𝑇
𝐶𝑛 = 𝑇 ∫0 𝑥(𝑡)𝑒 −𝑗2𝜋𝑛𝑡/𝑇 n=0,1,2… (2.5)

21 | P a g e
Procedure
In order to design a system to generate a0, we need to define a function generator for f (t), an
integrator, and a divider (to divide by T). Suppose that f (t) is a square wave signal. Thus, we
need to find a source provider in the libraries. By looking up in the blocksets, the library of
‘Sources’ is found in Simulink blockset. Different types of sources are provided inside this
library such as Chirp Signal, Pulse Generator, Signal Generator, and Sine Wave. The Pulse
Generator block provides a square wave signal which is desired for our purpose. So, we drag
the icon of ‘Pulse Generator’ and drop it in the opened blank model. In order to display the
output of the signal generator, we select the ‘Scope’ in the ‘Sinks’ library of the Simulink
blockset and drag it into the model. Next, a ‘wire’ is connected between the Signal Generator
and the Scope. This can be done by dragging the mouse from the Pulse Generator output
terminal to the Scope input terminal. Figure 2.1 shows the resulting model.

Figure 2.1: Square Pulse on Simulink

Double clicking on the Scope icon will cause an oscilloscope screen to appear. An oscilloscope
is a device which enables one to view the appearance of a signal. Next we go to the model
window and from the ‘Simulation’ menu select ‘Start’. The plot in Figure 2.2 is then seen on
the ‘Scope’ screen.

Figure 2.2: Scope Output

As can be seen, the period of the generated signal T=2. Now, we need an integrator to integrate
the signal. The integrator block is found in ‘Commonly Used Blocks’ library and is added to
the model. A wire is drawn from the output of the pulse generator to the input of the integrator.
Then a divide block is needed to divide the result by T. This block can be found in the „Math
Operations‟ library. This block has two inputs: the upper one (×) isconnected to the numerator
(here the integration result) while the second input (÷) is connected to denominator (here T).
To provide T as a constant input for the divider, we need a ‘Constant’ block which is again
found in ‘Commonly Used Blocks’ library. The output of the divider is the value of a0, which

22 | P a g e
can be displayed using a numeric ‘Display’ block found in the ‘Sinks’ library. The block
diagram of the system is displayed in the Figure 2.3.

Figure 2.3: Simulink Model for Fourier Coefficients


Since the square wave has a period of two seconds, the fundamental frequency is π radians/sec.
We are interested in integrating over only one period to compute the Fourier series, so we can
set up the length of the simulation to be two seconds by going to the ‘Simulation’ menu, and
selecting ‘Simulation parameters’ and setting the ‘stop time’ to 2 seconds. We also need to set
the value of the ‘Constant’ block to be equal to T=2. Double clicking on the ‘Constant’ block
helps change the constant value to 2. Now, the simulation is run (you can click on the ‘start
simulation’ icon in the model window). Inside the numeric display block, the result is shown
as 0.5 which is the right value for a0.
2 𝑇
𝑏𝑘 = 𝑇 ∫0 𝑓(𝑡) sin(𝑘𝑤0 𝑡)𝑑𝑡 (2.6)
To determine bn, we need to make the term and then integrate it and multiply by 2/T which is
equal to 1 here (and thus we ignore multiplying by 2/T in this case). In order to provide we
need a sine wave generator and a multiplier to be added to the model and wired properly. The
sine wave parameters need to be set up for the right frequency. To do so, we double click on
the sine wave and change the frequency. Let us assume that we want to calculate b1, for which
the frequency should be set to kwo=π. This is done by typing ‘pi’ in the frequency parameter
text box as shown in Figure 2.4.

23 | P a g e
Figure 2.4: Block Parameters

Running the simulation generates a 0.5 for a0 and a 0.6366 for b1. Figure 2.5 illustrates the
designed model.

Figure 2.5: Designed Model

These coefficients a0 and bk can be used to reconstruct the original square wave signal using
the equation.
𝑓𝑛 (𝑡) = 𝑎0 + ∑𝑁 𝑘=1 𝑏𝑘 sin(𝑘𝑤0 𝑡) (2.7)
A new Simulink model can be built to reconstruct the original signal. The block diagram in
Figure 2.6 shows a model which employs a0, b1, b3, and b5 for reconstruction. The coefficients
in this model were calculated using the trigonometric Fourier series model. Also the frequency
parameter of each sine wave was set to (for each k=1,3,5). The resulting scope is also displayed
in Figure 2.7. The axes are auto-scaled. As can be seen, the reconstructed signal is following
the original signal. If we want a more exact reconstruction, we need to use more bk coefficients,
i.e. to increase N in the equation.

24 | P a g e
Figure 2.6: Reconstruction of the Original Signal

Figure 7 Original Signal Waveform

Observation and Results


 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate trigonometric and complex Fourier series and Fourier components
in Simulink.

25 | P a g e
Questions
1. Sketch out the differences between Simulink and MATLAB?
2. Why is the Library Browser build?
3. What is the purpose of assembling Sinks and Sources in Simulink?

26 | P a g e
Lab 3: Implement modulation of AM signal

Objective
To become familiar with the modulation and demodulation of Amplitude modulated (AM)
signal using Balanced Modulator in MATLAB

Pre-Lab
Chapter #4 of B.P.Lathi

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 Trainer, Oscilloscope

Introduction
In amplitude Modulation (AM), we utilize the audio signal to modulate the amplitude of the
carrier signal, which means that the amplitude of the carrier signal will be varied with the
amplitude of the audio signal. The waveform of AM modulation is shown in figure 4.1.

Figure 4.1: Amplitude Modulation

Let the audio signal be Am cos(2πfmt) and carrier signal be Ac cos(2πfc t) , then the amplitude
modulation can be expressed as equation 4.1.

𝑋𝐴𝑀 (𝑡) = [𝐴𝐷𝐶 + 𝐴𝑚 cos(2𝜋𝑓𝑚 𝑡)]𝐴𝐶 cos(2𝜋𝑓𝑐 𝑡) (4.1)


= 𝐴𝐷𝐶 𝐴𝐶 [1 + 𝑚 cos(2𝜋𝑓𝑚 𝑡)] cos(2𝜋𝑓𝑐 𝑡) (4.2)

m = Am / ADC
ADC  DC Signal Amplitude
Am  Audio signal amplitude
AC  Carrier signal amplitude
fm Audio signal frequency
fc Carrier signal frequency
From equation 4.2 we notice that the variation of the magnitude ADC Ac [1+ m cos(2πfmt)] of
the carrier signal can be controlled by the parameter “m”.
This means we can change the magnitude of the audio signal Am or DC signal ADC to control
27 | P a g e
the level or depth of the carrier signal. Therefore, this parameter “m” is known as modulation
index.
Besides we can also rewrite the equation 4.2 as equation 4.3.
1
𝑋𝐴𝑀 = 2 𝐴𝐷𝐶 𝑚{cos[2𝜋(𝑓𝑐 + 𝑓𝑚 )𝑡] + cos[2𝜋(𝑓𝑐 − 𝑓𝑚 )𝑡]} + 𝐴𝐷𝐶 𝐴𝐶 cos(2𝜋𝑓𝑚 𝑡) (4.3)

The first term represents double sideband signal; the second term represents the carrier signal.
From equation 4.3 we can sketch the frequency spectrum of amplitude modulation as shown
in figure 4.2. Since the audio signal is hidden in the double sidebands and the carrier signal
does not contain any message therefore the power is consumed in the carrier during the
transmission of amplitude modulation signal. For this reason, the transmission efficiency of
AM modulation is lower than double sidebands suppressed carrier (DSB-SC) modulation but
its demodulation circuit is much simpler.

Figure 4.2: Frequency Spectrum of Amplitude Modulation

There is an important parameter “m” in equation called modulation index or depth of


modulation. Normally it I represented in percentage, so we also call modulation percentage.
Modulation index is an important parameter in equation 4.3 and given by equation 4.4.

𝐴𝑢𝑑𝑖𝑜 𝑠𝑖𝑔𝑛𝑎𝑙 𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 𝐴


𝑚= × 100% = 𝐴 𝑚 × 100% (4.4)
𝐷𝐶 𝑠𝑖𝑔𝑛𝑎𝑙 𝑚𝑎𝑔𝑛𝑖𝑡𝑢𝑑𝑒 𝐷𝐶

Generally, the magnitude of DC signal is not easy to measure: therefore, we express the
modulation index in another form of equation 4.5.
𝐸 −𝐸
𝑚 = 𝐸𝑚𝑎𝑥 +𝐸𝑚𝑖𝑛 × 100 (4.5)
𝑚𝑎𝑥 𝑚𝑖𝑛

Where Emax and Emin as shown in figure 4.1 are calculated by equation 4.6 and 4.7.
𝐸𝑚𝑎𝑥 = 𝐴𝑐 + 𝐴𝑚 (4.6)

𝐸𝑚𝑎𝑥 = 𝐴𝑐 − 𝐴𝑚 (4.7)
We know that at amplitude modulation the audio signal is hidden in the double sidebands, so
if the double sidebands signals are getting stronger, the transmission efficiency is getting better.
From equation 4.3 we know that the double sideband signals are proportional to the modulation
index. Thus the larger the modulations index the better the transmission efficiency.
Normally modulation index is smaller or equal to 1. If greater than 1 we call it over-modulation
as shown in figure 4.2. From that figure we can see that the variation of the carrier signal is no
longer a sinusoidal wave, it is rather a distorted sinusoidal wave, therefore this kind of signal
is unable to demodulate and recover to original signal by using the envelop detection.

28 | P a g e
Procedure
Software Implementation:
 Construct the given signals in Question in MATLAB using MATLAB code.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.
Hardware Implementation:

Equipment/Tools

• CT-3000 Trainer.
• Multimeter.
• Dual Beam Oscilloscope.
• AM module.
• Pair of Coaxial Cables.

Theory

Amplitude Modulation with suppressed carrier (AMSC) is mathematically represented by the equation:
𝑦(𝑡). 𝑐𝑜𝑠𝜔𝑐𝑡

where y(t) is the modulating signal and 𝑐𝑜𝑠𝜔𝑐𝑡, is the carrier. Practically AMSC is generated using a
balance modulator. Since this signal does not contain carrier component hence it is known as amplitude
modulation with suppressed carrier or AMSC. The modulating signal y(t) is recovered from AMSC
signal if it is multiplied by a carrier 𝑐𝑜𝑠𝜔𝑐𝑡. Mathematically this is represented as under:

A LPF will suppress y(t) cos2t component and recover y(t) signal.
If a DC component of magnitude Ac is added to the signal y(t) before modulation, then the amplitude modulated
signal becomes

(𝑦(𝑡) + 𝐴𝑐). 𝑐𝑜𝑠𝜔𝑐𝑡

This represents amplitude modulated signal with carrier. This signal is demodulated using envelope
detector. For distortion less recovery of y(t) signal. For tone modulating signal i.e. y(t) = Amcos𝜔mt, AM
signal is shown in following figure.

29 | P a g e
Procedure

Amplitude Modulation with Suppressed Carrier (AMSC)

• Connect the CT-3000 Trainer to the 220V AC power supply.

• Turn on the trainer and verify the voltage of the power supply using the multimeter.

• Plug in AM modulator module in port # 4.

• Connect RF source to the input of the amplitude modulator C1 at bottom and connect scope to its output port C2
through coaxial cables.

• AF signal is connected to the modulator through its pins. Reduce AF signal to zero by turning in CCW direction
the AF level control knob.

• Increase RF carrier level by turning RF control knob in CW direction till you see unmodulated carrier at the
output. You may have to decrease attenuation of the scope in order to see the signal.

• With no input AF signal the carrier must be zero in AMSC. Adjust balance potentiometer of 50K till carrier level
is minimized.

• Next turn AF knob in CW direction and will see AMSC signal at the output. The level of output AMSC signal is
directly proportional to the AF signals level. Plot the waveform below:

Amplitude Modulation with carrier (AM)

• Reduce AF signal to zero and then rotate balance potentiometer P1 in CW direction to its extreme position.
Now in this case you will see carrier at the output without input AF signal.
• Increase gradually AF signal till you see AM modulated waveform. Measure Amax and Amin as shown
in above figure. Calculate modulation index “mu” of the AM modulated waveform.
30 | P a g e
Modulation Index:

Calculate Amax/Amin for modulation index of 30 %. Next set AF signal till you get AM modulated signal with 30 %
modulation. Plot the waveform below:

Observation and Results


 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate about modulation and demodulation techniques of AM signal using
 balanced modulator in MATLAB

31 | P a g e
Questions
1. Investigate the change in the output of AM Modulation using balanced modulator by
modifying modulation index and show over-modulation or under-modulation in graph.

32 | P a g e
Lab 4: Implement demodulation of AM signal

Objective

To become familiar with the modulation and demodulation of Amplitude modulated (AM)
signal.

Pre-Lab
Chapter #4 of B.P.Lathi

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 Trainer, Oscilloscope

Introduction
The AM demodulator can be implemented by utilizing a balanced modulator. We call this type
of modulator as synchronous detector or product detector. The design of product detector is to
multiply the modulated AM signal by synchronized carrier signal in AM modulator.
Let
X AM (t) be the modulated be the modulated AM signal,
X c (t) be the carrier signal given by equations
𝑋 𝐴𝑀 (𝑡) = 𝐴𝐷𝐶 [1 + 𝑚 cos(2𝜋𝑓𝑚𝑡)]𝐴𝑐 cos(2𝜋𝑓𝑐𝑡) (3.1)
𝑋𝑐 (𝑡) 𝐴𝑐 cos(2𝜋𝑓𝑐𝑡) (3.2)

When these two signals input two different ports of balanced modulator then the output signal
of the balanced modulator is given by equations

𝑥𝑜𝑢𝑡 (𝑡) = 𝑘𝑥𝑐 (𝑡)𝑥𝐴𝑀 (𝑡) (3.3)

= 𝑘𝐴𝐷𝐶 𝐴𝐶 2 [1 + 𝑚𝑐𝑜𝑠(2𝜋𝑓𝑚 𝑡)]𝑐𝑜𝑠 2 (2𝜋𝑓𝑐 𝑡) (3.4)


𝑘𝐴𝐷𝐶 𝐴𝐶 2 𝑘𝐴𝐷𝐶 𝐴𝐶 2 𝑘𝐴𝐷𝐶 𝐴𝐶 2
= + 𝑚𝑐𝑜𝑠(2𝜋𝑓𝑚𝑡) + [1 + 𝑚𝑐𝑜𝑠(2𝜋𝑓𝑚 𝑡)] cos[2(2𝜋𝑓𝑐 𝑡)] (3.5)
2 2 2
Where k represents the gain of the balanced modulator. In equation 3.3, the first term is the
DC signal, second term is the audio signal and third term is the second harmonic of modulated
AM signal. If we take out the second term by using the low pass filter as shown in figure 3.1,
then we can obtain the exact demodulated AM signal or audio signal.

Figure 3.1: Block Diagram of Product Detector

33 | P a g e
Procedure
Software Implementation:
 Construct the given signals in Question in MATLAB using MATLAB code.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.

Hardware Implementation:

Implementation of AM Demodulation

Equipment/Tools

• CT-3000 Trainer.
• Peak Detector Module (PDM), AM module,
• Oscilloscope,
• Tool Kit,
• Multimeter,

Theory

The AM signal can be demodulated coherently by a locally generated carrier know as synchronous
detection, however, this will defeat the purpose of AM and, hence, is rarely used in practice. AM is
demodulated using rectifier, envelope and square law detection. In rectifier detection of AM signal (m(t)
+A)coswct, the rectified output , is given by:

34 | P a g e
AM signal (m(t) +A)cos𝜔ct, the rectified output is given by:

(𝑡) =
1{𝐴 + (𝑡)} + 𝑜𝑡ℎ𝑒𝑟 𝑡𝑒𝑟𝑚𝑠 𝑜𝑓 ℎ𝑖𝑔ℎ𝑒𝑟 𝑜𝑟𝑑𝑒𝑟 𝑠𝑢𝑝𝑟𝑒𝑠𝑠𝑒𝑑 𝑏𝑦 𝐿𝑃𝐹
R resistor of the rectifier, the output of the detector now follows the envelope of the modulated signal.
The desired output signal has magnitude m(t)/ . If a capacitor is added in parallel with the load and is
known as envelope detector (Fig. 11.1).
On positive cycle of the input signal, the capacitor charges up to the peak voltage of the input signal. As
the signal falls below this peak value, the diode is cut off, and the capacitor starts discharging through the
load resistor R. During each positive cycle, the capacitor charges up to peak voltage of the input signal
and then decays slowly until next positive cycle. The output voltage thus follows the envelope of the
input signal which is infact the modulating signal m(t) superimposed by the ripple signal of frequency 𝜔c.
By increasing RC time constant, the ripple is reduced. However, making RC too large would make it

Impossible for the capacitor voltage to completely follow the envelope (see Fig.11.1). For best results RC must
satisfy the relation:

1/𝜔c << RC << 1/2sqrt(B) where B is the bandwidth of the modulating signal m(t)

The envelope detector output is A + m(t) + ripple of 𝜔c. The ripple is removed by another LPF followed
by the envelope detector. The output of envelope detector is approximately three times the output of
rectifier detector.

Procedure

• Connect the CT-3000 Trainer to the 220V AC power supply.


• Turn on the trainer and verify the voltage of the power supply using the multimeter. Plug in AM and Peak
detector modules in ports 4 & 5 respectively. Set AF frequency to
• 1KHz.
• As explained in AM experiment set AM module for AM and observe its waveform on the scope and measure
its modulation index. The carrier frequency in AM module is 10.24 MHz.
• Connect output of AM to the input of peak detector. The AM signal is passed through a tuned amplifier and
applied to the peak detector.
• Calculate value of time constant RC which satisfies the criteria explained in theory above for carrier
frequency equal to 10.24 MHz and modulating signal of I KHz frequency. For R = 3300Ω, calculate value
of C and record the results below. (This capacitor is added externally to the peak detector module, while load
resistor of 3.3K is built in the module).

• RC (computed) = C (computed) = C(used) =

• Approximate the value of capacitor to the closet practically available value and connect it across the capacitor
terminals in PDM. Connect scope channel 1 to AF signal and ch2 to upper capacitor terminal, and trigger the
scope from CH1. The scope will depict the modulating signal and envelope detector output waveform.
However, with the capacitor C in place, the output is essentially the input envelope with a small ripple
superimposed, as shown in fig. 11.1. Now connect CH2 to AF output, which is the output of LPF. Verify
that demodulated output is now free of ripples. Increase AF signal and see that detected output increases
proportionally.
• Calculate the value of the capacitor using above equation and record it below:

35 | P a g e
C (computed) =

• Use a value of capacitor practically available and closed to computed value and connect it across capacitor
terminals. Observe detected AM signal by connecting scope probe to upper capacitor terminal. Connect CH2
of scope to AF out and observe it waveform. Plot the two waveforms below:

(a)

(b)

• Now increase almost 10 times the value of the capacitor and see its effect on the waveform. Plot the new
waveforms below.

(c)

• Increase AF level and observe its effect on the waveform.


36 | P a g e
Observation and Results
 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate about modulation and demodulation techniques of AM signal in
MATLAB.

Questions
1. Organize a MATLAB code which can generate a carrier of 25 KHz and Modulating
signal of 5 KHz and then develop a signal using carrier of 5 KHz and Modulating signal
of 10Hz and investigate the impact of change in frequency on the signal.
 First modulate and
 Then demodulate a signal

37 | P a g e
Lab 5: Implement modulation and demodulation of signal using DSB-SC

Objective

To become familiar with the implementation of Modulation and Demodulation of Signal using
DSB-SC.

Pre-Lab
Chapter #4 of B.P.Lathi

Equipment/ Software Used


Computer System with installed MATLAB, CT-3000 trainer, Oscilloscope

Introduction
The DSB-SC modulator output follows equation 5.1.
𝑣(𝑡) = 𝑚(𝑡) ∗ cos 𝜔𝑐 (𝑡) (5.1)
The coherent DSB-SC requires a synchronized local oscillator and works on following
principle. Please refer to equation 5.2.
1 1
[𝑚(𝑡) ∗ cos 𝜔𝑐 (𝑡)]𝑐𝑜𝑠(𝜔𝐶 𝑡) = 𝑚(𝑡)𝑐𝑜𝑠 2 (𝜔𝑐 𝑡) = 𝑚(𝑡)(2 + 2 cos(2𝜔𝑐 𝑡)) (5.2)
𝑚(𝑡) 𝑚(𝑡)
+ cos(𝜔𝑐 𝑡) (5.3)
2 2

A low pass filter filters out the message signal from the equation 5.2.

Procedure
The SIMULINK implementation is first shown for sinusoidal modulating signal and then for
a composite signal made up of two sinusoids. Next it is shown how an AM signal (DSB-C)
with modulation index 1.2 is recovered through coherent detection. Please refer to result of
mini-project on Amplitude Modulation Demodulation using SIMULINK model for
comparison. Finally, using spectrum scope frequency domain representation of modulated and
demodulated signal is seen and compared. It is seen that for modulated signal information is
available around carrier frequency while for demodulated signal in baseband only.
Figure 5.1 shows SIMULINK model preparation and parameterization of local oscillator.

38 | P a g e
Figure 5.1: Block parameters of Local Oscillator

Figure 5.2 shows time scope output for 10 second simulation, original and expanded time axis.

Figure 5.2 Scope Output of Modulated and Demodulated Signal

39 | P a g e
Figure 5.3 shows preparation of model for composite signal and its performance.

Figure 5.3: Model for Composite Signal

Figure 5.4 gives the result of the scope.

Figure 5.4: Modulated and Demodulated Composite Signal on Scope


Figure 5.5 and Figure 5.6 shows DSB-C coherent detection for modulation index 1.2 and its
results respectively.

40 | P a g e
Figure 5.5 DSB-C with changed modulation index

Figure 5.6: DSB-C output on Scope

41 | P a g e
Figure 5.7 shows use of spectrum scope, its parameterization and display. The input of bottom
scope is output port of filter block which is renamed. Else this by default shows ‘Ch1’ as
legend. The modulating signal frequency is made 3000Hz for better visualization.

Figure 5.7 DSB-SC Spectrum Scope

Figure 5.8 shows the results of the Spectrum Scope.

Figure 5.8: Spectrum Scope Results

Note that the range 0.5 MHz in frequency axis refers to Fs/2 = 100000/2 = 50000 Hz.
42 | P a g e
Observation and Results
 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Repeat the procedure as described in previous labs on trainer of CT-3000 and record
results.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate about modulation and demodulation techniques of DSB-SC in
 MATLAB

Questions
1. Investigate the differences between Am with Large carrier and DSB SC communication.
Do both have same demodulation techniques

43 | P a g e
Lab 6: Implement modulation and demodulation of signal using SSB-SC

Objective
To become familiar with the concepts and implementation of Single Side Band (SSB)
modulation using MATLAB commands.

Pre-Lab
Chapter #4 of B.P.Lathi

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 trainer, Oscilloscope

Introduction
Single Side Band modulation that reduces the bandwidth of the modulated signal. It makes use
of the frequency shifter to produce in-phase and quad-phase message component and utilizes
carrier signal to modulate these message components. Demodulation is done coherently using
the same technique as it’s used in AM coherent demodulators.

Procedure
Software Implementation:
 Construct the given signals in Question in MATLAB using MATLAB code.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.
Hardware Implementation:

Implementation of SSB Modulation

Equipment/Tools:

• Communication Trainer CT-3000


• AM Modulator, AF Generator, Crystal BPF and power Divider
• Function Generator,
• Coaxial Cables,
• Oscilloscope,
• Multimeter

Theory:

The double sideband (DSB) signal spectrum has two sidebands: the upper sideband (USB) and the
lower sideband (LSB), either of which contains the complete information of the modulating signal.
The bandwidth of DSB signal is twice the bandwidth of the modulating signal. If one of the
sidebands of DSB signal is removed, by filtering, the remaining signal having one sideband is known
as single sideband (SSB) signal, and has bandwidth one half that of DSB signal. Mathematically we
44 | P a g e
can express SSB signal by,

Where 𝑦ℎ(𝑡) is Hilbert’s transform of modulating signal 𝑦(𝑡), and the minus sign applies to USB-SSB and plus
sign applies to LSB-SSB.

SSB is generated usually by a) Phase Shift Method b) Direct Filtering Method.

In this experiment use of direct filtering method has been made. The block diagram of SSB modulator is shown
below.

AF Signal in DSB out Crystal Band SSB out


BM
Pass Filter

Carrier in

Frequency Response of DSB

The modulating signal is applied to balanced modulator to generate DSB signal. To generate USB-
SSB signal, the filter should pass all frequency components above the carrier c unattenuated and
suppress completely all components below c. Practically it is impossible to achieve as we need a
filter with brick wall response. There must be some separation between the two sidebands of DSB
signal so that a sharp cutoff BPF (crystal filter) could be used to eliminate undesired sideband and
pass desired sideband. The DSB signal is passed through a crystal filter to generate SSB signal. To
minimize adjacent channel interference, the undesired sideband should be attenuated at least by
40dB.

45 | P a g e
Procedure:

• Verify that 10.245MHz sinusoidal signal is available at BNC connector. Use oscilloscope and measure
the frequency of carrier signal ad record the result below:

Carrier frequency=

• Next insert the AM module into socket #5 and connect 10.245MHz carrier output to AM module though
coaxial cable at bottom BNC connector.
• Insert AF generator Module into socket #4 and verify 5 KHz (modulating signal) sinusoidal signal is
available at J1.
• Connect output of AF generator module J1 to input signal of AM module. The output of the modulator
will show amplitude modulated signal with suppressed carrier (AMSC) signal.
• Connect scope to the output of the AM module. Adjust balance through 50K POT P1 till carrier signal
at the output of the modulator is zero.
• Then connect output of the AM Module through coaxial cable to the input of Crystal Band Pass Filter
module.
• Next connect Ch2 of scope to SSB output (C2) of Crystal BPF module. Increase time scale and examine
envelop of SSB output (C2) of Crystal BPF module. Ideally it should be flat. However, envelop will
show the presence of AM on SSB signal. Give reasons:

AF Generator Amplitude Crystal BPF


Modulator
DSB out

C1 C2 C1 C2 SSB Out

J1

10.245 MHz
Carrie Signal

• Since the AF signal is a tone of 7 KHz, which is being applied along with carrier signal of 10.245 KHz
to the balanced modulator, therefore, sidebands of DSB output of balanced modulator will be
components of frequencies 10.252 KHz in USB and 10.238 KHz in LSB. Verify the Ch2 displays signal
of 10.252 or 10.238MHz (depending upon the filter in used at DSB signal). Next measure the frequency
of SSB output signal and record the result below:
Sideband frequency =

Type of Sideband =

46 | P a g e
• Now turn down AF signal to zero with the help of upper 10K potentiometer and see that SSB output
also reduces to zero. What does this mean?

• Increase AF signal and verify that SSB output also increases in proportion.
• Next set AF frequency to 5 KHz (You can change AF frequency by tuning Gang Capacitor in AF
Generator module) and measure SSB output signal frequency and record the results, Sideband
frequency=

• See output of AM modulator. Adjust the balance till carrier till carrier is zero in that case. Since AF
signal is a sinusoidal signal therefore the output of DBM will be two signals at ω c ± ωm . Adjust
amplitude of AF signal to avoid any saturation.

• The BPF allow LSB (Lower side band) signal ωc + ωm pass. The separation between ωc ± ωm is adjusted
by change frequency of AF signal. Due to finite rejection of BPF for ωc + ωm the signal will appear on
the lower edge of ωc - ωm as modulation. Adjust AF frequency till the ωc + ωm signal is minimized
(modulating →0)

Implementation of SSB Demodulation

Equipment /Tools:

• Communication Trainer CT-3000


• Power Divider, AM Modulator, AF Generator, Crystal BPF and Balance Modulator
• Function Generator,
• Coaxial Cables,
• Oscilloscope,
• Multimeter

Theory:

Demodulation (detection) methods for amplitude modulation on the receiving side include
synchronous detection and asynchronous detection. Synchronous detection demodulates the received
signal by multiplying it with a carrier frequency which has the same frequency and phase as the
transmission carrier wave. Asynchronous detection includes envelope detection and rectification
detection. With asynchronous detection, the information signal m(t) must be incorporated in the
envelope of the receiving waveform. With a modulation factor of 100% or more, demodulation is not
possible with asynchronous detection, but with synchronous detection, correct demodulation is
possible.

DSB-SC demodulation requires synchronous detection. The local frequency generated from the
receiving wave is multiplied by the receiving wave, but this operation is modulation itself, therefore
the spectrum shifts to a frequency double the local frequency and a zero frequency. The zero
47 | P a g e
frequency spectrum is the transmitted modulating signal.

With synchronous detection, the modulated wave (receiving wave) is multiplied with the carrier
frequency which is exactly the same frequency and phase as the transmission carrier wave.

Procedure

Connect the modules as shown in Fig as shown below.

• Now insert power divider module in socket#1 and connect 10.245MHz carrier to RF input of the
power divider. Verify that on ports 1 & 2 RF signal is also available.

• To demodulate the SSB signal, insert a balanced modulator module into socket # 3. Connect SSB
signal with the Audio input and 10.245 MHz carrier signal with the carrier signal input of the
balanced modulator module. Then connect the output of the balanced modulator with the scope
and you will see the demodulated signal of SSB.

• See output of AM modulator. Adjust the balance till carrier till carrier is zero in that case. Since
AF signal is a sinusoidal signal therefore the output of DBM will be two signals at ω c ± ωm . Adjust
amplitude of AF signal to avoid any saturation.

• Connect ωc - ωm LSB signal to the balance modulator again. Using the same carrier signal
as used in modulation process, the AF signal will be recovered at the output of BM. This
demodulation is known as synchronous demodulation.

48 | P a g e
Observation and Results
 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate about modulation and demodulation techniques of SSB-SC with
 Large carrier in MATLAB

Questions
1. Investigate the differences between Am with SSB and DSB SC communication.
Do both have same demodulation techniques

49 | P a g e
Lab 7: Implement Modulation and Demodulation of signal using Quadrature
Amplitude Modulation (QAM) [Open-Ended Lab]
Objective
To implement quadrature amplitude modulation and demodulation in time domain

Pre-Lab
Chapter #4 of B. P. Lathi

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 trainer, Oscilloscope

Introduction
QAM (quadrature amplitude modulation) is a method of combining two amplitude-modulated
(AM) signals into a single channel, thereby doubling the effective bandwidth. QAM is used
with pulse amplitude modulation (PAM) in digital systems, especially in wireless applications.
QAM operates by transmitting two DSB signal using two carriers, each having the same
frequency but differing in phase by 90 degrees (one quarter of a cycle, from which the term
quadrature arises) as shown in Figure 7.1.

Figure 7.1: Quadrature Amplitude Modulation


Mathematically, one of the signals can be represented by a sine wave, and the other by a cosine
wave. The two modulated carriers are combined at the source for transmission. At the
destination, the carriers are separated, the data is extracted from each, and then the data is
combined into the original modulating information.
𝜋
As shown in Figure 7.1, boxes labeled as − 2 are phase shifters that delay the phase of sinusoid
𝜋
by − 2 . If the two baseband message signals for transmission are 𝑚1 (𝑡) and 𝑚2 (𝑡), the
corresponding QAM signal 𝜑𝑄𝐴𝑀 (𝑡), the sum of two DSB modulated signals, is
𝜑𝑄𝐴𝑀 (𝑡) = 𝑚1 (𝑡) 𝑐𝑜𝑠 𝜔𝑐 𝑡 + 𝑚2 (𝑡) 𝑠𝑖𝑛 𝜔𝑐 𝑡 (7.1)
Both modulated signals occupy the same band. Yet two baseband signals can be separated at
receiver by synchronous detection if two local carriers are used in phase quadrature. This can
be shown by considering the multiplier output 𝑥1 (𝑡) of the upper arm of the receiver as in
Figure 7-1.
50 | P a g e
𝑥1 (𝑡) = 2 𝜑𝑄𝐴𝑀 (𝑡) cos 𝜔𝑐 𝑡 = 2[𝑚1 (𝑡) cos 𝜔𝑐 𝑡 + 𝑚2 (𝑡) sin 𝜔𝑐 𝑡] cos 𝜔𝑐 𝑡
𝑥1 (𝑡) = 𝑚1 (𝑡) + 𝑚1 (𝑡) cos2 𝜔𝑐 𝑡+ 𝑚2 (𝑡) sin 2𝜔𝑐 𝑡 (7.2)
Similarly, the output of the lower receiver will be as:
𝑥2 (𝑡) = 2 𝜑𝑄𝐴𝑀 (𝑡) sin 𝜔𝑐 𝑡 = 2[𝑚1 (𝑡) cos 𝜔𝑐 𝑡 + 𝑚2 (𝑡) sin 𝜔𝑐 𝑡] sin 𝜔𝑐 𝑡
𝑥2 (𝑡) = 𝑚2 (𝑡) − 𝑚2 (𝑡) cos2 𝜔𝑐 𝑡+ 𝑚1 (𝑡) sin 2𝜔𝑐 𝑡 (7.3)

The upper channel is known as In-phase (I) channel and the lower channel is called Quadrature
(Q) channel. Both signals 𝑚1 (𝑡) and 𝑚2 (𝑡) can be separately demodulated. However, the
QAM demodulation must be totally synchronous. In synchronous/ coherent demodulation,
carrier of the same frequency is used as in the modulation.

Procedure
 Construct any two message signals in MATLAB.
 Design QAM modulator/demodulator using any required mathematical functions.
 Repeat the experiment on hardware using CT-3000 trainer.

Observation and Results


 Write the MATLAB code for implementing QAM to modulate and demodulate the signals
𝑚1 (𝑡) and 𝑚2 (𝑡).
 Simulate the code.
 Plot the figures.

Learning Outcome
Students should be able to investigate the technique of QAM to modulate and demodulate the
signals.

Questions
1. Write your investigations with respect to co-channel interference in QAM demodulation?
2. Analyze the difference between coherent and non-coherent demodulation?
3. Evaluate the performance of phase shifter used in QAM?

51 | P a g e
Lab 8: Implement modulation and demodulation of signal using FM

Objective
To become familiar with the demodulation of signals using Frequency modulated (FM) signal
in MATLAB commands.

Pre-Lab
Chapter #5 of B.P.Lathi

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 trainer, Oscilloscope

Introduction
In telecommunications and signal processing, frequency modulation (FM) is the encoding
of information in a carrier wave by varying the instantaneous frequency of the wave.
If the information to be transmitted (i.e., the baseband signal) is xm (t)
and the sinusoidal carrier is ,
𝑥𝑐 (𝑡) = 𝐴𝑐 𝑐𝑜𝑠(2𝜋𝑓𝑐𝑡 ) (8.1)
where fc is the carrier's base frequency, and Ac is the carrier's amplitude, the modulator
combines the carrier with the baseband data signal to get the transmitted signal:
t
y(t) = Ac cos(2π ∫0 f(τ)dτ) (8.2)
t
= Ac cos(2πfc t + 2πf∆ ∫0 xm (τ)dτ) (8.3)
Where
f∆ = K f Am (8.4)
K f being the sensitivity of the frequency modulator
Am being the amplitude of the modulating signal or baseband signal.
In this equation, f(τ) is the instantaneous frequency of the oscillator and f∆ is the frequency
deviation, which represents the maximum shift away from fc in one direction, assuming xm (t)
is limited to the range ±1.

Procedure
Software Implementation:
 Construct the given signals in Question in MATLAB using MATLAB code.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.
Hardware Implementation:

Implementation of Frequency Modulation

Equipment /Tools:

• Communication Trainer CT-3000,


• FM module, FM Carrier Sync. Module
• Function generator,
52 | P a g e
• Dual channel scope,
• Multimeter

Theory:

In AM signals, where the amplitude of the carrier is modulated by the modulating signal y(t), and, hence,
the information content of y(t), lies in the amplitude variation of the AM signal. On the otherhand in
frequency modulation (FM), the carrier frequency is modulated by the amplitude of the modulating signal
and the information content of y(t), therefore, lies in the frequency variation of the FM signal.
Mathematically, FM signal is described by the equation:

𝑥𝐹𝑀 = 𝐴. cos (𝜔𝑐𝑡 + 𝑘 ∫ 𝑦(𝑡). 𝑑𝑡)

Where k is constant and A is the amplitude of the carrier. The frequency of the carrier at any instant is given by:

𝜔(𝑡) = 𝜔𝑐 + 𝑘. 𝑦(𝑡)

Therefore, in FM, the instantaneous frequency of the carrier varies directly with the amplitude of the
modulating signal. Depending upon the maximum amplitude of (𝑡) signal, the maximum deviation in the
frequency of the carrier from its center frequency c, is given by:

∆𝜔 = 𝑘. |𝑦(𝑡)|𝑚𝑎𝑥

Practically, FM is generated by various methods given in text books. In this experiment FM will be
generated by a voltage controlled oscillator (VCO) whose frequency can be controlled by externally
applied voltage.

The FM signal is demodulated using different methods also described in various text books. In this experiment
use of a phase lock loop (PLL), has been made to demodulate the FM signal.

Procedure:

• Insert frequency modulator (FM) and FM Carrier Synchronizer (FMCS) modules in ports # 5 & 6, respectively.
Connect the circuit as shown below:

53 | P a g e
• Connect Ch1 of scope to J1 terminal and verify presence of AF signal at the input of the frequency
modulator module.

• Using AF Amp Adj. control on FMCS turn down AF signal to zero. Connect Ch2 of scope to J2 terminal
of FM module. Verify that carrier signal is present at J2. Measure frequency of the carrier signal and
record the results below:

Center frequency of the carrier =

• Next increase AF signal and see its effect on the output carrier waveform. Due to –ve slope of VCO
frequency vs. voltage curve, the signal frequency is minimum at positive signal amplitude peak. Plot
frequency modulated carrier waveform below:

(a)
• Next disconnect the connection from J2 of FMCS and reconnect it with J3 of the same. Plot the
waveforms of modulating and modulated FM signals below:

54 | P a g e
(b)

• In above case the modulating signal is square wave signal. Measure the frequency of FM signal at
positive and then negative peak of the modulating signal. Record the results below:

Frequency of FM signal at negative peak f1


Frequency of FM signal at positive peak f2

Peak to peak voltage of square wave signal “∆𝑉” =

Frequency Modulator modulation sensitivity;

• Now plug in Frequency module (FM) in port # 4 and verify audio input signal at J1 which is directly
connected by build in AF source.

• Repeat the complete experiment with AF signal 500 Hz/1KHz as performed in previous section and
record the readings.

Implementation of Frequency Demodulation

Equipment /Tools:

• Communication Trainer CT-3000,


• FM module, FM Carrier Sync. Module, PLL/FM Demodulator module, LPF module , Function generator,
• Dual channel scope,
• Multimeter

Theory

There are a number of circuits that can be used to demodulate FM. Each type has its own advantages and
disadvantages, some being used when receivers used discrete components, and others now that ICs are
widely used.

Below is a list of some of the main types of FM demodulator or FM detector. Frequency demodulators are often
referred to as discriminators or frequency detectors.

• Slope FM detector
• Foster-Seeley FM detector:
• PLL, Phase locked loop FM demodulator:
• Quadrature FM demodulator:

55 | P a g e
• Coincidence FM demodulator:

PLL FM Demodulator

Because of their low and superior performance, especially when the SNR is low, FM demodulation by using
PLL is most widely used method today.
FM input Demodulated output
Phase Low Amplifier
Detector Pass Filter

VCO

Procedure

• Disconnect the above circuit. Insert FM and PLL modules in socket # 4 and 5, respectively. Connect J2 of
FMM to J1 of PLLM. Set AF signal frequency to 1 KHz.

• PLL module demodulates frequency modulated signal. Connect CH2 of scope to J2 of PLLM. Increase AF
signal and verify CH2 displays demodulated AF signal, however, demodulated AF signal is not clean. Draw
demodulated AF signal and explain the reason for not being clean.

Freq. Modulator PLL/FM Low Pass Filter


Module Demodulator
Audio In J1 500Hz J3
J1 J2 J1 J2
J2 1 KHz J4

• Insert LPF Module in port #6 and connect FM demodulated output to LPF module to remove carrier
components from demodulated output. Clean AF signal will be seen at output of the LPF module.

• Now insert FMM in port # 2 and connect function generator sine output to its J1 terminal. Keep J2 of
FMM connected with J1 of PLLM. Set frequency of sine output signal to 1 KHz and increase level till
you see distortion free demodulated output waveform. Now increase the frequency of the modulating
sine signal and see its effect on the amplitude of the demodulated signal. The amplitude of demodulated
signal will stay constant first and then it decay. Measure the frequency of sine signal where the
amplitude of demodulated signal becomes 0.707 of the mid band value and record the results below:
56 | P a g e
Fu (-3 dB) =

This is the bandwidth of the signal which can be transmitted over this FM link.

Observation and Results


 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding code
words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
 Ability to investigate about modulation and demodulation techniques using FM in
 MATLAB

Questions
1. Investigate which technique is best among the following
 Modulation and demodulation using balanced modulator
 Modulation and demodulation using FM
2. Organize a MATLAB code for a signal using Fs=25kHz and Fc=300Hz. And then develop a
signal using Fs=15kHz and Fc=100Hz and investigate the impact of change in frequency on the
signal.
 First modulate and
 Then demodulate a signal

57 | P a g e
Lab 9: Sampling and Reconstruction of low-pass Signal

Objective
To become familiar with the sampling and reconstruction of the low-pass signal in MATLAB.

Pre-Lab
Chapter #6 of B.P.Lathi

Equipment/Software Used
Computer System with installed MATLAB

Introduction
Sampling:
Sampling is the process of recording the values of a signal at given points in time. For A/D
converters, these points in time are equidistant. The number of samples taken during one
second is called the sample rate. Keep in mind that these samples are still analogue values. The
mathematic description of the ideal sampling is the multiplication of the signal with a sequence
of direct pulses. In real A/D converters the sampling is carried out by a sample-and-hold buffer.
The sample-and-hold buffer splits the sample period in a sample time and a hold time. In case
of a voltage being sampled, a capacitor is switched to the input line during the sample time.
During the hold time it is detached from the line and keeps its voltage.

Figure 9.1: Signal

Figure 9.2: Sampled Signal

58 | P a g e
Reconstruction:
Reconstruction is the process of creating an analog voltage (or current) from samples. A
digital-to-analog converter takes a series of binary numbers and recreates the voltage (or
current) levels that corresponds to that binary number. Then this signal is filtered by a lowpass
filter. This process is analogous to interpolating between points on a graph, but it can be shown
that under certain conditions the original analog signal can be reconstructed exactly from its
samples. Unfortunately, the conditions for exact reconstruction cannot be achieved in practice,
and so in practice the reconstruction is an approximation to the original analog signal.

Figure 9.3: Reconstructed Signal.

Procedure
 Construct the given signals in Question in MATLAB using MATLAB code.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.

Observation and Results


 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding code
words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
  Ability to investigate about sampling and reconstruction in MATLAB

Questions
3. Generate a signal of your own choice then investigate the signal properties by sampling
and reconstruction of that signal.

59 | P a g e
Lab 10: Digitization of Analog Signal using Quantization

Objective
To convert an analog signal to digital signal using quantization.

Pre-Lab
Chapter #6 of B.P.Lathi and students must have complete lab 9.

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 trainer, Oscilloscope

Introduction
The digitization of analog signals involves the rounding off of the values which are
approximately equal to the analog values. The method of sampling chooses a few points on the
analog signal and then these points are joined to round off the value to a near stabilized value.
Such a process is called as Quantization.
The quantizing of an analog signal is done by discretizing the signal with a number of
quantization levels. Quantization is representing the sampled values of the amplitude by a
finite set of levels, which means converting a continuous-amplitude sample into a discrete-
time signal. The following figure shows how an analog signal gets quantized. The blue line
represents analog signal while the brown one represents the quantized signal.

Figure 10.1: Quantization of analog signal


For quantization, we limit the amplitude of the message signal 𝑚(𝑡) to the range (−𝑚𝑝 , 𝑚𝑝 ).
This range is divided into 𝐿 uniformly spaced intervals, each of width ∆𝑣 = 2𝑚𝑝 /𝐿. The
quantized samples are coded and transmitted as binary pulses.
If 𝑚(𝑘𝑇𝑠 ) is the kth sample of the signal 𝑚(𝑡), and if 𝑚
̂ (𝑘𝑇𝑠 ) is the corresponding quantized
sample, then from the interpolation formula
𝑚(𝑡) = ∑ 𝑚(𝑘𝑇𝑠 ) 𝑠𝑖𝑛𝑐(2𝜋𝐵𝑡 − 𝑘𝜋)
𝑘

and

60 | P a g e
̂ (𝑡) = ∑ 𝑚
𝑚 ̂ (𝑘𝑇𝑠 )𝑠𝑖𝑛𝑐(2𝜋𝐵𝑡 − 𝑘𝜋)
𝑘

where 𝑚̂ (𝑡) is the signal reconstructed from quantized samples.


There are two types of Quantization i.e. Uniform Quantization and Non-uniform Quantization.
The type of quantization in which the quantization levels are uniformly spaced is termed as
a Uniform Quantization. The type of quantization in which the quantization levels are
unequal and mostly the relation between them is logarithmic, is termed as Non-Uniform
Quantization.

Procedure
Software Implementation:
 Construct the signal in MATLAB using MATLAB commands.
 Define the quantization levels.
 Calculate the quantized signal using uniform.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.
Hardware Implementation:

Hardware Implementation of the Sampling Theorem

Equipment/Tools

• CT-3000 Trainer.
• Sample & Hold, Data Generator, 4 Clock, Clock to Sine Converter & LPF modules.
• Oscilloscope. Tool Kit.

Theory

A band-limited signal f(t) with maximum signal frequency fm (bandwidth) can be reconstructed by filtering when
sampled at a rate greater than twice fm. If a signal is sampled at Nyquist rate i.e. 2fm, then an ideal low pass filter is
required to reconstruct the original signal. In practice we can’t realize ideal LPF (with brick wall response), therefore
in order to reconstruct the signal free of distortion, we sample the signal at rate greater than 2fm so as to spread out in
frequency domain, the sidebands of the sampled signal. The cut off frequency of LPF must be equal to the fm and order
should be high enough to reject side bands to a sufficient level. Mathematically, if a band limited signal f(t), is sampled
with sampling function g(t) shown below, then sampled signal r(t), can written as,

𝑟(𝑡) = 𝑓(𝑡). 𝑔(𝑡)

The Fourier spectrum of the sampled signal is

Where 𝜔s = 2𝜔fs is the sampling frequency in radian/sec. The sampled signal spectrum has lobes of the
signal f(t) at 𝜔=0,. An ideal LPF of pass band of 𝜔s/2 can recover the original signal.

61 | P a g e
Diagram

Procedure

• Connect trainer to power supply. Turn on the trainer and verify the voltages of the power supply
using the multimeter.

• Plug in 4ϕCLK Module (CM), Clock to Sine Converter (CS), Data Generator (DG),
and Sample & Hold(S/H) modules in ports #1, #2, #4 and #5, respectively. Connect J1 of DG to J2 of
DG, J3 of DG to J1 of 4ϕCM, J2 of 4 CM to J3 of S/H and J1 of CS and J2 of CS to J1 of S/H.

• Connect scope CH1 to J1 of DG and verify presence of clock signal of about 66 KHz frequencies.
Next, connect CH1 to J1 of CM and see square wave signal ½ of clock signal present at J1 of
DG and then CH1 to J2 to display stable pulse waveform (sampling signal, g(t) of below figure ),
¼ of square wave signal present at J1 of CM.

• Connect CH2 of the scope to J2 of CS to display stable sine wave signal of about 1 KHz
(input signal, f(t) of below figure). Vary pot on CS to set its amplitude to one volt peak to peak
level. This signal is also the input signal to the S/H module. Set the scope time base such that
at least one complete cycle of sine wave, is displayed on CH2.

• Next connect CH2 of the scope to J2 of S/H module to display sampled 1 KHz sine signal (r(t)
of below figure) by changing the position of jumper upward on S/H module. Vary amplitude pot on CS
and see that the amplitude of the sampled signal also varies, accordingly.

62 | P a g e
Sample and Hold Circuit

• Connect a capacitor of 1000PF across J4 and J5 of S/H.


• Change the position of jumper downward on S/H module.

• Observe the output now. The sampled waveform will convert into sample and hold
waveform s(t), as shown in above figure. Draw waveform of the sampled signal below:

Signal Recovery After Sampling

• Design a simple RC low pass filter with cut off frequency of 1KHz using the equation:
63 | P a g e
• Connect sample and hold waveform to RC LPF and observe the recovered waveform.
Draw the waveform of the recovered sine signal below:

• Insert LPF filter board in port #6. Connect filtered waveform to the input of LPF and observe the
output waveform. The waveform will be smoothed and free of ripples.
• Next, remove the sample and hold capacitor and see its effect on the output waveform.

1. What is the maximum signal frequency, which can be sampled with the sampling signal of 9 KHz?

2. Explain why ripples are present in the recovered waveform?

3. Why recovered sine wave decreases as S/H capacitor is removed?

64 | P a g e
Observation and Results
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:
 Investigate the performance of Quantization with different frequencies.

Questions
1. Write your investigations about why quantization is required?
2. Differentiate between uniform and non-uniform quantization?
3. Write your analysis about quantization error?
4. Distinguish between sampling and quantization?
5. What is the maximum signal frequency, which can be sampled with the sampling signal of 9 KHz?
6. Explain why ripples are present in the recovered waveform?
7. Why recovered sine wave decreases as S/H capacitor is removed?

65 | P a g e
Lab 11: Implement the Pulse Code Modulation (PCM) Technique

Objective
To implement the Pulse Code Modulation (PCM) technique to convert analog signal to
digital signal.

Pre-Lab
Chapter #6 of B.P. Lathi and students must have complete lab 9 and lab 10.

Equipment/Software Used
Computer System with installed MATLAB, CT-3000 trainer, Ocsilloscope.

Introduction
PCM is the most useful and widely used pulse modulation technique. Basically it is a method
of converting an analog signal into digital signal. A signal is pulse code modulated to convert
its analog information into a binary sequence, i.e., 1s and 0s. The output of a PCM will
resemble a binary sequence. The following figure shows an example of PCM output with
respect to instantaneous values of a given sine wave.

Figure 11.1: PCM Output

Instead of a pulse train, PCM produces a series of numbers or digits, and hence this process is
called as digital. Each one of these digits, though in binary code, represent the approximate
amplitude of the signal sample at that instant. In PCM, the message signal is represented by a
sequence of coded pulses. This message signal is achieved by representing the signal in discrete
form in both time and amplitude.
The transmitter section of a Pulse Code Modulator circuit consists of Sampling,
Quantizing and Encoding, which are performed in the analog-to-digital converter section. The
low pass filter prior to sampling prevents aliasing of the message signal.
The basic operations in the receiver section are regeneration of impaired signals,
decoding, and reconstruction of the quantized pulse train. Following is the block diagram of
PCM which represents the basic elements of both the transmitter and the receiver sections.

66 | P a g e
Figure 11.2: Basic Elements of PCM Operation

Procedure
Software Implementation:
 Construct the signal in MATLAB using MATLAB commands.
 Define the quantization levels.
 Calculate the positive and negative peak of the quantized signal using PCM.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.

Hardware Implementation:

Implementation of PCM Encoder

Equipment/Tools

• CT-3000 Trainer.
• Digital Multimeter (DMM).
• Dual Channel Oscilloscope.
• PCM Encoder (PCME), Data Generator (DG) and Sample and Hold (S/H) modules.

Theory
Pulse Code Modulation (PCM) provides a method of digital transmission of analog messages. The
analog signal is sampled, quantized and coded to convert into digital signal. Block diagram of PCM
generation system is shown in Fig. 8.1.

67 | P a g e
The analog signal is band limited by a LPF and applied to sample-and-hold unit. The sampled signal is then
rounded off to the nearest discrete value in a set of L quantized levels. The resulting waveform is discrete in time
(by virtue of sampling) and discrete in amplitude (by virtue of quantization). Next, an encoder translates the
quantized samples into digital code words. The encoder works with binary digits (0 & 1) and produces for each
sample a code word consisting of n bits in parallel. The number of quantized levels “L” and length of code word
“n”, are related by:

L = 2n

Finally, successive code words are readout serially, to constitute PCM waveform. If fs is the sampling frequency,
then output bit rate of PCM waveform for word length n is nfs.

Procedure:

• Connect CT-3000 to power and verify that all voltages are available.
• Switch off the trainer. Insert DG module in socket 1, SH in socket 4, PCME in socket # 5 and PCMD in
• socket # 2.
• Inter connect the modules as shown in figure below and switch on the trainer.

DG

J1

S/H PCM E
S/H out
J1 J2 J1 J2

J3 J3 J4

Analog signal in

• Connect scope CH1 to clock signal of DG module and verify its presence. Next connect CH2 to J3 of
PCME and verify that sampling signal with frequency 1/9th of the clock, is available. The sampling signal is
also frame sync. since in this experiment we have single channel PCM system.
68 | P a g e
• Keep Ch2 displaying the sampling sync. signal. Using pigtail banana pin, connect AF signal to J1 of SH.
• Now connect Ch1 to J2 of SH to display S/H signal. Increase AF signal and verify that staircase (S/H)
waveform is present.
• Next connect Ch1 to J2 of PCME and verify that PCM waveform is available. Vary AF signal and verify
that PCM signal also varies. Verify that in PCM waveform a zero follows each PCM word.
• Reduce AF signal to zero. Verify that PCM signal becomes of fixed pattern.
• Connect Ch1 to J1 of PCMD. Increase AF signal. S/H waveform of demodulated AF signal will appear.
• Vary the amplitude of the AF signal and see that S/H waveform also varies, accordingly. Change frequency
of AF signal and see that frequency of S/H signal also varies. Now insert LPF module in socket # 3. With
• AF set to 1 KHz connect S/H signal to LPF input2 J2 terminal. Smooth AF signal will appear at output2
J4 terminal.
• Next disconnect jumper between J2 of SH and J1 of PCME. Connect 10K potentiometer with 5 volt
power supply as shown in figure below. This is infact a variable voltage source varying between 0 to 5 volts.

• Connect variable voltage to J1 of PCME, Ch1 to PCM output i.e. J2 of PCME. Since input of PCM
• encoder is DC therefore, PCM output bit pattern will be fixed. Vary input voltage slightly till PCM output
• bit pattern becomes 00000000. Measure input voltage to the PCME with a DMM. This gives value of
• input offset “VOS”. Next increase voltage till PCM output waveform just becomes 11111111. Measure again
• dc voltage with DMM. This is the full scale input voltage “VFS”. Record the results below:

Input off set voltage “VOS”


Full scale voltage “VFS”

• Next calculate mid-scale voltage “VMS” as under:

VMS = ( VFS - VOS )/2

• Set input voltage to VMS, and observe output pattern. Verify that output PCM pattern appears as 01111111.

Implementation of PCM Decoder

Equipment/Tools

• CT-3000 Trainer.
• Digital Multimeter (DMM).
69 | P a g e
• Dual Channel Oscilloscope.
• PCM Encoder (PCME), PCM Decoder (PCMD), Data Generator (DG) and Sample and Hold modules.

Theory
In PCM receiver (below figure), the received signal contaminated by noise, is regenerated to yield a clean
PCM waveform. Using sync and timing information, the serial bits are converted into parallel words. DAC
(digital to analog converter) then generates sample and hold (staircase) waveform.

This staircase waveform differs from original S/H waveform by the round off error, introduced in the
quantizer. Low pass filter then produces smoothed output signal, which differs from the original signal to
the extent that the quantized samples differ from the exact sample values. Quantizing process, introduces
noise in PCM signal, which depends upon word length “n”. The signal to noise ratio (SNR), of a PCM signal
is given by:

SNR = 3. 2n.K or

SNR (dB) = 10.log(K) + 4.8 +6.0.n dB

Where K is the ratio of rms to peak signal amplitudes and is always <1. For above it is obvious, that SNR
depends upon K and n. SNR improves by 6 dB whenever PCM word length “n”, is increased by one bit. K
factor is improved through use of companding.In this experiment, use of 8 bit PCM (word length n=8) has
been made. Clock signal of 64 KHz has been made. Each PCM word (encoded signal sample), is followed by
a zero to differentiate it from the succeeding PCM word (next signal sample). PCM waveform is shown in
below figure.

70 | P a g e
Frame Sync.

PCM signal
0 1 0 0 1 1 0 0 1 0 1 0 0 1 1

0 PCM word 0 Next PCM word

Procedure:

• Connect CT-3000 to power and verify that all voltages are available.
• Switch off the trainer. Insert DG module in socket 1, SH in socket 4, PCME in socket # 5 and PCMD in
socket # 2.
• Inter connect the modules as shown in figure below and switch on the trainer.

• Connect scope CH1 to clock signal of DG module and verify its presence. Next connect CH2 to J3 of
PCME and verify that sampling signal with frequency 1/9th of the clock, is available. The sampling
signal is also frame sync. since in this experiment we have single channel PCM system.
• Keep Ch2 displaying the sampling sync. signal. Using pigtail banana pin, connect AF signal to J1 of
SH. Now connect Ch1 to J2 of SH to display S/H signal. Increase AF signal and verify that staircase
(S/H) waveform is present.
• Next connect Ch1 to J2 of PCME and verify that PCM waveform is available. Vary AF signal and
verify that PCM signal also varies. Verify that in PCM waveform a zero follows each PCM word.
• Reduce AF signal to zero. Verify that PCM signal becomes of fixed pattern.

71 | P a g e
• Connect Ch1 to J1 of PCMD. Increase AF signal. S/H waveform of demodulated AF signal will appear.
Vary the amplitude of the AF signal and see that S/H waveform also varies, accordingly. Change
frequency of AF signal and see that frequency of S/H signal also varies. Now insert LPF module in
socket # 3. With AF set to 1 KHz connect S/H signal to LPF input2 J2 terminal. Smooth AF signal will
appear at output2 J4 terminal.
• Next disconnect jumper between J2 of SH and J1 of PCME. Connect 10K potentiometer with 5 volt
power supply as shown in below figure. This is infact a variable voltage source varying between 0 to
5 volts.

• Connect variable voltage to J1 of PCME, Ch1 to PCM output i.e. J2 of PCME. Since input of PCM
encoder is DC therefore, PCM output bit pattern will be fixed. Vary input voltage slightly till PCM
output bit pattern becomes 00000000. Measure input voltage to the PCME with a DMM. This gives
value of input offset “VOS”. Next increase voltage till PCM output waveform just becomes 11111111.
Measure again dc voltage with DMM. This is the full scale input voltage “V FS”. Record the results
below:

Input off set voltage “VOS”


Full scale voltage “VFS”

• Next calculate mid-scale voltage “VMS” as under:

VMS = ( VFS - VOS )/2

• Set input voltage to VMS, and observe PCM output pattern. Verify that output PCM pattern appears as
01111111. Draw the diagram of PCM pattern below:

Observation and Results


 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:
 Investigate the performance of PCM with different frequencies.

72 | P a g e
Questions
1. Evaluate the function of a quantizer in PCM?
2. Judge that, in PCM coding samples are dependent on time or frequency?
3. Judge that, in PCM encoding quantization level varies as a function of amplitude or frequency?

73 | P a g e
Lab 12: Implement the Phase Shift Keying.

Objective
To implement the modulation of a signal using Binary Phase Shift Keying (BPSK) and
Quadrature Phase Shift Keying (QPSK).

Pre-Lab
Chapter #7 of B.P.Lathi.

Equipment/Software Used
Computer System with installed MATLAB

Introduction
Phase shift keying is the digital modulation technique in which the phase of the carrier signal
is changed by varying the sine and cosine inputs at a particular time. PSK technique is widely
used for wireless LANs, bio-metric, contactless operations, along with RFID and Bluetooth
communications.
The phase of the output signal gets shifted depending upon the input. These are mainly of two
types, namely Binary Phase Shift Keying (BPSK) and Quadrature Phase Shift Keying (QPSK),
according to the number of phase shifts. The other one is Differential Phase Shift Keying
(DPSK) which changes the phase according to the previous value.
Binary Phase Shift Keying (BPSK)
This is also called as 2-phase PSK or Phase Reversal Keying. In this technique, the sine wave
carrier takes two phase reversals such as 0° and 180°. BPSK is basically a Double Side Band
Suppressed Carrier (DSBSC) modulation scheme, for message being the digital information.
BPSK Modulator
The block diagram of Binary Phase Shift Keying consists of the balance modulator which has
the carrier sine wave as one input and the binary sequence as the other input. The modulation
of BPSK is done using a balance modulator, which multiplies the two signals applied at the
input. For a zero binary input, the phase will be 0° and for a high input, the phase reversal is
of 180°. Diagrammatic representation of BPSK Modulated output wave along with its given
input is shown in Figure 12.2.

Figure 12.1: BPSK Modulator

74 | P a g e
Figure 12.2: BPSK Modulated Output Wave

The output sine wave of the modulator will be the direct input carrier or the inverted (180°
phase shifted) input carrier, which is a function of the data signal.
Quadrature Phase Shift Keying (QPSK)
This is the phase shift keying technique, in which the sine wave carrier takes four phase
reversals such as 0°, 90°, 180°, and 270°. QPSK is a variation of BPSK, and it is also a Double
Side Band Suppressed Carrier (DSBSC) modulation scheme, which sends two bits of digital
information at a time, called as digits. Instead of the conversion of digital bits into a series of
digital stream, it converts them into bit pairs. This decreases the data bit rate to half, which
allows space for the other users.
QPSK Modulator
The QPSK Modulator uses a bit-splitter, two multipliers with local oscillator, a 2-bit serial to
parallel converter, and a summer circuit.

Figure 12.3: QPSK Modulator Block Diagram

At the modulator’s input, the message signal’s even bits (i.e., 2nd bit, 4th bit, 6th bit, etc.) and
odd bits (i.e., 1st bit, 3rd bit, 5th bit, etc.) are separated by the bits’ splitter and are multiplied
with the same carrier to generate odd BPSK (called as PSKI) and even BPSK (called as PSKQ).
The PSKQ signal is anyhow phase shifted by 90° before being modulated.
75 | P a g e
Figure 12.4: QPSK Waveform for 2 bits inputs

Procedure
 Construct the signals in MATLAB using MATLAB commands.
 Construct the modulator of BPSK and QPSK.
 Plot all the signals given in questions.
 Take the printout of these plots and attach theses in your workbook.

Hardware Implementation:

Hardware Implementation of the PSK Modulation

Equipment/Tools
• CT-3000 Trainer.
• PSK Modulator Module, Data Generator Module.
• Multimeter.
• Dual Channel Oscilloscope.
• Tool Kit

Theory
In experiment # 5, we discussed digital carrier modulation schemes and we performed experiment
on frequency shit keying (FSK). In this experiment we will look at Phase Shift Keying (PSK) and
Amplitude Shift Keying (ASK). Briefly, in PSK, it is phase changes of a sine wave that represents
the binary ones and zeroes of digital signals. A binary zero is 180ϕ out of phase (phase shifted) with
respect to a binary one. Each phase shift occurs at 0 to 1 or 1 to 0 transition. The amplitude and
frequency of the carrier remains constant. Mathematically, PSK signal is represented by the
following equation:

𝑦(𝑡). 𝑐𝑜𝑠𝜔𝑡 + ̅𝑦̅(̅𝑡̅). cos (𝜔𝑡 + 180)

Where y(t) is the NRZ/Manchester signal. Figure below shows PSK modulated signal for given NRZ
data. In ASK, the presence and absence of a sine wave represents the binary ones and zeroes.
A binary 1 represents fixed amplitude sine wave and absence of sine wave represents, zero.
76 | P a g e
PSK modulator is shown in figure below, where cos𝜔t and cos (𝜔t+180) are generated by a phase
shifter. The NRZ data y(t) and its complement ̅𝑦̅(̅𝑡̅), are multiplied in analog switch IC 4066, with
𝑐𝑜𝑠𝜔𝑡 and cos (𝜔𝑡 + 180) carrier, respectively. The two components are added together to generate
PSK signal. To generate ASK signal, ̅𝑦̅(̅𝑡̅). cos (𝜔𝑡 + 180) is set to zero.

NRZ NRZ to
BM
PSK
Bipolar
converter

cos 𝜔t

BM

To demodulate PSK or ASK signals, a balance modulator is used where ASK & PSK signals are
demodulated synchronously by multiplying the signals with the carrier. The demodulated
signals are passed through LPF to recover (𝑡) data waveform.

Diagram:

Procedure

PSK Modulation:

• Connect the CT-3000 Trainer to the 220V AC power supply.

77 | P a g e
• Turn on the trainer and verify the voltage of the power supply using the multimeter.

• Insert DG and PSKM modules in ports 2 and 5, respectively. Connect CLK o/p from J3 of
PSKM to CLK input of DG at J2 and NRZ1 of DG to Data in of PSKM.

• Connect CH1 to BNC socket of AF signal and set it to 1 volt pk to pk level and 1KHz frequency.
• Next connect CH2 to CLK o/p of PSKM and verify that stable CLK is available. If CLK is not
present then vary slightly AF signal amplitude till you get CLK o/p. Now connect CH2 probe
to NRZ1 pin in data module and look for data pattern.

• Connect CH2 to PSK output. You will see PSK modulated waveform. Adjust AF signal
to avoid any clipping in the waveform. Move CH2 probe between PSK output and data
input terminals. Draw the waveforms of data input and PSK output signals. Verify that phase
of the carrier changes by 180ϕ at data transitions. Slightly vary the 50K potentiometer on
PSKM to adjust well shaped phase transition.

Implementation of PSK demodulation

Equipment/Tools
• CT-3000 Trainer.
• PSK Modulator Module, Data Generator Module, Balance Modulator Multimeter.
• Dual Channel Oscilloscope.
• Tool Kit

Theory
In experiment # 5, we discussed digital carrier modulation schemes and we performed experiment
on frequency shit keying (FSK). In this experiment we will look at Phase Shift Keying (PSK) and
Amplitude Shift Keying (ASK). Briefly, in PSK, it is phase changes of a sine wave that represents
the binary ones and zeroes of digital signals. A binary zero is 180ϕ out of phase (phase shifted) with
respect to a binary one. Each phase shift occurs at 0 to 1 or 1 to 0 transition. The amplitude and
frequency of the carrier remains constant. Mathematically, PSK signal is represented by the
following equation:

𝑦(𝑡). 𝑐𝑜𝑠𝜔𝑡 + ̅𝑦̅(̅𝑡̅). cos (𝜔𝑡 + 180)

Where y(t) is the NRZ/Manchester signal. Above figure shows PSK modulated signal for given NRZ
data. In ASK, the presence and absence of a sine wave represents the binary ones and zeroes. A
binary 1 represents fixed amplitude sine wave and absence of sine wave represents, zero. Above
figure shows the ASK signal. Mathematically, ASK signal is represented by y(t).cos𝜔t.

PSK modulator is shown in below figure, where cos𝜔t and cos( t+180) are generated by a phase
shifter. The NRZ data y(t) and its complement ̅𝑦̅(̅𝑡̅), are multiplied in analog switch IC 4066, with
𝑐𝑜𝑠𝜔𝑡 and cos (𝜔𝑡 + 180) carrier, respectively. The two components are added together to generate
PSK signal. To generate ASK signal, ̅𝑦̅(̅𝑡̅). cos( 𝜔𝑡 + 180) is set to zero.

78 | P a g e
To demodulate PSK or ASK signals, a balance modulator is used where ASK & PSK signals are demodulated
synchronously by multiplying the signals with the carrier. The demodulated signals are passed through LPF to recover
y(t) data waveform.

79 | P a g e
Diagram:

Procedure

PSK Demodulation:

• Connect the CT-3000 Trainer to the 220V AC power supply.

• Turn on the trainer and verify the voltage of the power supply using the multimeter.

• Insert DG and PSKM modules in ports 2 and 5, respectively. Connect CLK o/p from J3 of
PSKM to CLK input of DG at J2 and NRZ1 of DG to Data in of PSKM.

• Connect CH1 to BNC socket of AF signal and set it to 1 volt pk to pk level and 1 KHz frequency.
• Next connect CH2 to CLK o/p of PSKM and verify that stable CLK is available. If CLK is not
present then vary slightly AF signal amplitude till you get CLK o/p. Now connect CH2
probe to NRZ1 pin in data module and look for data pattern.

• Connect CH2 to PSK output. You will see PSK modulated waveform as shown in figure above.
• Adjust AF signal to avoid any clipping in the waveform. Move CH2 probe between PSK o/p
and data I/P terminals. Draw the waveforms of data I/P and PSK O/P signals.
Verify that phase of the carrier changes by 180ϕ at data transitions. Slightly vary the
50K potentiometer on PSKM to adjust well shaped phase transition.

• PSK is demodulated using balance modulator with AF carrier and PSK input signals.
Insert balance modulator module in port # 6. The AF carrier is applied to the modulator through
one of the socket pins. Connect PSK modulated waveform to the BM. Monitor synchronous
detected output waveform of demodulator on scope. Adjust 50K pot till you get waveform.
Now design a simple RC LPF of cut off frequency 120Hz and observe its output, which will be
same as that of NRZ1.

80 | P a g e
Observation and Results
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:
 Investigate the performance of BPSK and QPSK with different signals.

Questions
1. Analyze the difference between BPSK and QPSK?
2. Write your investigations that how bigits are transmitted?
3. Evaluate the function of balanced modulator in BPSK?

81 | P a g e
Lab 13: Implement the Frequency Shift Keying.

Objective
To implement the modulation of a signal using Frequency Shift Keying (FSK).

Pre-Lab
Chapter #7 of B.P.Lathi.

Equipment/Software Used
Computer System with installed MATLAB

Introduction
Frequency Shift Keying (FSK) is the digital modulation technique in which the frequency of
the carrier signal varies according to the digital signal changes. FSK is a scheme of frequency
modulation. The output of a FSK modulated wave is high in frequency for a binary High input
and is low in frequency for a binary Low input. The binary 1s and 0s are called Mark and Space
frequencies. Diagrammatic representation of FSK modulated waveform along with its input is
given in Figure 13-1.

Figure 13.1: FSK Modulated Output Wave

To find the process of obtaining this FSK modulated wave, let us know about the working of
a FSK modulator. The FSK modulator block diagram comprises of two oscillators with a clock
and the input binary sequence.

82 | P a g e
Figure 13.2: Block Diagram of FSK Modulator

The two oscillators, producing a higher and a lower frequency signals, are connected to a
switch along with an internal clock. To avoid the abrupt phase discontinuities of the output
waveform during the transmission of the message, a clock is applied to both the oscillators,
internally. The binary input sequence is applied to the transmitter so as to choose the
frequencies according to the binary input.

Procedure
 Construct the signal in MATLAB using MATLAB commands.
 Apply the FSK modulation technique on signal.
 Plot all the signals.
 Take the printout of these plots and attach theses in your workbook.

Hardware Implementation:

Hardware Implementation of the FSK Modulation

Equipment/Tools
• CT-3000 Trainer.
• Data Generator, FSK Modulator & FSK Demodulator modules and Multimeter
• Dual Channel Oscilloscope

Theory:

So far we have carried out experiments regarding base band digital modulation techniques, which are
suitable for transmission of signals over wire and short distances. When base band signal is transmitted
over a radio link, its spectrum is shifted to high frequency range to efficiently radiate the low frequency
base band signal. A spectrum shift is also required to transmit several message signals simultaneously by
sharing the large bandwidth of the transmission medium. The spectrum can be shifted to a higher
frequency by modulating the amplitude, phase and frequency of the high frequency carrier. In amplitude
modulation, NRZ base band signal y(t), is multiplied with the carrier cos𝜔𝑐t, we have modulated carrier
y(t).cos𝜔𝑐t, as shown in below figure. This modulation scheme of transmitting binary data is known as
amplitude shift keying (ASK). When the data is transmitted by varying the

83 | P a g e
ASK

FSK

PSK

carrier frequency, the modulation scheme is known as frequency shift keying (FSK). A “0” bit is
transmitted by a carrier pulse of “f1” frequency, and “1” bit is transmitted by carrier pulse of “f2”
frequency. FSK signal waveform is shown in above figure. If the base band signal y(t), were polar
(where “1” data bit is represented by +ve pulse, and “0” bit is represented by –ve pulse), the
corresponding modulated signal would appear as shown in above figure.
The phase of the carrier, when “1” bit is transmitted differ by radians than that when “0” bit is
transmitted. The bit information therefore resides in the phase of the carrier. This scheme is known as
phase shit keying. We will take up ASK & PSK in next experiment, however, we perform experiment on
FSK here. Mathematically, we can represent FSK signal as summation of two ASK signals as under:

𝑠(𝑡) = 𝑦(𝑡). cos(𝜔1𝑡) + ̅𝑦̅(̅𝑡̅). cos(𝜔2𝑡)


where and y(t) & y(t) are NRZ and NRZ complement are
data signals. The PSD of FSK is then summation of PSD two ASK signals. Practically, FSK is generated
by modulating a frequency modulator with a digital signal y(t). This type of FSK is known as
Continuous–phase FSK “CPFSK” which can be represented mathematically as,

𝑠(𝑡) = 𝐴𝑐. cos (𝜔𝑐𝑡 + 𝜃 + 𝜔𝑑)

Diagram

84 | P a g e
Procedure FSK Modulator

• Connect the CT-3000 Trainer to the 220V AC power supply.


• Turn on the trainer and verify the voltages of the power supply using the multimeter.
• Insert Data Generator and FSK Modulator (FSKM) modules in ports 1 & 2 respectively.
Connect NRZ1 data to data in of FSKM module. Also connect NRZ data on CH1 of the scope.
Trigger scope in external mode from the CLK+ signal in DG module. By selecting suitable time
base you will see stable NRZ data waveform on the scope.
• Now connect FSK out signal to the CH2 and observe the waveform of frequency shift keyed signal.
At positions where NRZ signal is “1” FSK signal frequency is on higher side as compare to when
NRZ data is “0”.
• Remove NRZ data from FSK input and connect it to +5 volt supply. Measure on scope the
output frequency of the FSK modulator. Next ground the data input port and again measures
the frequency. Record the results in the table below.

Data Input Output Frequency


1
0
Mean Frequency =

• Reconnect NRZ2 data to the FSK data input. Observe FSK output signal NRZ2 input signal on the
scope. Plot the two waveforms. Vary CLK rate knob on the trainer till data rate becomes up to 300
baud.

FSK Demodulator

• The FSK signal is demodulated using a phase lock loop. Insert FSK Demodulation module in
port # 6. Observe VCO free running frequency (pin # 12 of IC XR2211), on the scope.
Using potentiometer, adjust VCO frequency till it is equal to the mean of the two frequencies
recorded in table above.

• Now apply FSK modulated signal to the FSK Demod. The modulating data NRZ signal will
appear at the output of the demodulator. If the NRZ data is not recovered properly, then readjust
VCO frequency slightly. Display the recovered NRZ data on CH1 and original NRZ data on CH2 of
the scope. Compare the two waveforms.

85 | P a g e
Observation and Results
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:

 Investigate the performance of FSK with different signals.

Questions
1. Investigate the difference between mark and space frequencies?
2. Evaluate the function of clock in FSK modulator?

86 | P a g e
Lab 14: Implement the Frequency Hopping Spread Spectrum (FHSS)
Communication.
Objective
To implement the frequency hopping spread spectrum communication using FSK.

Pre-Lab
Chapter #11 of B.P.Lathi.

Equipment/Software Used
Computer System with installed MATLAB

Introduction
Spread spectrum technologies were developed for military and intelligence to overcome the
shortcomings against jamming and interception. The basic idea was to expand each user signal
to occupy a much broader spectrum than necessary. For fixed transmission, a broader spectrum
means both lower signal power level and higher spectral densities.
One of the dominant spread spectrum technologies is Frequency Hopping Spread Spectrum
(FHSS). In FHSS, each user can still use its conventional modulation. The only difference is
that now the carrier frequency can vary over regular intervals. When each user can vary its
carrier frequency according to a predetermined, pseudorandom pattern, its evasive signal
effectively occupies a broader spectrum and becomes harder to intercept and jam. The
implementation of FHSS is shown in Figure 14.1.

Figure 14.1: Implementation of FHSS

Most of FHSS signals adopt binary FSK modulation instead of more efficient PAM, PSK and
QAM. The motivation for choosing FSK stems from its ability to utilize non coherent
detection. Due to PN hopping pattern, coherent detection would require the receiver to
maintain phase coherence with the transmitter at every one of the frequencies used in the
hopping pattern. Denote 𝑇𝑠 as symbol period, then FSK modulated signal can be written as
𝑆𝐹𝑆𝐾 (𝑡) = 𝐴 cos(𝜔𝑚 𝑡 + ∅𝑚 ) (14.1)
where,
1 3 𝑀−1
𝜔𝑚 = 𝜔𝑐 ± 2 ∆𝜔, 𝜔𝑐 ± 2 ∆𝜔, … . , 𝜔𝑐 ± ∆𝜔 (14.2)
2
87 | P a g e
The frequency synthesizer output is constant for a period of 𝑇𝑐 known as chip period. If we
denote frequency synthesizer output as 𝜔ℎ in a given chip, then FHSS signal is
𝑆𝐹𝐻 (𝑡) = 𝐴 cos[(𝜔ℎ + 𝜔𝑚 )𝑡 + ∅𝑚 ] (14.3)
If the original FSK signal has bandwidth 𝐵𝑠 Hz, then the FHSS signal has bandwidth L times
larger. L is known as the spreading factor.

𝐵𝑐 = 𝐿. 𝐵𝑠

For symbol period 𝑇𝑠 and chip period 𝑇𝑐 , corresponding symbol rate is 𝑅𝑠 = 1/𝑇𝑠 and
1
hopping rate is 𝑅𝑐 = 𝑇 .
𝑐

Procedure
 Write the MATLAB code for implementation of FHSS communication system using FSK
under partial band jamming. The jammer will jam 1 of the L frequency bands and can be
turned on or off by inputting a variable jamming = 1 or jamming = 0. Illustrate the effects
of FHSS against partial jamming bands.
 Plot all the outputs.
 Take the printout of these plots and attach theses in your workbook.

Observation and Results


 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:
 Investigate the performance of FHSS with jamming as well as BER.

Questions
1. Evaluate the advantage of spread spectrum technique?
2. Analyze the difference between slow and fast hopping?

88 | P a g e
Lab 15: Implement the Source Coding using Huffman Code.
Objective
To implement the Huffman Coding to understand the concept of source coding.

Pre-Lab
Chapter #13 of B.P.Lathi.

Equipment/Software Used
Computer System with installed MATLAB

Introduction
Huffman codes developed by D.A. Huffman in 1952 are optimal codes that map one symbol
to one code word. Huffman coding is one of the well-liked technique to eliminate coding
redundancy. It is a variable length coding and is used in lossless compression. Huffman
encoding assigns smaller codes for more frequently used symbols and larger codes for less
frequently used symbols.
To generate 𝑟 − 𝑎𝑟𝑦 Huffman code, following are the steps.
1. Arrange all the 𝑟 probabilities in the descending order.
2. Add the last 𝑟 probabilities to get a sum.
3. Rearrange all the probabilities.
4. Continue this procedure until you will get exactly 𝑟 probabilities.
For an 𝑟 − 𝑎𝑟𝑦 code, exactly 𝑟 messages left in the last. In case the original messages do not
satisfy this condition, add a dummy message with probability equal to zero is inserted. Hence
total number of messages follows 𝑟 + 𝑘(𝑟 − 1).
The Huffman code obtained in this way is also known as compact code. The average length of
the compact code is given by
𝑛

𝐿 = ∑ 𝑃𝑖 𝐿𝑖
𝑖=1

The entropy 𝐻(𝑚) of the source is


𝑛

𝐻(𝑚) = ∑ 𝑃𝑖 𝑙𝑜𝑔2 1/𝑃𝑖


𝑖=1

Code efficiency is given by


𝐻(𝑚)
ɳ=
𝐿
Redundancy is defined as
𝛾 = 1− ɳ

Procedure
89 | P a g e
 Construct the Huffman Code of the given data in MATLAB using MATLAB code.
 Display all the results..
 Take the printout of these plots and attach theses in your workbook.

Observation and Results


 A memoryless source emits six messages with probabilities 0.01, 0.25, 0.10, 0.30, 0.15,
0.12. Write the MATLAB code that will calculate the Huffman code, average length of
the code and code efficiency.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:
 Investigate the code efficiency and redundancy.

Questions
1. Write your analysis about the entropy of a source?
2. Evaluate the difference between code redundancy and code efficiency?

90 | P a g e
Lab 16: Implement the Encoding and Decoding of Linear Block Code [Open-
Ended Lab]

Objective
To implement the encoding and decoding of Linear Block code (error correcting code).

Pre-Lab
Chapter #13 of B.P.Lathi.

Equipment/Software Used
Computer System with installed MATLAB

Introduction
In coding theory, a linear code is an error-correcting code for which any linear
combination of code words is also a code word. Linear codes are traditionally partitioned
into block codes and convolutional codes. In block codes, every block of k data digits is
encoded into a longer code word of n digits (n > k).
For linear block codes, a code word consists of n digits c1 , c2 , … . cn and a data word consists
of k digits d1 , d2 , … . dk . Code word c can be computed as
c = dG (16.1)
where 𝐺 is the 𝑘 × 𝑛 matrix and is called generator matrix. For systematic codes, 𝐺 can be
partitioned into 𝑘 × 𝑘 identity matrix 𝐼𝑘 and a 𝑘 × 𝑚 matrix 𝑃. For example,
1 0 0 1 0 1
𝐺 = [0 1 0 0 1 1]
0 0 1 1 1 0

𝐼𝑘 𝑃
From equation 16.1, we can write
𝑐 = 𝑑 [𝐼𝑘 𝑃]
= [𝑑 𝑑𝑃]
𝑐 = [𝑑 𝑐𝑝 ]
where the check digits or parity bits are
𝑐𝑝 = 𝑑𝑃 (16.2)

From equation 16.2,


𝑃
𝑑. 𝑃  𝑐𝑝 = [𝑑 𝑐𝑝 ] [ ]=0
𝐼𝑚
where 𝐼𝑚 is the identity matrix of order 𝑚 × 𝑚. Thus,
𝑐𝐻 𝑇 = 0 (16.3)
where
𝑃
𝐻𝑇 = [ ]
𝐼𝑚

and its transpose is called the parity check matrix and is given by
91 | P a g e
𝐻 = [𝑃𝑇 𝐼𝑚 ]

Consider the received word 𝑟. Because of possible errors caused by channel noise, 𝑟 in general
differs from the transmitted code word 𝑒,
𝑟 =𝑐𝑒

where the error word (or error vector) 𝑒, is also a row vector of 𝑛 elements. For example, if the
data word 100 is transmitted as a code word 100101 and the channel noise causes a detection
error in the third digit, then
𝑟 = 101101
𝑐 = 100101
𝑒 = 001000

Thus, an element 1 in 𝑒 indicated an error in the corresponding position, and 0 indicates no


error. Suppose the transmitted code word 𝑐𝑖 and the channel noise causes an error 𝑒𝑖 , making
the received word 𝑟 = 𝑐𝑖 + 𝑒𝑖 . If there were no errors, that is, if 𝑒𝑖 were 000000, then we
would have 𝑟𝐻 𝑇 = 0. But because of possible channel errors, 𝑟𝐻 𝑇 is in general a non-zero row
vector 𝑠, called the syndrome.
𝑠 = 𝑟𝐻 𝑇 (16.4)
= (𝑐𝑖  𝑒𝑖 )𝐻 𝑇

= 𝑐𝑖 𝐻 𝑇  𝑒𝑖 𝐻 𝑇
𝑠 = 𝑒𝑖 𝐻 𝑇 (16.5)
Thus,
𝑟 = 𝑐𝑖  𝑒𝑖
𝑐 = 𝑟  𝑒𝑚𝑖𝑛

where 𝑒𝑚𝑖𝑛 is the minimum weight vector (a vector 𝑒 with the smallest number of 1s).

Procedure
 Make the generator matrix 𝐺 consisted of 𝐼𝑘 and 𝑃 of order 𝑘 × 𝑘 and 𝑘 × 𝑚 respectively.
 Construct any (𝑛, 𝑘) linear block code by inputting different data vectors.
 Evaluate the received code word assuming error in the particular bit of the code word.
 Evaluate the syndrome in the corresponding code word.

Observation and Results


 Write the MATLAB code for implementing linear block code. Simulate the code and
execution of your MATLAB code must display the data words and the corresponding
code words.
 Run all the codes, understand the code and then attach the prints of the outputs.
 Answer the questions given in question section.

Learning Outcome
At the end of the lab, students should be able to:
 Investigate encoding and decoding of linear block code to find the error in the received
pattern and then find the corrected code.

92 | P a g e
Questions
1. Evaluate the weight of code word [1 0 1 1 0 1].
2. Analyze the difference between the length and weight of the code word.
3. Evaluate the hamming distance of [1 0 1 1 1 0 1] and [1 1 0 0 1 0 1].

93 | P a g e
LAB 17: Project
Objective
To design and implement a multidisciplinary project .

94 | P a g e

Anda mungkin juga menyukai