0% found this document useful (0 votes)
13 views83 pages

Ilovepdf Merged

Uploaded by

vavilalamahsh76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views83 pages

Ilovepdf Merged

Uploaded by

vavilalamahsh76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

IIPC 207: SIGNALS & COMMUNICATION LAB USING MATLAB

Pre-requisite: L T P Credits Total


contact
hours
0 0 2 1 24-28

Brief Description of the Course:


This lab aims to get familiarize the students about the numerical computing in various
fields. MATLAB allows matrix manipulations, plotting the function by using polar
&contour3 commands, implementation of algorithms & creation of user interfaces. It
calculates their design, waveforms, graphs, circles, circular helix and solves various
integral and differential equations. The purpose of this course is to familiarize the
students about the practical implementation Signals and Communication topics such
as analog and digital modulation and demodulation schemes.

List of Experiments

1. (i) To define and use variables, vectors, matrices, and their functions in MATLAB.

(ii) To study various arithmetic operators and mathematical functions in MATLAB.

2. (i) To create and use m-files.

(ii) To study various MATLAB commands for creating two- and three-dimensional
plots.

3. Write a MATLAB program to plot the following continuous-time and discrete-time


signals:

1. Step Function
2. Impulse Function
3. Exponential Function
4. Ramp Function
5. Sine Function

4. (i) Write a MATLAB program to perform amplitude-scaling, time-scaling, and time-


shifting on a given signal.
(ii) Write a MATLAB program to obtain linear convolution of the given sequences.

5. Write a MATLAB program to generate the Fourier series of (i) a square wave and (ii)
a triangular wave.

6. Write a MATLAB program to calculate and plot the Fourier transform of:

(i) Rectangular pulse (ii) Triangular pulse (iii) Gaussian pulse


7. Write a MATLAB program to find the impulse response and step response of a
system from its difference equation.

8. Write a MATLAB program for:

(i) amplitude modulation and demodulation.

(ii) frequency modulation and demodulation

9. Write a MATLAB program for:

(i) DSB-SC modulator and detector

(ii) SSB-SC Modulator and Detector (Phase Shift Method).

10. Write a MATLAB program for the verification of the sampling theorem for:

(i) Low pass signals (ii) Band pass signals

11. Write a MATLAB program for PAM, PWM, PPM and PCM modulation and
demodulation schemes.

12. Write a MATLAB program for PSK, FSK, and ASK modulation and demodulation
schemes.

Course Outcomes: Atthe end ofthe coursethestudent will be able to:

CO1 Learn basics of MATLAB Programing.


CO2 Write MATLAB Programs for analysis of signals & systems
CO3:Simulate variousmodulation and demodulation schemes.
LAB EXPERIMENTS
LAB EXPERIMENT 1
OBJECT:
Introduction to MATLAB.
(i) To define and use variables and functions in MATLAB.
(ii) To define and use vectors, matrices and polynomials in MATLAB.
(iii) To study various MATLAB arithmetic operators and mathematic function.

SOFTWARE USED: MATLAB

THEORY: MATLAB is a programming language developed by Math Works. It started out as a


matrix programming language where linear algebra programming was simple. MATLAB (matrix
laboratory) is a fourth-generation high-level programming language and interactive environment
for numerical computation, visualization and programming.

MATLAB is developed by Math Works.


It allows matrix manipulations; plotting of functions and data; implementation of algorithms;
creation of user interfaces; interfacing with programs written in other languages, including C,
C++, Java, and FORTRAN; analyze data; develop algorithms; and create models and
applications.

It has numerous built-in commands and math functions that help you in mathematical
calculations, generating plots, and performing numerical methods.

In MATLAB environment, every variable is an array or matrix.


Variables can be defined in MATLAB in the following ways:

x=3 % defining x and initializing it with a value


x = sqrt(16) % defining x and initializing it with an expression
The clear command deletes all (or the specified) variable(s) from the memory.

clear x % it will delete x, won't display anything


clear % it will delete all variables in the workspace
% peacefully and unobtrusively
A vector is a one-dimensional array of numbers. MATLAB allows creating two types of vectors:

• Row vectors
• Column vectors
Row vectors are created by enclosing the set of elements in square brackets, using space or
comma to delimit the elements.
For example,

r = [7 8 9 10 11]
Column vectors are created by enclosing the set of elements in square brackets, using
semicolon(;) to delimit the elements.

c = [7; 8; 9; 10; 11]

Creating Matrices
A matrix is a two-dimensional array of numbers.

In MATLAB, a matrix is created by entering each row as a sequence of space or comma separated
elements, and end of a row is demarcated by a semicolon. For example a 3-by-3 matrix is created
as:

m = [1 2 3; 4 5 6; 7 8 9]
MATLAB ENVIRONMENT:
• Command Window
• Command History
• Workspace
• Current Directory
• Figure Window

Command Window:
Whenever MATLAB is invoked, the main window called command window is activated. The
command window displays the command prompt’>>’ and a cursor where commands are entered
and are executed instantaneously.

Command History Window:


Command history window consists of a list of all the commands that are entered at the command
window. These commands remain in the list until they are deleted. Any command may be
executed by selecting and double clicking it with the mouse.

Workspace:
A workspace is a collection of all the variables that have been generated so far in the current
MATLAB session and shows their data type and size. All the commands executed from
Command Window and all the script files executed from the Command Window share common
workspace, so they can share all the variables.

Current Directory:
The Current Directory window contains all the files and folders present in the Current Directory.
To run any file, it must either be in the Current Directory or on the search path.

Edit Window:
An Edit Window is used to create a new program file, or to modify existing files. In this window,
programs can be written, edited and saved. The programs written using the MATLAB editor are
automatically assigned an extension (.m) by the editor and are known as M- files.
Figure Window:
A Figure Window is a separate window with default white background and is used to display
MATLAB graphics. The results of all the graphic commands executed are displayed in the figure
window.
MATLAB allows two different types of arithmetic operations −
• Matrix arithmetic operations
• Array arithmetic operations
Matrix arithmetic operations are same as defined in linear algebra. Array operations are executed
element by element, both on one dimensional and multi-dimensional array.
The matrix operators and arrays operators are differentiated by the period (.) symbol. However,
as the addition and subtraction operation is same for matrices and arrays, the operator is same for
both cases.
The following table gives brief description of the operators −

Description
Operator

Addition or unary plus. A+B adds the values stored in variables A and B. A and B
+ must have the same size, unless one is a scalar. A scalar can be added to a matrix
of any size.

Subtraction or unary minus. A-B subtracts the value of B from A. A and B must
- have the same size, unless one is a scalar. A scalar can be subtracted from a
matrix of any size.

Matrix multiplication. C = A*B is the linear algebraic product of the matrices A


and B. More precisely,

Slash or matrix right division. B/A is roughly the same as B*inv(A). More
/
precisely, B/A = (A'\B')'.
Array right division. A./B is the matrix with elements A(i,j)/B(i,j). A and B must
./
have the same size, unless one of them is a scalar.

Backslash or matrix left division. If A is a square matrix, A\B is roughly the same
as inv (A)*B, except it is computed in a different way. If A is an n-by-n matrix and
\ B is a column vector with n components, or a matrix with several such columns,
then X = A\B is the solution to the equation AX = B. A warning messageis
displayed if A is badly scaled or nearly singular.
Array left division. A.\B is the matrix with elements B(i,j)/A(i,j). A and B must
.\
have the same size, unless one of them is a scalar.
Array power. A. ^B is the matrix with elements A (i,j) to the B(i,j) power.
.^
A andB must have the same size, unless one of them is a scalar.
Matrix power. X^p is X to the power p, if p is a scalar. If p is an integer, the
power is computed by repeated squaring. If the integer is negative, X is inverted
^
first. For other values of p, the calculation involves eigenvalues and eigenvectors,
such that if [V,D] = eig(X), then X^p = V*D.^p/V.

Matrix transpose. A' is the linear algebraic transpose of A. For complex matrices,
'
this is the complex conjugate transpose.

Array transpose. A' is the array transpose of A. For complex matrices, this does
.' not involve conjugation.

Functions for Arithmetic Operations:-

Apart from the above-mentioned arithmetic operators, MATLAB provides the following
commands/functions used for similar purpose −
Function Description
Unary plus; increments by the amount a
uplus(a)
plus (a,b) Plus; returns a + b
uminus(a) Unary minus; decrements by the amount a
minus(a, b) Minus; returns a - b
times(a, b) Array multiply; returns a.*b
rdivide(a, b) Right array division; returns a ./ b
ldivide(a, b) Left array division; returns a.\ b
mrdivide(A, B) Solve systems of linear equations xA = B for x
mldivide(A, B) Solve systems of linear equations Ax = B for x
power(a, b) Array power; returns a.^b
mpower(a, b) Matrix power; returns a ^ b
PROGRAM:-
a = 10;
b = 20;
c=a+b
d=a-b
e=a*b
f=a/b
g=a\b
x = 7;
y = 3;
z=x^y
EXPERIMENT - 2

The M Files
MATLAB allows writing two kinds of program files -
• Scripts − script files are program files with .m extension. In these files, you write series
of commands, which you want to execute together. Scripts do not accept inputs and do
not return any outputs. They operate on data in the workspace.

• Functions − functions files are also program files with .m extension. Functions can accept
inputs and return outputs. Internal variables are local to the function.

You can use the MATLAB editor or any other text editor to create your .m files.

RESULTS:- All the operations have been performed a using MATLAB and results have been
seen on the command window.

RELATED QUESTIONS:-

1. How to create matrix in MATLAB?


2. Name some electronics engineering fields where MATLAB can be used.
3. What is the function of MATLAB function clc?
4. What happens if we put a semicolon after a statement in a MATLAB program?
5. What are M –files?
LAB EXPERIMENT 2

OBJECT:-
i) Plot the basic signals (Impulse, Step function and Ramp function)
ii) To create 2-D and 3-D plots.

SOFTWARE USED:- MATLAB

PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:-

Impulse Function
The impulse function is defined as

and
δ(t = 0 for t ≠ 0)
That is the impulse function has zero amplitude everywhere expect at t = 0.

δ(t)

0 t

Step Function
The unit step function is defined as
U(t) = 1 for t ≥ 0
= 0 for t > 0

ut

1.0

0 1 2 3 4 5 t
Program:
t=(-2:0.01:10);
impulse = t==0;
unitstep = t>=0;
plot(t, impulse)
plot(t, unitstep)
ramp = t.*unitstep;
plot(t,ramp)
xlabel('Time')
ylabel('Amplitude')
title('impulse function')
title('unit step function')
title('ramp function')

2-D plot
Define x as a vector of linearly spaced values between 0 and . Use an increment
of π/10 between the values. Define y as sine values of x.

Program:
clc
clear all
x=(0:pi/10:2*pi)
y=sin(x)
plot(x,y)
title('2D Plot')
xlabel('Time')
ylabel('Amplitude')

3-D plot
A three-dimensional plot may refer to
a) A graph or plot embedded into a three-dimensional space
b) The plot of a function of two variables, embedded into a three-dimensional space

Program:
clc
clear all
t=(-4:0.01:4)
x=t.^2
y=4*t
plot3(x,y,t)
grid on
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
title('3D Plot')
RESULTS:
Results have been seen on the command window.

Figure-1

Figure-2

Figure-3
2D Plot
1

0.8

0.6

0.4

0.2

Amplitude
0

-0.2

-0.4

-0.6

-0.8

-1
0 1 2 3 4 5 6 7
Time

Figure-4
3D Plot

2
z-axis

-2

-4
20
10 20
0 15
10
-10 5
-20 0
y-axis x- axis

Figure-5

PRECAUTIONS:-
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in proper
format.
RELATED QUESTIONS:-

1. What is the type of program files that MATLAB allows to write?


2. How to plot a graph in MATLAB?
3. What is MATLAB used for?
4. How to run MATLAB code?
5. How to comment in MATLAB?
LAB EXPERIMENT - 4

OBJECT: Write a MATLAB program to obtain linear convolution of the given


sequences.
SOFTWARE USED: MATLAB
PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:
Convolution is a mathematical operation used to express the relation between input and
output of an LTI system. It relates input, output and impulse response of an LTI system as
y(t)=x(t)∗h(t)
Where y (t) = output of LTI
x (t) = input of LTI
h (t) = impulse response of LTI

There are two types of convolutions:


a) Continuous Convolution

b) Discrete Convolution
PROGRAM:
clc;
clear all;
close;
disp('enter the length of the first sequence m=');
m=input('');
disp('enter the first sequence x[m]=');
for i=1:m
x(i)=input('');
end
disp('enter the length of the second sequence n=');
n=input('');
disp('enter the second sequence h[n]=');
for j=1:n
h(j)=input('');
end
y=conv(x,h);
figure;
subplot(3,1,1);
stem(x);
ylabel ('amplitude---->');
xlabel('n --- >');
title('x(n) Vs n');
subplot(3,1,2);
stem(h);
ylabel('amplitude --- >');
xlabel('n --- >');
title('h(n) Vs n');
subplot(3,1,3);
stem(y);
ylabel('amplitude --- >');
xlabel('n --- >');
title('y(n) Vs n');
disp('linear convolution of x[m] and h[n] is y');

INPUT:--
Enter the length of the first sequence m=
6
Enter the length of first sequence x[m]=
1
2
3
4
5
6
Enter the length of the second sequence n=
6
Enter the length of second sequence h[n]=
1
2
3
4
5
6

OUTPUT:-

Linear convolution of x[m] and h[n] is y=


1 4 10 20 35 56 70 76 73 60 36

RESULTS: - Thus the program for linear convolution is written using MATLAB and verified
.

PRECAUTIONS:
1) Program must be written carefully to avoid errors.

2) Programs can never be saved as standard function name.

3) Functions in MATLAB are case sensitive so commands must be written in proper


format.

RELATED QUESTIONS:
1. What is the MATLAB working environment?
2. What is the function of MATLAB function clear all?
3. What function can be used in MATLAB to calculate the linear convolution of two
sequences?
4. State mathematical formula for convolution of 2 discrete time signals X1 (n) & X2 (n)
LAB EXPERIMENT 4

OBJECT:- Write a MATLAB program to perform amplitude-scaling, time-scaling andtime-


shifting on a given signal.

SOFTWARE USED:-MATLAB

PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:

Amplitude Scaling
In the amplitude scaling, a signal y(t) resulting from a signal x(t), on amplitude scaling
by a real value k becomes:
y(t)=k x(t)
Program:
clc
clear all
t=(-3:0.01:7)
unitstep=t>=0
u1=3*unitstep
ramp = t.*unitstep
r1=2*ramp
plot(t,unitstep)
hold on
plot(t,ramp)
hold on
plot(t,u1)
hold on
plot(t,r1)
title('amplitude-scaling')
xlabel('Time')
ylabel('Amplitude')

Time Shifting
The time shifting of the signal x(t) is done by replacing t by t-t0 . Thus x(t-t0) represents
x(t) time shifting by t0. If t0 is positive, the shift is to the right, i.e. x(t- t0) represents the

signal x(t) delayed by t0 and if t0 is negative, the shift is to the left, i.e., x(t+ t0) represents
the signal x(t) advanced by t0.

Program:
clc
clear all
t=(-1:0.01:10)
impulse=t==0
unitstep=t>=0
u1=t>=3
u2=t>=5
plot(t,unitstep,'r')
hold on
plot(t,u1,'g')
hold on
plot(t,u2,'m')
legend('unitstep','u1','u2')
title('Time-Shifting')
xlabel('Time')
ylabel('Amplitude')

Time scaling

clear all;
close all;
clc;
k=2;
x1=[1 2 3 4 5];
a=length(x1);
n=0:1:a-1;
subplot(3,1,1);
stem(x1);
xlabel('number of samples');
ylabel('amplitude');
title('input signal');
x2=k*x1;
subplot(3,1,2);
stem(x2);
xlabel('number of samples');
ylabel('amplitude');
title('amplified signal');
x3=x1/k;
subplot(3,1,3);
stem(x3);
xlabel('number of samples');
ylabel('amplitude');
title('attenuated signal');
display(x2);
display(x3);

RESULTS:-
Results have been seen on the command window.
amplitude-scaling
14

12

10

8
Amplitude

0
-3 -2 -1 0 1 2 3 4 5 6 7
Time

Figure-1
Time-Shifting
1

0.9

0.8

0.7

0.6
Amplitude

0.5

0.4

0.3

0.2

0.1

0
-2 0 2 4 6 8 10
Time

Figure-2

Time scaling
Figure-3

PRECAUTIONS:-
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in proper
format.

RELATED QUESTIONS

1. What operations can be performed on signal?


2. What functions can be used in MATLAB to label the axis in graph?
3. Differentiate between clc and clear all functions.
4. Functions in MATLAB are case sensitive or not.
5. How to plot a graph in MATLAB?
LAB EXPERIMENT 5
OBJECT:-Write a MATLAB program to compute autocorrelation and cross correlation of a
sequence.

SOFTWARE USED:-MATLAB

PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:
Auto-correlation: Autocorrelation function gives the measure of similarity, match or
coherence between a signal and its delayed replica. This means that autocorrelation function
is a special from of a cross- correlation function. It is defined as the correlation of a signal with
itself.
Consider a signal x(t).Then the autocorrelation function of this signal with its delayed version
will be
R(τ) = lim

T→∞
The autocorrelation function is defined separately for energy signals and for power or periodic
signals.
Cross-Correlation: The correlation or more precisely cross-correlation between two different
waveforms or two signals is the measure of match or similarity or regularity between one signal
and time delayed version of the other signal.
Let us consider two general complex signals x1(t) and x2(t) is defined as
R12(τ) = lim

T→∞
PROGRAM:
stem(x1)
xlabel('Discrete time')
ylabel('Amplitude')
title('Input Sequence')
subplot(2,1,2)
stem(y)
title('Autocorelation of the Input Sequence')
xlabel('Discrete time')
xlabel('Discrete time')

RESULTS:
Results have been seen on the command window.
Input Sequence
4

3
Amplitude

0
1 1.5 2 2.5 3 3.5 4
Discrete time
Autocorelation of the Input Sequence
30

20
Amplitude

10

0
1 2 3 4 5 6 7
Discrete time

Cross-correlation
r = xcorr(x,y)
r = xcorr(x)
r = xcorr( ,maxlag)
r = xcorr( ,scaleopt)
[r,lags] = xcorr( )

example
Cross Correlation of two vectors
Create a vector x and a vector y that is equal to x shifted by 5 elements to the right. Compute and
plot the estimated cross-correlation of x and y. The largest spike occurs at the lag value when the
elements of x and y match exactly (-5).
n = 0:15;
x = 0.84.^n;
y = circshift(x,5);
[c,lags] = xcorr(x,y);
stem(lags,c)

Normalized Cross-Correlation
Compute and plot the normalized cross-correlation of vectors x and y with unity peak, and
specify a maximum lag of 10.
n = 0:15;
x = 0.84.^n;
y = circshift(x,5);
[c,lags] = xcorr(x,y,10,'normalized');
stem(lags,c)

PRECAUTIONS:
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in proper format.

RELATED QUESTIONS:

1. Differentiate between auto correlation and cross correlation.


2. What is the use of stem function in MATLAB?
3. What do you mean by M-file in MATLAB?
4. What is the use of title function in MATLAB?
5. What is the relation between cross correlation and auto correlati
LAB EXPERIMENT 6
OBJECT: Write a MATLAB program to generate Fourier series of a Square Wave.

SOFTWARE USED: MATLAB

PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:
Let’s assume we have a square wave with following characteristics:
Period=2ms
Peak−to−Peak Value=2 V
Average Value=0 V
So, we can express it as:

If g(t) is given by

Now, a Mat lab code can be written for g(t) between 0 and 4ms with an interval of 0.05 ms to
demonstrate that g(t) is a decent approximation of original function x(t).

PROGRAM:

% Fourier Series Expansion for Square Wave


%% Parameters as mentioned in text
f = 500; % Frequency
C = 4/pi; % Constant Value
dt = 5.0e-05; % Interval between teo time steps
tpts = (4.0e-3/5.0e-5) + 1; % Total points & quot;(final point-initial point)/Interval+1%
for n = 1: 12 % Values we are considering to approximate Fourier Series
instead of infinity as given in original function x(t)
for m = 1: tpts % Here, we'll consider all & quot;t& quot; points to cover &
quot;from 0 to 4ms interval & quot;
s1(n,m) = (4/pi)*(1/(2*n - 1))*sin((2*n - 1)*2*pi*f*dt*(m-1)); % Approximate Fourier
Series g(t)
end
end
for m = 1:tpts
a1 = s1(:,m); % VERY IMPORTANT ! Here, we are assigning a1 for each
single column (total 81)
a2(m) = sum(a1); % Here, we are summing up the whole column to one single
value (adding all 12 values in one column)
end
% Now, we have a row vector "a2" with total values
"81"
f1 = a2'; % Here, we have final values "f1" (total 81 points) as
transpose of a2 computed above
t = 0.0:5.0e-5:4.0e-3; % it's already given in text (0 to 4ms with interval of 0.05 ms)
plot(t,f1)
xlabel('Time, s')
ylabel('Amplitude, V')
title('Fourier Series Expansion')

RESULTS:
Results have been seen on the figure window.
PRECAUTIONS:
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in proper format.

RELATED QUESTIONS:

1. State Dirichlet’s conditions for a function to be expanded as a Fourier series.


2. What is Fourier series?
3. What are the two types of Fourier series?
4. How is a trigonometric Fourier series represented?
5. How to comment multiple lines in MATLAB?
LAB EXPERIMENT 7
OBJECT:
Write a MATLAB program to Calculate and plot using MATLAB Fourier Transform and
Z-Transform of a given signal.

SOFTWARE USED: MATLAB

PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:

Z transform:-
Fourier Transform:-
The Fourier transform of the function f is traditionally denoted by adding
a circumflex: There are several common conventions for defining the Fourier
transform of an integral function f : ℝ → ℂ. Here we will use the following definition:

for any real number ξ.


When the independent variable x represents time (with SI unit of seconds), the transform
variable ξ represents frequency (in hertz). Under suitable conditions, f is determined
by via the inverse transform:

f or any real number x.

PROGRAM:

Fourier transform of exp (-2*x^2)

clc
clear all
syms x
f=exp(-2*x^2) %our function
ezplot(f,[-2,2]) % plot of our function
FT=fourier(f) %Fourier transform
ezplot(FT)

z transform of

clc
clear all
syms z n
ztrans(1/4^n)

Inverse z transform of

clc
clear all
syms z n
iztrans(2*z/(2*z-1))

(21/2 1/2)/(2 exp(w2/8))

1.2

0.8

0.6

0.4

0.2

-6 -4 -2 0 2 4 6
w

Figure-1

RESULTS:
Z- Transform of x(n) = ¼n u(n)
x(z = z/(z-1/4)
Inverse Z- Tranforms of x(z) = 2z/2z-1
X(n) = (1/2)n

PRECAUTIONS:
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in proper
format.

RELATED QUESTIONS:

1. What are functions used in MATLAB to find z transform and Fourier transform?
2. Find Z Transform of X(n) = nu(n).
3. Find the inverse Fourier transform of f(t)=1.
4. What is the set of all values of z for which X(z) attains a finite value?
5. The Z-Transform X(z) of a discrete time signal x(n) is defined as _
LAB EXPERIMENT 8
OBJECT: Write a MATLAB program to find the impulse response and step response of a
system from its difference equation.

SOFTWARE USED: MATLAB

PROCEDURE:-
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and Run the program
• For the output see command window\ Figure window

THEORY:
Step Response
Step Response is the output from a system excited with a step input. The output step response
lasts for infinite time.
Impulse Response
Impulse Response is the output from a system excited with a unit impulse input. The output
impulse response lasts for infinite time.

PROGRAM:

Step Response: Determine the first 50 values of the step response of a system with a known
impulse response h[n]=0.5n *u[n].
clc
clear all
h=0.5.^[0:49]
x=ones(1,50)
y=conv(x,h)
stem([0:49],y(1:50))

Impulse Response: Determine the first 50 values of the step response of a system with a known
impulse response h[n] =0.5n *u[n]. Here define delta as a vector containing 21 elements. Element
number 11 is one the rest are zeros.)

clc
clear all
delta=[ zeros(1,10), 1, zeros(1,10)]
h=0.5.^[0:49]
y=conv(delta,h)
stem([0:49],y(1:50))

RESULTS:
Results have been seen on the command window.
2

1.8

1.6

1.4

1.2

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25 30 35 40 45 50

Figure-1: Impulse Response


1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
0 5 10 15 20 25 30 35 40 45 50

Figure-2: Step Response

PRECAUTIONS:
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in proper format.

RELATED QUESTIONS:

1. What is the relation between the step response and impulse response?
2. What is the use of conv function in MATLAB?
3. What will be the step response of the impulse response of a ramp function?
4. To save a file, what should be the extension of file?
5.In MATLAB, the impulse response of the step response of a system is to the step response
of the impulse response of the system.
EXPERIMENT NO - 8
AMPLITUDE MODULATION &DEMODULATION
AIM: To study the function of Amplitude Modulation & Demodulation (under
modulation, perfect modulation & over modulation) and also to calculate the modulation
index.
APPARATUS :
1. Amplitude Modulation & De modulation trainer kit.
2. C.R.O (20MHz)
3. Function generator (1MHz).
4. Connecting cords & probes.
5. PC with windows(95/98/XP/NT/2000)
6. MATLAB Software with communication toolbox
THEORY:
Modulation is defined as the process of changing the characteristics (Amplitude,
Frequency or Phase) of the carrier signal (high frequency signal) in accordance with the
intensity of the message signal (modulating signal).
Amplitude modulation is defined as a system of modulation in which the
amplitude of the carrier is varied in accordance with amplitude of the message signal
(modulating signal).
The message signal is given by the expression.
Em(t) =Em cosWmt
Where Wm is -----> Angular frequency
Em -------- Amplitude
Carrier voltage Ec(t)= Ec cosWct
E(t)=Ec + KaEm cosWmt
KaEm cosWmt ----- change in carrier amplitude
Ka----- constant
The amplitude modulated voltage is given by
E=E(t) cosWct
From above two equations
E= ( Ec+KaEm cosWmt) cosWct.
E= (1+KaEm/Ec cosWmt) Ec cosWct
E= Ec(1+Ma cosWmt)cosWct
Where Ma----- depth of modulation/ modulation index/modulation factor
Ma=KaEm/Ec
100* Ma gives the percentage of modulation.
BLOCK DIAGRAM:
Modulation

Modulating
Signal
Generator
A.M
modulator

Carrier
Generator

Demodulation

Modulating
Signal AM AM
Generator Modulator Demodulator

Carrier
Generator

PROGRAM:
% program for AM modulation and demodulation
close all
clear all
clc
fs=8000;
fm=20;
fc=500;
Am=1;
Ac=1;
t=[0:0.1*fs]/fs;
m=Am*cos(2*pi*fm*t);
c=Ac*cos(2*pi*fc*t);
ka=0.5;
u=ka*Am;
s1=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,1:3);
plot(t,m);
title('Modulating or Message signal(fm=20Hz)');
subplot(4,3,4:6);
plot(t,c);
title('Carrier signal(fc=500Hz)');
subplot(4,3,7);
plot(t,s1);
title('Under Modulated signal(ka.Am=0.5)');
Am=2;
ka=0.5;
u=ka*Am;
s2=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,8);
plot(t,s2);
title('Exact Modulated signal(ka.Am=1)');
Am=5;
ka=0.5;
u=ka*Am;
s3=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,9);
plot(t,s3);
title('Over Modulated signal(ka.Am=2.5)');
r1= s1.*c;
[b a] = butter(1,0.01);
mr1= filter(b,a,r1);
subplot(4,3,10);
plot(t,mr1);
title(' deModulated signal for(ka.Am=0.5)');
r2= s2.*c;
[b a] = butter(1,0.01);
mr2= filter(b,a,r2);
subplot(4,3,11);
plot(t,mr2);
title(' deModulated signal for(ka.Am=1)');
r3= s3.*c;
[b a] = butter(1,0.01);
mr3= filter(b,a,r3);
subplot(4,3,12);
plot(t,mr3);
title(' deModulated signal for(ka.Am=2.5)');
PROCEDURE:-
1. Connect the AC Adapter to the mains and the other side to the Experimental
Trainer. Switch ‘ON’ the power.
2. Observe the carrier and modulating waveforms and note their frequencies.
(Carrier frequency is around 100 KHz and amplitude is variable from 0 -8Vp-p,
modulating signal is 1KHz).
3. Connect the carrier and modulating signals to the modulator circuit.
4. Observe the amplitude modulated wave.
5. Connect Carrier I/P to ground and apply a 2V peak to peak AF Signal input to
(modulating I/P) and adjust P1 in anti-clock wise position to get minimum A.C
output.
6. Connect modulating I/P to ground and apply a 3V peak to peak carrier signal to
carrier I/P and adjust P2 in clock wise direction to get minimum A.C ouyput..
7. Connect modulating input &carrier input to ground and adjust P3 for zero D.C
output.
8. Make modulating i/p 2 Vpp and carrier i/p 3 Vpp peak to peak and adjust
potentiometer P4 for maximum output.
9. Calculate maximum and minimum points on the modulated envelope on a CRO
and calculate the depth of modulation.
10. Observe that by varying the modulating voltage, the depth of modulation varies.
11. During demodulation connect this AM output to the input of the demodulator.
12. By adjusting the RC time constant (i.e., cut off frequency) of the filter circuit we
get minimum distorted output.
13. Observe that this demodulated output is amplified has some phase delay because
of RC components.
14. Also observe the effects by changing the carrier amplitudes.
15. In all cases, calculate the modulation index.
EXPECTED WAVEFORMS:-
6
OBSERVATIONS:
Modulation
Vc Vm Vmax Vmin m=( Vmax-Vmin)/ m= Vm/Vc
(V) (V) (V) (V) (Vmax+Vmin)
Under
modulation
Perfect
modulation
Over
modulation
Demodulation

Modulating signal Demodulated output


Frequency signal frequency

RESULT:

QUESTIONS
1. Define AM and draw its spectrum?
2. Draw the phase’s representation of an amplitude modulated wave?
3. Give the significance of modulation index?
4. What are the different degrees of modulation?
5. What are the limitations of square law modulator?
6. Compare linear and nonlinear modulators?
7. Compare base modulation and emitter modulation?
8. Explain how AM wave is detected?
9. Define detection process?
10. What are the different types of distortions that occur in an envelop detector? How
can they be eliminated?
11. What is the condition of for over modulation?
12. Define modulation & demodulation?
13. What are the different types of linear modulation techniques?
14. Explain the working of carrier wave generator.
15. Explain the working of modulator circuit.
EXPERIMENT NO - 9(i)
DSB-SC MODULATOR & DETECTOR
AIM: To study the working of the Balanced Modulator and demodulator.
APPARATUS:
1. Balanced modulator trainer kit
2. C.R.O (20MHz)
3. Connecting cords and probes
4. Function generator (1MHz)
5. PC with windows (95/98/XP/NT/2000)
6. MATLAB Software with communication toolbox
THEORY:
Balanced modulator circuit is used to generate only the two side bands DSB-SC.
The balanced modulation system is a system is a system of adding message to carrier
wave frequency there by only the side bands are produced. It consists of two AM
modulators arranged in a balanced configuration. The AM modulator is assumed to be
identical. The carrier input to the two modulators is same.
If we eliminate or suppress the carrier then the system becomes suppressed carrier
DSB-SC. In this we need reinsert the carrier is complicated and costly. Hence the
suppressed carrier DSB system may be used in point to point communication system.
Generation of suppressed carrier amplitude modulated volt balanced modulator may
be of the following types.
1. Using transistors or FET.
2. Using Diodes
BLOCK DIAGRAM: Modulation

Modulating
Signal Generator
Balanced
Modulator
Carrier
Generator
Demodulation

Modulating
signal
Generator
Balanced Demodulator
Modulator
Carrier
Generator

PROGRAM:
% program for dsbsc modulation and demodulation
close all
clear all
clc
t =0:0.000001:.001;
Vm= 1;
Vc= 1;
fm = 2000;
fc= 50000;
m_t = Vm*sin(2*pi*fm*t);
subplot(4,1,1);
plot(t,m_t);
c_t = Vc*sin(2*pi*fc*t);
subplot(4,1,2);
plot(t,c_t);
subplot(4,1,3);
s_t = m_t.*c_t;
hold on;
plot(t,s_t);
plot(t,m_t,'r:');
plot(t,-m_t,'r:');
hold off;
r = s_t.*c_t;
[b a] = butter(1,0.01);
mr= filter(b,a,r);
subplot(4,1,4);
plot(t,mr);
PROCEDURE:-
1. Connect the circuit as per the given circuit diagram.
2. Switch on the power to the trainer kit.
3. Apply a 100KHz, 0.1 peak sinusoidal to the carrier input and a 5KHz, 0.1 peak
sinusoidal to the modulation input.
4. Measure the output signal frequency and amplitude by connecting the output to
CRO.
5. And note down the output signals.
EXPECTED WAVEFORMS:-
OBSERVATIONS:

Carrier Signal Message signal Modulated signal Demodulated Signal


output output
Fc(Hz) Vc(volts) Fm(Hz) Vm(v) Fo(Hz) Vo(v) F(Hz) V(v)

RESULT:

QUESTIONS
1. What are the two ways of generating DSB_SC?
2. What are the applications of balanced modulator?
3. What are the advantages of suppressing the carrier?
4. What are the advantages of balanced modulator?
5. What are the advantages of Ring modulator?
6. Write the expression for the output voltage of a balanced modulator?
7. Explain the working of balanced modulator and Ring Modulator using diodes.
EXPERIMENT.NO- 9(ii)
SSB-SC MODULATOR & DETECTOR
(PHASE SHIFT METHOD)
AIM:- To generate SSB using phase method and detection of SSB signal using
Synchronous detector.
APPARATUS:-
1. SSB trainer kit
2. C.R.O (20MHz)
3. Patch cards
4. CRO probes
THEORY:
AM and DSBSC modulation are wasteful of band width because they both require
a transmission bandwidth which is equal to twice the message bandwidth In SSB only
one side band and the carrier is used. The other side band is suppressed at the transmitter,
but no information is lost. Thus the communication channel needs to provide the same
band width, when only one side band is transmitted. So the modulation system is referred
to as SSB system.
The base band signal may not be recovered from a SSB signal by the Use of a
diode modulator. The bae band signal can be recovered if the spectral component of the
output i.e either the LSB or USB is multiplied by the carrier signal.
Consider the modulating signal
M(t)=Am cos Wmt
C(t)=Ac cosWct
M(t)c(t)= AcAm cosWmt cosWct
The above signal when passed through a filter, only one of the above component is
obtained which lays the SSB signal.
BLOCK DIAGRAM: -

PROGRAM:-
% program for ssb modulation and demodulation
close all
clear all
clc
fs=8000;
fm=20;
fc=50;
Am=1;
Ac=1;
t=[0:0.1*fs]/fs;
subplot(5,1,1);
m1=Am*cos(2*pi*fm*t);
plot(t,m1);
title('Message Signal');
m2=Am*sin(2*pi*fm*t);
subplot(5,1,2)
c1=Ac*cos(2*pi*fc*t);
plot(t,c1)
title('Carrier Signal');
c2=Ac*sin(2*pi*fc*t);
subplot(5,1,3)
% Susb=0.5* Am*cos(2*pi*fm*t).* Ac*cos(2*pi*fc*t) -- 0.5* Am*sin(2*pi*fm*t).*
Ac*sin(2*pi*fc*t);
Susb=0.5*m1.*c1-0.5*m2.*c2;
plot(t,Susb);
title('SSB-SC Signal with USB');
subplot(5,1,4);
Slsb=0.5*m1.*c1+0.5*m2.*c2;
plot(t,Slsb);
title('SSB-SC Signal with LSB');
r = Susb.*c1;
subplot(5,1,5);
[b a] = butter(1,0.0001);
mr= filter(b,a,r);
plot(t,mr);
title('demodulated output');

PROCEDURE:-
SSB MODULATION
1. Connect the Adaptor to the mains and the other side to the Experimental Trainer
Switch ‘ON’ the power.
2. (a) Connect carrier fc 900 to Ain of Balanced Modulator –A and adjust its amplitude to
0.1Vpp.
(b). Connect modulating signal fm 00 5Vpp to Bin of the Balanced Modulator-A.
3. Observe the DSB-A output on CRO.
4. Connect fc 00 at 0.1 Vpp at Cin of Balanced Modulator B. Connect fm 900 at 5 Vpp at
Din of Balanced Modulator B.
5. Connect the DSB-A output and DSB-B output to the summing amplifier. Observe the
output (SSB output) on the spectrum analyzer. This gives single side band (upper) only
while the lower side band is cancelled in the summing Amplifier.
SSB DEMODULATION
1. Connect the carrier fc 00 and SSB output to the synchronous detector.
2. Connect the demodulator output on the oscilloscope which is the recovered
modulating signal.
OBSERVATIONS:

Carrier Modulating Balanced Balanced Adder/ Synchronous


signal signal modulator-A modulator-B Subtractor detector
Output
Fc Vc Fm Vm Vmax Vmin Vmax Vmin Vmax Vmin Fd Vd

EXPECTED WAVE FORMS: -


RESULT:
QUESTIONS
1. What are the different methods to generate SSB-SC signal?
2. What is the advantage of SSB-SC over DSB-SC?
3. Explain Phase Shift method for SSB generation.
4. Why SSB is not used for broadcasting?

SSB DETECTION
5. Give the circuit for synchronous detector?
6. What are the uses of synchronous or coherent detector?
7. Give the block diagram of synchronous detector?
8. Why the name synchronous detector?
EXPERMENT NO- 8(ii)
FREQUENCY MODULATION AND DEMODULATION
AIM: To study the process of frequency modulation and demodulation and calculate the
depth of modulation by varying the modulating voltage.
APPARATUS :
1. FM modulation and demodulation kit
2. Dual trace CRO.
3. CRO probes
4. Patch cards.
5. PC with windows(95/98/XP/NT/2000)
6. MATLAB Software with communication toolbox
THEORY:
The modulation system in which the modulator output is of constant amplitude, in
which the signal information is super imposed on the carrier through variations of the
carrier frequency.
The frequency modulation is a non-linear modulation process. Each spectral
component of the base band signal gives rise to one or two spectral components in the
modulated signal. These components are separated from the carrier by a frequency
difference equal to the frequency of base band component. Most importantly the nature
of the modulators is such that the spectral components which produce decently on the
carrier frquency and the base band frequencies.The spetral components in the modulated
wave form depend on the amplitude.
The modulation index for FM is defined as
Mf= max frequency deviation/ modulating frequency.
BLOCK DIAGRAM:
Modulation

Modulating FM
signal modulator
generator FM output
Demodulation

Modulating FM FM Modulating
signal modulator demodulator signal
generator

PROGRAM:-
% program for fm modulation and demodulation
close all
clear all
clc
%fm=35HZ,fc=500HZ,Am=1V,Ac=1V,B=10
fs=10000;
Ac=1;
Am=1;
fm=35;
fc=500;
B=10;
t=(0:.1*fs)/fs;
wc=2*pi*fc;
wm=2*pi*fm;
m_t=Am*cos(wm*t);
subplot(4,1,1);
plot(t,m_t);
title('Modulating or Message signal(fm=35Hz)');
c_t=Ac*cos(wc*t);
subplot(4,1,2);
plot(t,c_t);
title('Carrier signal(fm=500Hz)');
s_t=Ac*cos((wc*t)+B*sin(wm*t));
subplot(4,1,3);
plot(t,s_t);
title('Modulated signal');
d=demod(s_t,fc,fs,'fm');
subplot(4,1,4);
plot(t,d);
title('demodulated signal');
PROCEDURE:
1. Switch on the experimental board.
2. Observe the FM modulator output without any modulator input which is the carrier signal
and note down its frequency and amplitude.
3. Connect modulating signal to FM modulator input and observe modulating signal and FM
output on two channels of the CRO simultaneously.
4. Adjust the amplitude of the modulating signal until we get less distorted FM output.
5. Apply the FM output to FM demodulator and adjust the potentiometer in demodulation until
we get demodulated output.

OBSERVATIONS:
Modulation
Frequency Modulating Band width=
Vm F1 F2 deviation Fd index 2(Fd+Fm)
(f1-f2) (f1-f2)/Fm

Demodulation

Modulating signal Demodulating signal


frequency frequency
EXPECTED WAVEFORMS:-

RESULT:
QUESTIONS
1. Define FM & PM.
2. What are the advantages of Angle modulation over amplitude modulation?
3. What is the relationship between PM and FM?
4. With a neat block diagram explain how PM is generated using FM.
EXPERIMENT NO- 10
VERIFICATION OF SAMPLING THEOREM
AIM:
1. To study the sampling theorem and its reconstruction.
2. To study the effect of amplitude and frequency variation of modulating signal on the
output.
3. To study the effect of variation of sampling frequency on the demodulated output.
APPARATUS:
1. Sampling and reconstruction Trainer Kit.
2. C.R.O(30Mhz)
3. Patch cords.
4. PC with windows(95/98/XP/NT/2000)
5. MATLAB Software with communication toolbox
THEORY:
Pulse Modulation is used to transmit analog information. In this system
continuous wave forms are sampled at regular intervals. Information regarding the signal
is transmitted only at the sampling times together with synchronizing signals.
At the receiving end, the original waveforms may be reconstituted from the
information regarding the samples.
Sampling Theorem Statement:
A band limited signal of finite energy which has no frequency components higher
than fm Hz, is completely described by specifying the values of the signal at instants of
time separated by ½ fm seconds.
The sampling theorem states that, if the sampling rate in any pulse modulation
system exceeds twice the maximum signal frequency, the original signal can be
reconstructed in the receiver with minimum distortion.
Fs > 2fm is called Nyquist rate.
Where fs – sampling frequency
Fm – Modulation signal frequency.
If we reduce the sampling frequency fs less than fm, the side bands and the
information signal will overlap and we cannot recover the information signal simply by
low pass filter. This phenomenon is called fold over distortion or aliasing.There are two
methods of sampling. (1) Natural sampling (2) Flat top sampling.
Sample & Hold circuit holds the sample value until the next sample is taken.
Sample & Hold technique is used to maintain reasonable pulse energy.The duty cycle of
a signal is defined as the ratio of Pulse duration to the Pulse repetition period. The duty
cycle of 50% is desirous taking the efficiency into account.
Circuit Description:-
Pulse and Modulating Signal Generator:-
A 4.096 MHz clock is used to derive the modulating signal, which is generated by
an oscillator circuit comprising a 4.096MHz crystal and three 74HC04(U9) inverter
gates. This 4.096MHz clock is then divided down in frequency by a factor of 4096, by
binary counter 74HC4040(U10), to produce 50% duty cycle, 1KHz square wave on pin
no.1 of U10, and 2KHz square wave on pin no.15. the frequency is selectable by means
of SW1. this input of fourth order low pass filter U11(TL072) is used to produce sine
wave from the square wave. The amplitude of this sine wave can be varied.
The square wave which is generated by the oscillator is buffered by inverter
74HC04(U9), to produce 32KHz square wave at pin no. 4 of the 74HC4040. This pulse is
given to the monostable multi(U4) to obtain the 16KHz and 32KHz square wave at the
output which are selected by the frequency pot.
Sampling Circuit:-
The IC DG211(U3) is used as analog switch which is used in pulse amplitude
modulation in this circuit. The modulation signal & pulse signal are given as the input to
TL074(U2), 7400(U1) IC’s respectively. These IC output are fed to the inputs of the
DG211.
The sampled output is available at the pin no.2 of DG211 and it is buffered by
using TL074(U2) and then output is available at TP5.
Similarly the sample & hold output and the flat top output are available at pin
no15 & 10 of DG211 respectively. These are buffered by TL074(U2) and then output is
available at TP6 & TP7 respectively.
Reconstruction Circuit:-
The demodulation section comprises of a fourth order low pass filter and an AC
amplifier. The TL074 (U5) is used as a low pass filter and AC amplifier. The output of
the modulator is given as the input to the low pass filter.
The low pass filter output is obviously less and it is fed to the AC amplifier which
comprises of a single op amp and whose output is amplified.
CIRCUIT DIAGRAM:

PROGRAM:-
%program for verification of sampling theorem
close all;
clear all
clc
t=-10:.01:10;
T=4;
fm=1/T;
x=cos(2*pi*fm*t); % input signal
subplot(2,2,1);
plot(t,x);
xlabel('time');ylabel('x(t)');title('continous time signal');
grid;
n1=-4:1:4;
fs1=1.6*fm;
fs2=2*fm;
fs3=8*fm;
%discrete time signal with fs<2fm
x1=cos(2*pi*fm/fs1*n1);
subplot(2,2,2);
stem(n1,x1);
xlabel('time');ylabel('x(n)');
title('discrete time signal with fs<2fm');
hold on
subplot(2,2,2);
plot(n1,x1)
grid;
%discrete time signal with fs=2fm
n2=-5:1:5;
x2=cos(2*pi*fm/fs2*n2);
subplot(2,2,3);
stem(n2,x2);
xlabel('time');ylabel('x(n)');
title('discrete time signal with fs=2fm');
hold on
subplot(2,2,3);
plot(n2,x2)
%discrete time signal with fs>2fm
grid;
n3=-20:1:20;
x3=cos(2*pi*fm/fs3*n3);
subplot(2,2,4);
stem(n3,x3);
xlabel('time');ylabel('x(n)');
title('discrete time signal with fs>2fm');
hold on
subplot(2,2,4);
plot(n3,x3)
grid;

PROCEDURE:
Sampling:-
1. Connect the circuit as shown in diagram 1 .
a. The output of the modulating signal generator TP1 is connected to modulating
signal input TP4 of the sampling circuit keeping the frequency switch in 1KHz position,
and amplitude knob to max position.
b. The output of pulse generator TP2 is connected to sampling pulse input TP3 of
the sampling circuit keeping the frequency switch in 16KHz position.(Adjust the duty
cycle pot to mid position i.e.50%).
2. Switch ON the power supply.
3. Observe the outputs of sampling, sampling and hold, flat top output at TP7, TP8
and TP9 respectively. By varying the amplitude pot also observe the effect on
outputs.
4. By varying Duty cycle pot observe the effect on sampling outputs (Duty cycle is
varying from 10-15%).
5. Vary the switch position in the pulse generator circuit to 32 KHz and now observe
the outputs at TP7, TP8 and TP9.By varying the amplitude pot also observe the
effect on outputs.
6. Now, vary the switch position in modulating signal generator to 2 KHz and repeat
all the above steps 3&4.
7. Switch OFF the power supply.
Reconstruction:-
1. Connect the circuit as shown in diagram 2.
a. . The output of the modulating signal generator TP1 is connected to
modulating signal input TP4 of the sampling circuit keeping the frequency
switch in 1 KHz position, and amplitude knob to max position.
b. The output of pulse generator TP2 is connected to sampling pulse input
TP3 of the sampling circuit keeping the frequency switch in 16KHz
position.(Adjust the duty cycle pot to mid position i.e.50%).
c. Connect the sample output from TP7 to the input of low pass filter TP10.
d. Output of low pass filter from TP11 to input of AC amplifier TP12, keep
the gain pot in AC amplifier to max position.
2. Switch ON the power supply.
3. Observe the output of AC amplifier at TP13. The output will be the replica of the
input. By varying the gain pot observe the demodulating signal amplification.
4. Similarly connect the sample and hold output and flat top output to TP10 and
observe reconstructed the signal.
5. Vary the switch position in the sampling frequency circuit to 32KHz and now
repeat the steps 3&4.
6. Vary the switch position in the modulating signal generator to 2KHz and repeat all
the above steps 3 to 5.
7. Switch OFF the power supply.
EXPECTED WAVEFORMS:
Below Wavforms for fs > 2fm

Demodulated Output
RESULT:

QUESTIONS
1. What are the types of sampling?
2. State sampling theorem?
3. What happens when fs < 2 fm?
4. How will be the reconstructed signal when fs >= 2fm?
5. Explain the operation of sampling circuit?
6. Explain the operation of re-construction circuit?
7. Who formalized the sampling theorem?
8. What are the applications of the above theorem?
9. Is the sampling theorem basis for the modern digital communications?
10. Is the voice signal sampling of 8000 Hz, follows sampling theorem in Land line
Telephone Exchange.
EXPERIMENT NO-11
PULSE AMPLITUDE MODULATION
AIM:- 1.To study the Pulse amplitude modulation & demodulation Techniques.
2. To study the effect of amplitude and frequency variation of modulating signal
on the output.
APPARATUS:-
1. Pulse amplitude modulation & demodulation Trainer Kit.
2. Dual trace CRO.
3. Patch chords.
4. PC with windows(95/98/XP/NT/2000)
5. MATLAB Software with communication toolbox

THEORY:-
Pulse modulation is used to transmit analog information. In this system
continuous wave forms are sampled at regular intervals. Information regarding the signal
is transmitted only at the sampling times together with syncing signals.
At the receiving end, the original waveforms may be reconstituted from the
information regarding the samples.
The pulse amplitude modulation is the simplest form of the pulse modulation.
PAM is a pulse modulation system is which the signal is sampled at regular intervals, and
each sample is made proportional to the amplitude of the signal at the instant of sampling.
The pulses are then sent by either wire or cables are used to modulated carrier.
The two types of PAM are i) Double polarity PAM, and ii) the single polarity
PAM, in which a fixed dc level is added to the signal to ensure that the pulses are always
positive. Instantaneous PAM sampling occurs if the pulses used in the modulator are
infinitely short.
Natural PAM sampling occurs when finite-width pulses are used in the modulator,
but the tops of the pulses are forced to follow the modulating waveform.
Flat-topped sampling is a system quite often used because of the ease of
generating the modulated wave.
PAM signals are very rarely used for transmission purposes directly. The reason
for this lies in the fact that the modulating information is contained in the amplitude
factor of the pulses, which can be easily distorted during transmission by noise, crosstalk,
other forms of distortion. They are used frequently as an intermediate step in other pulse-
modulating methods, especially where time-division multiplexing is used.
Circuit description:-
Pulse and Modulation Signal Generator:-
A 4.096 MHz clock is used to derive the modulating signal, which is generated by
an oscillator circuit comprising a 4.096MHz crystal and three 74HC04(U9) inverter
gates. This 4.096MHz clock is then divided down in frequency by a factor of 4096, by
binary counter 74HC4040(U10), to produce 50% duty cycle, 1 KHz square wave on pin
no.1 of U10, and 2KHz square wave on pin no.15. the frequency is selectable by means
of SW1. this goes to input of fourth order low pass filter U11(TL072) is used to produce
sine wave from the square wave. The amplitude of this sine wave can be varied.
The square wave which is generated by the oscillator is buffered by inverter
74HC04(U9), to produce 32KHz square wave at pin no.4 of the 74HC4040(U10). This
pulse is given to the monostable multi to obtain the 16 KHz and 32 KHz square wave at
the output which are selected by the frequency pot.
Modulation:-
The ICDG211 (U3) is used as a pulse amplitude modulation in this circuit. The
modulation signal & pulse signals are given to TL074 (U2) & 7400(U1) IC’s
respectively. These outputs are fed to the inputs the D4211 (U3).
The sampled output is available at the pin no 2 of DG211 and it is buffered by
using TL074 (U2) and then output is available at TP5.
Similarly the sample & hold output and the flat top output are available at pin
no.15 &10 of DG211 respectively. These are buffered by TL074 (U2) and then output is
available at TP6&TP7 respectively.
Demodulation:-
The demodulation section comprises of fourth order low pass filter and an AC
amplifier. The TL074 (U5) is used as a low pass filter and AC amplifier. The output of
the modulator is given as the input to the low pass filter.
The low pass filter output is obviously less and it is fed to the AC amplifier which
comprises of a single op amp and whose output is amplified.

CIRCUIT DIAGRAM:

PROGRAM:-
% pulse amplitude modulation
close all
clear all
clc
t = 0 : 1/1e3 : 10; % 1 kHz sample freq for 1 sec
d = 0 : 1/5 : 10;
x = 5+sin(2*pi/4*2*t); %message signal
figure;
subplot(3,1,1)
plot(x);
title('message');
xlabel('time');ylabel('amplitude');
y = pulstran(t,d,'rectpuls',0.1); %generation of pulse input
subplot(3,1,2)
plot(y);
title('Pulse Input ');
xlabel('time');ylabel('amplitude');
z=x.*y; % PAM output
subplot(3,1,3)
plot(z);
title('PAM modulation ');
xlabel('time');ylabel('amplitude');

PROCEDURE:
Double Polarity:-
Modulation:-
1. Connect the circuit as shown in diagram 1.
a. The output of the modulating signal generator is connected to the modulating
signal input TP2 keeping the frequency switch in 1KHz position, and
amplitude knob to max position
b. 16KHz pulse output to pulse input TP1.(Keep the frequency in minimum
position in pulse generator block).
2. Switch ON the power supply.
3. Monitor the outputs at TP5, TP6& TP7. And observe the outputs also by varying
amplitude pot (Which is in modulation signal generator block).
4. Now vary the frequency selection which position in modulating signal generator
block to 2 KHz, amplitude pot to max position.
5. Observe the output at TP5, TP6& TP7 and observe the outputs also by varying
amplitude pot (Which is in modulation signal generator block).
6. Repeat all the above steps for the pulse frequency 32KHz ( By varying the frequency
pot in the pulse generator block).
7. Switch OFF the power supply.
Single Polarity PAM:-
8. Connect the circuit as shown in diagram 2.
a. The output of the modulating signal generator is connected to the modulating
signal input TP2 keeping the frequency switch in 1KHz position, and
amplitude knob to max position
b. 16KHz pulse output to pulse input TP1 .
9. Switch ON the power supply.
10. Repeat above step 3 to 6 and observe the outputs.
11. Vary DC output pot until you get single polarity PAM at TP5, TP6, TP7.
12. Switch OFF the power supply.
Demodulation:-
1. Connect the circuit as shown in diagram 3.
a. The output of the modulating signal generator is connected to the
modulating signal input TP2 keeping the frequency switch in 1KHz
position, and amplitude knob to max position
b. 16KHz pulse output to pulse input TP1.
c. Sample output, sample and hold output and flat top outputs
Respectively to the input of low pass filter(TP9) and LPF
output (TP10) to AC amplifier input(TP11).
2. Observe the output of LPF and AC amplifier at TP10,TP12 respectively,
corresponding to inputs from TP5,TP6 &TP7. The outputs will be the true replica
of the input.
3. Now, set the switch position in modulating signal generator to 2KHz and
observe the outputs at TP10&TP12 respectively, corresponding to inputs from
TP5,TP6& TP7.
4. Vary the frequency of pulse to 32KHz (By varying the frequency pot(Put in
max position) in pulse generator block) and repeat the above steps 2&3.
5. Switch OFF the power supply.
EXPECTED WAVEFORMS

RESULT:

QUESTIONS
1. TDM is possible for sampled signals. What kind of multiplexing can be used in
continuous modulation systems?
2. What is the minimum rate at which a speech signal can be sampled for the purpose of
PAM?
3. What is cross talk in the context of time division multiplexing?
4. Which is better, natural sampling or flat topped sampling and why?
5. Why a dc offset has been added to the modulating signal in this board? Was it essential
for the working of the modulator? Explain?
6. If the emitter follower in the modulator section saturates for some level of input signal,
then what effect it will have on the output?
7. Derive the mathematical expression for frequency spectrum of PAM signal.
8. Explain the modulation circuit operation?
9. Explain the demodulation circuit operation?
10. Is PAM & Demodulation is sensitive to Noise?
EXPERIMENT NO-11
PULSE WIDTH MODULATION & DEMODULATION
AIM:
1. To study the Pulse Width Modulation (PWM) and Demodulation
Techniques.
2. To study the effect of Amplitude and Frequency of Modulating Signal on
PWM output.
APPARATUS:
1. PWM trainer kit
2. C.R.O(30MHz)
3. Patch Chords.
4. PC with windows(95/98/XP/NT/2000)
5. MATLAB Software with communication toolbox
THEORY:-
Pulse modulation is used to transmit analog information. In this system
continuous wave forms are sampled at regular intervals. Information regarding the signal
is transmitted only at the sampling times together with synchronizing signals.
At the receiving end, the original waveforms may be reconstituted from the
information regarding the samples.
The pulse Width Modulation of the PTM is also called as the Pulse Duration
Modulation (PDM) & less often Pulse length Modulation (PLM).
In pulse Width Modulation method, we have fixed and starting time of each pulse,
but the width of each pulse is made proportional to the amplitude of the signal at that
instant.
This method converts amplitude varying message signal into a square wave with
constant amplitude and frequency, but which changes duty cycle to correspond to the
strength of the message signal.
Pulse-Width modulation has the disadvantage, that its pulses are of varying width
and therefore of varying power content. This means that the transmitter must be powerful
enough to handle the maximum-width pulses. But PWM still works if synchronization
between transmitter and receiver fails, whereas pulse-position modulation does not.
Pulse-Width modulation may be generated by applying trigger pulses to control
the starting time of pulses from a mono stable multivibrator, and feeding in the signal to
be sampled to control the duration of these pulses.
When the PWM signals arrive at its destination, the recovery circuit used to
decode the original signal is a sample integrator (LPF).
CIRCUIT DESCRIPTION:-
Pulse & Modulating Signal Generator:-
A 4.096MHz clock is used to derive the modulating signal, which is generated by
an oscillator circuit comprising a 4.096MHz crystal and three 74HC04(U9) inverter
gates. This 4.096MHz clock is then divided down in frequency by a factor of 4096, by
binary counter 74HC4040(U2), to produce 50% duty cycle, 1KHz square wave on pin
no.1 of U4, and 2KHz square wave on pin no.15. the frequency is selectable by means of
SW1. This goes to input of fourth order low pass filter U3 is used to produce sine wave
from the square wave. The amplitude of this sine wave can be varied.
The square wave which is generated by the oscillator is buffered by inverter
74HC04, to produce 32KHz square wave at pin no.4 of the 74HC4040(U2). This pulse is
given to the monostable multi to obtain the 16KHz and 32KHz square wave at the output
which are selected by the frequency pot.
Modulation:-
The PWM circuit uses the 555 IC (U1) in monostable mode. The Modulating
signal input is applied to pin no.5 of 555IC, and there Pulse input is applied to pin no.2.
The output of PWM is taken at the pin no.3 of 555IC i.e., TP3.
Demodulation:-
The demodulation section comprises of a fourth order low pass filter and an AC
amplifier. The TL074(U5) is used as a low pass filter and an AC amplifier. The output of
the modulator is given as the input to the low pass filter.
The low pass filter output is obviously less and it is feed to the AC amplifier
which comprises of a single op amp and whose output is amplified.
CIRCUIT DIAGRAM:

PROGRAM:-
% pulse width modulation & demodulation
close all
clear all
clc
fc=1000;
fs=10000;
f1=200;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
%modulation
y1=modulate(x1,fc,fs,'pwm');
subplot(311);
plot(x1);
axis([0 50 0 1]);
title('original signal taken mesage,f1=500,fs=10000')
subplot(312);
plot(y1);
axis([0 500 -0.2 1.2]);
title('PWM')
%demodulation
x1_recov=demod(y1,fc,fs,'pwm');
subplot(313);
plot(x1_recov);
title('time domain recovered, single tone,f1=200')
axis([0 50 0 1]);
PROCEDURE:
Modulation:-
1. Connect the circuit as shown in the diagram 1.
a. The output of the modulating signal generator is connected to the
modulating signal input TP2 keeping the frequency switch in 1KHz
position, and amplitude knob to max position
b. 16KHz pulse output (by varying the frequency pot (put it min position) in
pulse generator block) from pulse generator to pulse input(TP1).
2. Switch ON the power supply.
3. Observe the output of pulse width modulation block at TP3.(By varying the
amplitude pot).
4. Vary the modulating signal generator frequency by switching the frequency
selector switch to 2 KHz.
5. Now, again observe the PWM output at TP3.(By varying the amplitude pot).
6. Repeat the above steps (3 to 5) for the pulse frequency of 32KHz(by varying the
frequency pot(put it in max position) in pulse generator block).
7. Switch OFF the power supply.
Demodulation:-
8. Connect the circuit as shown in diagram 2.
a. The output of the modulating signal generator is connected to the modulating
signal input TP2 keeping the frequency switch in 1KHz position, and amplitude knob
to max position.
b. 16KHz pulse output (put frequency pot minimum) from pulse generator block
to pulse input TP1.
c. PWM output to LPF input.
d. LPF output to AC amplifier input.
9. Switch ON the power supply.
10. Observe the output of low pass filter and AC amplifier respectively at TP6 &
TP8. The output will be the true replica of the input.
11. Now vary the position of the switch in modulating signal generator to 2 KHz and
observe the outputs at TP6 & TP8.
12. Repeat the steps 10& 11 for pulse frequency 32 KHz (By varying the frequency
pot (put in max). in pulse generator block). Observe the output waveforms.
13. Switch OFF the power supply.
EXPECTED WAVEFORMS

RESULT:

QUESTIONS
1. An audio signal consists of frequencies in the range of 100Hz to 5.5KHz.What is the
minimum frequency at which it should be sampled in order to transmit it through pulse
modulation?
2. Draw a TDM signal which is handling three different signals using PWM?
3. What do you infer from the frequency spectrum of a PWM signal?
4. Clock frequency in a PWM system is 2.5 kHz and modulating signal frequency is
500Hzhowmany pulses per cycle of signal occur in PWM output? Draw the PWM
signal?

5. Why should the curve for pulse width Vs modulating voltage be linear?
6. What is the other name for PWM?
7. What is the disadvantage of PWM?
8. Will PWM work if the synchronization between Tx and Rx fails?
9. Why integrator is required in demodulation of PWM?
10. What kind of conversion is done in PWM generation?
EXPERIMENT NO-11
PULSE POSITION MODULATION AND DEMODULATION
AIM:
1. To study the generation Pulse Position Modulation (PPM) and Demodulation.
2. To study the effect of Amplitude and the frequency of modulating signal on its
output and observe the wave forms.
APPARATUS:
1. Pulse Position Modulation (PPM) and demodulation Trainer Kit.
2. C.R.O(30MHz)
3. Patch chords.
4. PC with windows(95/98/XP/NT/2000)
5. MATLAB Software with communication toolbox
THEORY:-
Pulse Modulation is used to transmit analog information in this system continuous
wave forms are sampled at regular intervals. Information regarding the signal is
transmitted only at the sampling times together with synchronizing signals.
At the receiving end, the original waveforms may be reconstituted from the
information regarding the samples. Pulse modulation may be subdivided in to two types
analog and digital. In analog the indication of sample amplitude is the nearest variable. In
digital the information is a code.
The pulse position modulation is one of the methods of the pulse time
modulation.PPM is generated by changing the position of a fixed time slot.
The amplitude& width of the pulses is kept constant, while the position of each
pulse, in relation to the position of the recurrent reference pulse is valid by each instances
sampled value of the modulating wave. Pulse position modulation into the category of
analog communication. Pulse-Position modulation has the advantage of requiring
constant transmitter power output, but the disadvantage of depending on transmitter
receiver synchronization.
Pulse-position modulation may be obtained very simply from PWM. However, in
PWM the locations of the leading edges are fixed, whereas those of the trailing edges are
not. Their position depends on pulse width, which is determined by the signal amplitude
at that instant. Thus, it may be said that the trailing edges of PWM pulses are, in fact,
position-modulated. This has positive-going narrow pulses corresponding to leading
edges and negative-going pulses corresponding to trailing edges. If the position
corresponding to the trailing edge of an un modulated pulse is counted as zero
displacement, then the other trailing edges will arrive earlier or later. They will therefore
have a time displacement other than zero; this time displacement is proportional to the
instantaneous value of the signal voltage. The differentiated pulses corresponding to the
leading edges are removed with a diode clipper or rectifier, and the remaining pulses, is
position-modulated.
Circuit Description:-
Modulating Signal Generator:-
A 4.096 MHz clock is used to derive the modulating signal, which is generated by
an oscillator circuit comparing a 4.096MHz crystal and three 74HC04(U9) inverter gates.
This 4.096 MHz clock is then divided down in frequency by a factor of 4096, by binary
counter 74HC4040(U4), to produce 50% duty cycle, 1 KHz square wave on pin no.1 of
U4, and 2 KHz square wave on pin no.15. The frequency is selectable by means of SW1.
This goes to input of fourth order low pass filter U3 (TL072) is used to produce sine
wave from the square wave. The amplitude of this sine wave can be varied.
Modulation:-
The circuit uses the IC 555(U1) a Mono stable Multivibrator to perform the pulse
position Modulation action.
The Modulating signal is given to Pin No. 5 at Pin No.2 the pulse is 32 KHz
which is connected internally.
The PWM is available at TP2; this PWM output is differentiated by using
differentiated circuit. This differentiated output is available at TP8. This differentiated
output is fed to the 555 IC (U2) (Mono stable Mode) Pin No.2. The PPM output is
available at TP3.
CIRCUIT DIAGRAM:

PROGRAM:-
% pulse position modulation
close all
clear all
clc
fc=100;
fs=1000;
f1=80;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
%modulation
y1=modulate(x1,fc,fs,'ppm');
subplot(311);
plot(x1);
axis([0 15 0 1]);
title('original signal taken mesage,f1=80,fs=1000')
subplot(312);
plot(y1);
axis([0 250 -0.2 1.2]);
title('PPM')
%demodulation
x1_recov=demod(y1,fc,fs,'ppm');
subplot(313);
plot(x1_recov);
title('time domain recovered, single tone,f1=80')
axis([0 15 0 1]);
PROCEDURE:
Modulation:
1. Connect the circuit as shown in diagram 1.
a. Connect the modulating signal generator output to modulating signal input
(TP1) in PPM block.
b. Keep the switch in 1 KHz position and amplitude pot in max position.
2. Switch ON the power supply
3. Observe the PWM output at TP2, and the differentiated output signal at TP8.
4. Now, monitor the PPM output at TP3.
5. Try varying the amplitude and frequency of sine wave by varying amplitude pot.
6. Repeat Step 5 for frequency of 2 KHz and observe the PPM output.
7. Switch OFF the power supply.
Demodulation:-
8. Connect the circuit as shown in diagram2.
a. Connect the modulating signal generator output to modulating signal input
(TP1) in PPM block.
b. Keep the switch in 1 KHz position and amplitude pot in max position.
c. Connect the PPM output (TP3) to input of LPF(TP4).
9. Switch ON the power supply
10. Observe the demodulated signal at the output of LPF at TP5.
11. Thus the recovered signal is true replica of the input signal
12. a. As the output of LPF has less amplitude, connect the output of LPF to the input
of an AC amplifier (TP5 to TP6).
b. Observe the demodulated out put on the oscilloscope at TP7 and also
observe the amplitude of demodulated signal by varying gain pot. This is amplitude
demodulated output.
13. Repeat the steps (7 to 9) for the modulating signal for frequency 2 KHz.
14. Switch OFF the power supply.
EXPECTED WAVEFORMS:

RESULT:

QUESTIONS:
1. What is the advantage of PPM over PWM?
2. Is the synchronization is must between Tx and Rx
3. Shift in the position of each pulse of PPM depends on what?
4. Can we generate PWM from PPM?
5. Why do we need 555 timers?
6. Does PPM contain derivative of modulating signal compared to PWM?
7. For above scheme, do we have to use LPF and integrator in that order?
8. If we convert PPM to PWM & then detect the message signal, will the o/p has less
distortion?
9. Is synchronization critical in PPM?
10. How robust is the PPM to noise?

You might also like