You are on page 1of 86

Iyer Vishnuvardhan

2013AAPS049H

Lab Manual for Signals & Systems


(EEE F246)

Prepared by
Faculty & Research Scholars
Dept. EEE

BITS Pilani, Hyderabad Campus


January 2015

Purpose of the Document


This document is intended to be used by the students for enhancing their learning while
performing the experiments. The learning is imparted by way of posing a set of questions on
each of the experiments and the student is expected to answer these questions either before
performing the experiments or by experimentation.
The document does not give details on step by step procedure for performing the experiments. It
is expected that the student acquires this information, prior to the experimentation, by referring
to the books or documents, referred below.
It is advised that the student need not constrain oneself to the set questions given in this
document and can generate ones own set of additional questions to enhance the learning
process. The authors of this document will be highly appreciative of those who can add
additional questions.

References:
1. Lab Manual on Signals & Systems
2. Lathi B P, Principles of Signal Processing & Linear Systems Oxford University Press, 2009.
3. Nagrath I J, Sharan S N, Ranjan Rakesh & Kumar S, Signals & Systems, Second Edition TMH,
2001

Revision History
Version
Number
V0.1
V0.2
V0.3

Date
Jan 20,
2015
Jan 31,
2014
Feb
03,2015

Revised With
Added Experiment No. 1A :
Familiarization with MATLAB
Added Experiment No. 1B : Advanced
Matlab Exercises
Experiment 2: First exposure to
signals via Function Generator and
oscilloscope

Prepared by
R.Venkateswaran, Prabhakara Rao, Y.
Yoganandam,
R.Venkateswaran, Prabhakara Rao, Y.
Yoganandam,
R.Venkateswaran, Prabhakara Rao,
Y. Yoganandam,

Contents
Purpose of the Document ............................................................................................................................... 3
Revision History ............................................................................................................................................. 4
Experiment 2: First exposure to signals via Function Generator and oscilloscope ................................... 4
Experiment 1A: Familiarization with MATLAB.......................................................................................... 6
Run # 01: ........................................................................................................................................... 6
Run #02: Graphical Commands ...................................................................................................... 7
Run # 03:Basic Commands for working in MATLAB .................................................................. 9
Run # 04: Vectors and matrices in MATLAB ............................................................................... 11
Experiment 1B: Advanced MATLAB Exercises ........................................................................................ 12
A. Running commands in the command window........................................................................12
B. Code generation, File Creation and editing: ............................................................................14
C. Code Readability and Coding Style..........................................................................................16
ADDITIONAL EXERCISES ........................................................................................................20
Experiment 2: First exposure to signals via Function Generator and Oscilloscope ................................ 21
Function generator ..........................................................................................................................22
Oscilloscope ....................................................................................................................................24
Function generator and Oscilloscope ............................................................................................24

Experiment 1A: Familiarization with MATLAB


Note:Write all your observations in theNote Book
Objective:To learn about MATLAB and familiarize oneself with its usage and applicability to
Signals and Systems
Software Available:MATLAB R2012b

Run # 01:
MatLab (MATrixLABoratory) is matrix based software package for computation engineering.
Science and applied mathematics. It offers a powerful programming language, excellent
graphics, and wide range of expert Knowledge. A numerical analyst called Cleve Moler wrote
the first version of MATLAB in the 1970.
Open the Matlab (Hint : double click on Matlab Icon available on the desktop)
Q1. Make a rough sketch of Matlab windows
Q2. (a) What is command window?
Hint : use the given path
HELP

DOCUMENTATION

SEARCH

Type Command Window

Answer:It is the window provided for the user to enter commands


for MatLab .
(b) Type a=7 b=8 andcalculate c= a+b what is c? Can you save this command and value?

Answer:15 , yes
Q3. (a) What is meant by command history?
(b) What is the purpose of command history in MATLAB?

Answer:
a) Command History gives us the record of previous answers and commands entered

by the user .
b) It helps the user check and reuse his earlier commands
Q4. (a) What is Workspace?
(b) Can you save this workspace file?
(c) What is the extension of this workspace file?

Answer:
a) Workspace is the window which consists the variables the user creates and stores in
the memory in matlab session.
b) Yes
c) .mat
Q5. (a) What is current directory that Matlab is working in?
(b) How can you change the path of the current directory?
Answer:
a) Location of the folder where our current work space is saved .
b) Entering new path in directory .
Q6. (a) What is Editor window?
(b) What is the extension of the file that is saved in Editor window?
(c) What is m-file?
(d) Enter edit command in command window and write your comments?
Answer :
a) Editor window is the window for a string of commands aimed at a specific function
(eg . Plotting a graph)
b) .m
c) Editor window that is saved in .m extension
Q7.

a) Explore the use of command


b) Explore the use of command
c) Explore the use of command

clc
clear all
close all

Answer :
a) Clears command window .
b) Removes all variables from memory .
c) Closes everything .

Run #02: Graphical Commands


MATLAB opens figures in separate windows which includes the ability to fine-tune the
appearance of the plot, zoom, etc.
Q8. Plot a sine wave of frequency 5 Hz (call that as variable y) and write the functioning of each
graphical command.

(a)

plot (t, y)

Answer:
fs = 100;
f = 5;
t = 0:1/fs:1;
y = sin(2*pi*f*t);
plot (t,y)

(b)

area (t, y)

g = area(t,y)
answer is g = 174.0093 sq units
.
(c)

hold on/hold off

plot(t,y);
hold on/hold off
plot(t,y/2)

Hold on helps us draw multiple curves on a same graph .


Hold off is used to voluntarity separate 2 different graphs onto 2 different plots

(d)

xlabel

xlabel(time axis)
x axis is labelled

(e)

ylabel

ylabel(amplitude)
y axis is labelled

(f)

title(`Plot Title')

title(sine wave)

a title is given to the graph .

Run # 03:Basic Commands for working in MATLAB


Example :clc : Clears the command window

clear: remove all the variables from memory

Q9. Write your comments on the following commands and give one example on each
A = [1 2 3]
sum( ) : = 6
returns the sum of all elements in array

mean( ) := 2
mean of all elements in the array

length( ) : = 3
returns the length of a 1 D array

max( ) := 3
value of the largest element in the array

min( ) := 1
value of the least element in the array

prod( ) : = 6
product of all elements in the array

sign( ) := [1 1 1]
sign function , 1 is +ve , -1 if ve , 0 if 0

fix( ) : [1 2 3]
rounds all elements to nearest zero

floor( ):[1 2 3]
greatest integer function

ceil( ) : [1 2 3]
least integer greater than or equal to each element is the input

round( ) :1 2 3
rounds element to nearest integer

sin( ) :[0.8415 0.9093 0.1411]


returns the sine value of all radian inputs

cos( ) :[0.5403 -0.4161 -0.9900]


Gives cosine value of each radian input

exp( ) :[2.7183 7.3891 20.0855]


gives powers of (e) of each input

sqrt( ):[1.0000 1.4142 1.7321]


prints square root of inputs

abs( ):[1 2 3]
prints modulus of inputs (effective value/magnitude)

Q10. Type in the command window: A=3; B=A*4 ; C = A*B; Validate the values of the
variables in the workspace and note down in the observation book.
Workspace
A=3
B = 12(A*4 = 3*4 =12)
C = 36(A*B = 3*12)

Run # 04: Vectors and matrices in MATLAB


We create a vector in MATLAB by putting the elements within [] brackets.
Q11. Create a vector x = (1.1, 1.2,1.3,1.4,1.5,1.6,1.7,1.8). Is it a row vector or a column vector?
How do we create another vector with the same elements?
a) Row vector
b) Y=X
Q12. Create a matrix
x=
1 2 3
4 5 6
7 8 9
Find out x(2:3,:) and x(:,1:2)
a) 4 5 6
789
b) 1 2
45
78
Q13. Create a (a) zeros matrix (b) ones matrix and (c) Identity matrix of each size 3x3
a) X = zeros(3);
b) Y = ones(3);
c) Z = eye(3);
Q14. A = [1, 0, 1, 0] and B= [1, 1, 1, 1]. Find the outputs and give logical reasons:
a) A&B
1010( bitwise AND)
b) A&&B
Error ( A&B are not scalars but vectors)
c) A|B
1 1 1 1 (Bitwise OR)
d) A||B
Error

**********************************

Experiment 1B: Advanced MATLAB Exercises


This experiment is intended to make the student use MATLAB for experiments, relevant to
signals and systems. It is expected that the student will write MATLAB code and also learns how
to generate an efficient and readable code. The code is to be entered in a file and is to be stored
for later use.

A. Running commands in the command window.


1. Check which of the following are valid or invalid variables? What are the reasons?
(a) log2

(b) under_dog (c) underdog

(f) abc-def (g) kota@55

(h) KINGmaker

(d) 5dog

(e) log xyz

(i) Myclass21:42

Answer :
a) valid .meets all criteria .
b) valid
c) valid
d) not valid . name should not start with Int
e) invalid . name should not contain space
f) not valid . name should not contain hyphen
g) valid
h) invalid .name should not contain any symbol other than underscore .
2. What do you expect the value of Z = 3^(3^2) to be when executed in command window
? How does this differ from Y = 3^3^2 ?
Answer:
Z = 3^(3^2) = 19683
Y = 3^3^2 = (3^3)^2 (by convention) = 729
3. Perform the following Vector Operations and write your observations on each operation:

a. Generate a column vector x with elements as 1,2,3,4 .


b. Perform (i) 2 * x (ii) x * x (iii) x .* x
c. Generate a row vector ywith elements as 9,10,11,12.
d. Perform (i) y * x (ii) x * y (iii) x .* y (iv) y.* x
Answer:
a) X = [1;2;3;4]
b) 2*X = [2;4;6;8] . X*X = error (dimensions do not match that required for Matrix
multiplication) . X.*X= [1;4;9;16] (. Enables scalar value by value multiplication of
equidimensional matrices)
c) Y = [9 10 11 12]
d) Y*X = 110 . X*Y = [9 10 11 12 ; 18 20 22 24 ; 27 30 33 36 ; 36 40 44 48]
X.*Y = error , Y.*X = error (X and Y are not equidimensional matrices)

4. Explore the command(s) for performing inverse of a matrix. Generate a 3 X 3 matrix of


your choice and obtain its inverse using Matlab command. Check your result.
Answer:
Y = inv(X);
X*Y comes out to be
1.0000 0.0000 0.0000
0.0000 1.0000 0.0000
0.0000 0.0000 1.0000
5. Consider the set of linear equations: 2x + 3y = 5; 3x + 15y = 8. Solve the equations using
matrix method and verify your answer with one of the correct Matlab operation given
below :
a) [2 3; 3 15]/[5;8]

Answer:

b) [2 3; 3 15]\[5;8]

c) [2 3; 3 15]/[5 8]

d) [2 3; 3 15]\[5 8]

(b) gives the correct answer , and the answer is x = 2.4286 . y = 0.0476

B. Code generation, File Creation and editing:


a) How to generate a Matlab code file?
Open a new script file or code file.
b) What is its extension?
Extension is .m
c) Where do you store the file? How to set the path for the stored location?
My Documents >> MATLAB
Use the Browse button to set the path for the stored location.
d) How do you run the Matlab file in the command window?
Use the run command.
run filename(.m not necessary)
e) What is to be done to run a file, located in a non default directory?
Change the path of the current folder to the location of the file and run filename.

6. Analyze and execute the following code and find the value of A and Comment on the
results.
A = [ [1 2 3]' [3 2 1]' [2 1 3]'];

B = A;

for j=2:3
A (j, :) = A (j, :) A (j-1, :)
end
A=
1

1 -1 -1
3

-1 -1

A=

Repeat the above with the following code:


A = [ [1 2 3]' [3 2 1]' [2 1 3]']; B = A;

for j=2:3
A (j, :) = A (j, :) B (j-1, :)
end
A=
1

1 -1 -1
3

-1 -1

-1

A=

7. Analyze and execute the following code and display all values of a. write your
observations on the variable a at the end of execution of the code.

k=5;
for m = 1:k
forn = 1:k
if m == n
a(m,n) = 2;
elseif abs(m-n) == 2 ;a(m,n) = 1;else; a(m,n) = 0;end ; end
end
a =
2 0 1 0 0
0 2 0 1 0
1 02 0 1
0 1 0 2 0
0 0 1 0 2

8.

Two statements are given below. Execute statement 1 and statement 2, individually and
comment on their outputs?
Statement 1: X = 5; X >= [1 2 3; 4 5 6; 7 8 10]

ans
1 1
1 1
0 0

=
1
0
0

ans
1 1
1 1
0 0

=
1
0
0

Statement 2:X = 5*ones(3,3); X >= [1 2 3; 4 5 6; 7 8 10]

C. Code Readability and Coding Style


Note : For a code to be readable, it should have a particular style. It is important that the
following coding style is maintained while writing MATLAB code.

Coding Style : Example Code:


%(Sys1_Expt_01.m)
% Aim:Generate and plot waveforms with given specifications
%****** signal x(t)= 1 , 0 < t < t0 /3 , t0 = 0.15-Total time interval
%

=-2 , t0/3 < t < 2t0/3

= 0 , otherwise

%
% Functions used :cicon.m, licon.m
% Type of convolution - circular convolution, linear convolution
% Author name of the student (ex. Bhavyasree)
% Ver 0.0
% Initializing variables
% load ('initvar.mat');
% Generating signals
[m,c,u,M,C,U,f] = cicon(t0,ts,fc,t,df,fs);
%Demodulation process
[y,Y,dem,DEM,H] = licon(u,c,ts,df,fs,f);

%Plotting signals in time and frequency domains


plotgen(t,m,c,u,y,dem,f,M,C,U,Y,H,DEM);
9.Write a for loop for generating the values of the function y(n) = 10* e (-n*n) for values n = 1
to N (N = 10) and store in an array.
n= 1:10;
for n=1:10;
a(n) = 10*(exp(-n*n));
end
a. What is the time of execution of this command, if N = 100000 in the above for loop
program ?
Note : Learn how to use the commands tic and toc of Matlab
Time of execution = 0.03s
b. Can you reduce the execution time by using vector operations of Matlab? If so write
Matlab program and observe the time taken?
n=1:10;
a=10*(exp(-n.*n);
time of execution=0.0081s
10.In the above example,
a. Write a code to input the value of N by the user.
N=input(enter limit)
tstart = tic;
fori=1:N;
z(i)=10*exp(-i*i);
end
telapsed = toc(tstart)
Note : Learn the Matlab command for inputting the values to a variable

b. Print the value of N and the time taken for execution by Matlab (when vector operations
are used).
N=10
Time of execution=0.0012 seconds
Note : Learn the Matlab command for printing the values of a variable
c. Input the values for N as vector of values, starting with one and ending with 100000, in
steps of 100. Plot a graph between N & time of execution.
d. For the plots, make sure that the labels of x & y axes represent appropriate scale & units
and give proper titles to the plots.
e. Comment on all your observations
11. Generation of a Step Signal
a. Write the expression for a step with amplitude 7 and occurring at time t= 2.395 sec.
x=0 t<2.395
x=1
b.

t>=2.395

Plot the same in your note book.

c. Generate the same step signal using Matlab and plot, showing the time and amplitude
scales.
t= -5:0.01:5;
X= zeros(size(T));
cut = 0;
fori= -5:0.01:5
ifi>2.395
X(cut)=7
end
cut=cut+1
end
plot(t,x)

12.Generation of a Ramp Signal


d. Write the expression for a ramp signal starting at time = 345 msec and ending at time =
15.35 seconds and reaching a maximum value of 2.3 volts.
Y=0.1533(x-0.345)

e.

Plot the same in your note book.

f. Generate the same ramp signal using Matlab and plot, showing the time and amplitude
scales.
t= 0:0.001:15.35;
X= zeros(size(T));
cut = 0;
fori= 0:0.001:15.35
ifi>0.345
X(cut)=X(cut-1) + 0.001533
end
cut =cut+1
end
plot(t,x)

13. Generation of an Exponential Signal


g. Generate the exponential signals: x = e(-2t) , y = e(-0.2t), z = e (-0.02t), all of them starting at t
= 0.5 sec and ending at t = 200.456 sec. Plot, all of them on a single plot, showing the
time scale and amplitude scale. Indicate the different exponential plots, using arrows and
text appropriately.
y= 0.5:0.001:200
x1= exp(-2*y)
x2= exp(-0.2*y)
x3= exp(-0.02*y)

plot(y,x1,color,r;hold on);
plot(y,x2,color,g;hold on);
plot(y,x3,color,y);

14.Generation of Square and a SawtoothSignals


h. Generate square and sawtooth periodic signals with following parameters. Make sure the
time resolution is of 1 millisecond and the time duration of signals is 10 seconds.

i.

Amplitude = 1 and period T = 0.2 s

ii.

Amplitude =2, with period T = 0.4 s.

iii.

Amplitude =5 with frequency, F= 1.25 Hz,

Plot, all of them on a single plot, showing the time scale and amplitude scale. Indicate the
different plots, using arrows and text appropriately.

ADDITIONAL EXERCISES
1.During high school days, you might have solved: x = y + 1 and 2x = y.
a. What are the values of x and y, that satisfy given equations? ( x = ____, y = ____ )
b. Generate a vector x with values starting at -5 and ending at +5, in steps of 0.01
c. Write a Matlab code to compute y, for the values of x generated above.
d. Solve the above equations graphically by plotting the values of y Vs x. Comment on the
observations on accuracy of the results from (a) and (c). Does change in the step size in
(b) help in getting more accurate solution?
e. For the plots, make sure that the labels of x & y axes represent appropriate scale & units
and Give proper titles to the plots.
2. Generate Sine & Cosine waves for angles between -60 & 60 degrees, in steps of 0.01
degree. Obtain Tan function values using the Sine & Cosine waves, without using for

loop. Plot the Tan values and compare with the built in tan function of Matlab. For the
plots, make sure that the labels of x & y axes represent appropriate scale & units. Give
proper titles to the plots.
3. Exploring the commands rand, randnand hist.
a. Generate 1000 real random numbers between (-25 and +25) using rand function and plot
them.
b. Find the mean and standard deviation of the random numbers generated in (a). Can you
calculate the mean standard deviation theoretically and compare with what you obtain
from Matlab?
c. Repeat (a) and (b) with randn command.
d. Learn the usage of hist command.
4. Plot the distribution of the random numbers generated using rand and randn commands.
For this you may generate 100000 numbers and use 1000 bins for histogram
generation.Consider the function y(n) = [x(n) + x(n-1) + x(n-2) ]/3.
a. Write a Matlab code, using for loop, to generate x(n), for n=1,2,..1000 and to compute
the output y(n). Consider the usage of zero entries for elements in x with negative
argument.
b. Plot x Vs y. For the plots, make sure that the labels of x & y axes represent appropriate
scale & units. Give proper titles to the plots.
c. Export the plot, in the form of an image, and paste into a word document (your
record book).

Experiment 2: First exposure to signals via Function Generator


and Oscilloscope
Aim: This experiment is intended to expose students to various signals that are used in different
fields such as control systems, digital signal processing and communications etc. This is
facilitated through an arbitrary / Function Generator and Digital Storage Oscilloscope.

An Arbitrary/Function Generator (AFG) is an electronic test instrument that generates a wide


variety of electrical signals. You can use AFGs to simply generate a series of basic test signals,
replicate real-world signals, or create signals that are not otherwise available. These signals can
then be used to learn more about how a circuit works, to characterize an electronic component,
and to verify electronic theories.

Function generator

NOTE:Explore HELP button


1. Name the model and manufacturer of the Function generator used in the Lab.
Agilent 33220A, LXI
2. List all the Front Panel buttons of the Function generator and briefly explain the function
of each button (in one sentence only).
Sine: Output is a sinusoidal wave at frequencies from 1 microHz to 20MHz
Square: Output is a square wave at frequencies from 1 microHz to 20MHz with
duty cycle as parameter
Ramp: Output is a ramp wave at frequencies from 1 microHz to 20MHz
Pulse: Output is a pulse wave at frequencies from 500microHz to 5MHz with duty
cycle and edge time as parameters.
Noise: Produces a Guassian noise with a 10Mhz bandwidth.
Arb : Output is a arbitrary waveform with up to 64 K points and reception rate up
to 6MHz.
Mod: Modulates functions using AM,PM,FM,FSK or PWM
Sweep: Varies its output from a start frequency to stop frequency in a specified
sweep time.
Burst : Outputs a waveform with a specified number of cycles,called Burst.
Store/Recall: Stores/Recalls instrument states,reset it to factory default settings and
configure its power on state.
Utility: Provides access to output configuration parameters, remote interface
settings, instrument selftest and calibration information.
Graph: Shows a graphical representation of the waveform.

Manual Trigger: It issues an immediate trigger independent of trigger source issued.


Main Output enable: Enables/Disables generation of waveform.

3. Once you powered up the function generator, the default signal shows an output of
__sine_____

signal of frequency ____1KHz_______

with

an

amplitude

of

100mVpp_____(peak-to-peak).
4. Mention only different types of signals available in your function generator?
Sine , Square , Ramp, Pulse, Noise, Arbitary
5. What are the range of amplitudes and frequencies of different signals that can generate in
your Function generator?
Sine: 1 microHz to 20MHz, 20Vpp
Square: 1 microHz to 20MHz, 20Vpp
Ramp: 1 microHz to 20MHz, 20Vpp
Pulse: 500microHz to 5MHz, 20Vpp
Noise: Guassian noise with a 10Mhz bandwidth.
Arb : Output is a arbitrary waveform with up to 64 K points and reception rate up
to 6MHz.

6. What is the use of trigger functionality in a function generator?


It issues an immediate trigger independent of trigger source issued. It is used only
for sweep and burst.

7. Generate the following signals with the given specifications.


(i)

A sine wave of 100 kHz, 1Vpk-pk. Add an offset voltage of 1 mV to the given sine
wave and observe the signal.

(ii)

A square wave of 5 MHz, 2Vpk-pk

(iii)

(a) A pulse wave of 5 kHz, 2 V with 25% duty cycle.


(b) How do differentiate a square wave and a pulse wave
Pulse wave does not have a symmetrical shape associated with a square
wave.

Oscilloscope
Any time you develop a new circuit, repair an electronic instrument, or measure the performance
of an electronic component or system, you will need to use one or more items of test equipment.
Almost every task requires an oscilloscope, the basic instrument for visualizing the time
dependence of electronic signals.

NOTE:Explore HELP button


1. Name the model and manufacturer of the digital oscilloscope used in the Lab.
Tektronix, TDS 2002B
2. What are the functions of horizontal and vertical controls?
Vertical Controls: Moves the channel waveform up and down the screen.
Math operations can be performed on waves
Horizontal Controls : It controls the position of trigger relative to the center of the
screen .It also has a set-to-zero button.
3. What is the purpose of a trigger in an oscilloscope?
Trigger menu is used to control oscilloscope when it starts to acquire data and
display a waveform
4. How do you apply an external trigger?
It is applied using the external trigger input or through the function generator.
5. List the buttons and knobs found on the front panel of the oscilloscope.
AutoRange, Save/Recall, Measure, Acquire, Help, AutoSet, Utility, Cursor, Display,
Default Setup, Vertical Controls , Horizontal Controls, Trigger menu
6. What are the DC coupling & AC coupling functionalities?
DC Coupling passes both AC and DC components.
AC Coupling blocks DC components and attenuates signals below 10Hz

Function generator and Oscilloscope

Generate the following waveforms from the Function generator and display it on the
oscilloscope

(1) 15 kHz sine waves with an amplitude of 500 mV.

(If you have trouble getting the scope to trigger at high frequencies, try pushing AUTO
SETUP to restore the default settings.)
(i)
Is the wave form stable or scrolling horizontally?
It is scrolling horizontally.
(ii)
How do you make it not to scroll and be stable in the display window?
Press the STOP button.
(2) 10 kHz square waves with low value at 1 V and high value at + 5.0 V.

(i)

Do the scope scales agree with the output of the function generator?
No, the scope scale does not agree with function generator

(ii)

If not, correct your DSO, Function Generator scope and probe settings
Change probe setting attenuation to 1X

3. 5 Hz ramp waves with a peak-to-peak amplitude of 3 V.

(i)

You will have to use NORMAL triggering, not AUTO. Why?


To stabilize the waveform.

4. Pulse at a frequency of 1 kHz, with low level at 1 V and high level at + 5.0 V and a width
of 200 s

(i)

Measure the time period, pulse duration and calculate their ratio?
Pulse width =800 microseconds

(ii)

Time period = 1 millisecond


Ratio=0.8
What is this ratio of the pulse duration to time period is called?
Duty Cycle. (=80%)

5. Mention different MATH functions available in DSO.


+,-,*,FFT(adds, subtracts, convolution and fast fourrier transformation of 2 signals)
6. Does the oscilloscope have the facility to freeze the waveform on the screen? What is this
facility called?
Run/Stop Button
(i)

Can you make use of this to find the rising and falling edge of a pulse?
Rising Edge=1.588 microseconds
Falling Edge = 1.604 microseconds

Experiment 3: Experiments on Signals using Emona Telecom Trainer Kit


NAME:VISHNUVARDHAN IYER
ID:2013AAPS049H
Aim: This experiment is intended to expose student to learn and use the Hardware Kit (from
Emona Instruments). The experiment involves using modulesbased and signals and systems such
as the Signal Generation, Noise Generation, Adder, Buffer, and so on. Students are expected to
do the connections on Emona Telecoms-Trainer 101 kit and interpret the results.
Equipment Required: Emona Telecom Trainer Kit 101, digital storage oscilloscope (DSO),
connecting patch cards, screwdriver (to turn the knobs in Emona Kit) etc. A snapshot of the
trainer kit front panel is as shown below.

Generation of Signals:
Signal generation is a very basic component in experiments related to signals and systems. This
experiment is intended to learn about the signal generation using EMONA Telecom-Trainer 101
kit and, measurements of amplitude, frequency, phaseetc using Digital Storage Oscilloscope
(DSO). The DSOs in the lab have connectivity to the PC and the screenshots should be
transferred to PC for further analysis.

NOTE: Applies to all Questions in all Experiments


After obtaining the waveforms on DSO screen, capture screenshot into PC and use them to
complete the record/observations.

A. Identification of blocks in Emona kit and generating signals


1. Locate the Master Signals module on the Emona kit.
a. GenerateSinusoidal signal of 100 KHz and a Cosine signal 100 kHz.
b. Connect these signals to channels 1 and 2 of the DSO and obtain stable waveforms using Auto
set mode.
c. Measure the phaseand time difference between the cosine and sine signals using DSO. You
may take the help of time cursors of the DSO.
d. Relate the measurements on time and phase for these signals.
e. Put the channels in DSO to DC coupling mode and measure the offset in DC using 'mean'
voltage setting in the channel
Ans)sin and cos signals

Td=2.5us T=10us.Td/T*2pi=pi/2
Offset for sine =280mV
Offset for cos=64.1mV

2. Using Master Signals module on the Emona kit and generate 2 kHz and 8 kHz digital signals,
a. Connect these signals to channels 1 and 2 of the DSO and obtain stable waveforms using Auto
set mode.
b. Use the horizontal scale knob and obtain 1 OFF (low) and 1 ON (high) of 2 kHz signal,
during the ON duration of the 2 kHz how many ON durations of 8 kHz signal do you find on
the DSO screen and note it down. Justify the answer.
Capture the waveform in the PC and transfer to your record.
c. Put the channels in DSO to DC coupling mode and measure the offset in DC using 'mean'
voltage setting in the channel

Measure the amplitude (peak-to-peak), and the period of the above generated signals.
Note: Learn to use the X and Y cursors of the DSO for measurement of voltage and time
period. Write down your observations.
Ans)2 KHz and 8 KHz digital signals

During 1 ON of 2 KHz signal we get 2 ONs of 8 KHz.


8 KHz-T=120us ampl=6V
2 KHz-T=480us ampli=6V
3. Locate Twin pulse generator module in Emona kit, and the two knobs (i) width and (ii)
delay.

a. Ensure that both the knobs are in their minimal position i.e. turn the knobs completely in
anticlockwise direction using available screw-driver.
b. Use 8 kHz digital input from the master signal module and connect to CLK in the twin pulse
generator module. Connect the DSO channel 1 to Q1 output, obtain stable waveforms using
Auto set mode. Measure the following;
c. amplitude (pk-pk),
Ans) 5.2V
d.

frequency
Ans)8.333 KHz

e. measure the high and low values of the pulse using amplitude cursors 1 and 2, the difference
between the low and high values you measured does this correspond to pk-pk amplitude
measured in part (i).
Ans)yes we get 5.2V.
f. measure the width of the pulse (on time) using time cursors 1 and 2,
Ans) we get 122us as width
g. measure inter-pulse duration using time cursors 1 and 2, note the value, what is the
corresponding pulse repetition frequency?, how does this value match with the digital signal you
have used on the Emona kit ?.
Ans)inter pulse duration is 114us and frequency is 8.3 Khz.
4. Set the type in channel 1 to Pos Width option and turn the width knob clockwise to increase
the pulse width to about (approximately) 25 micro secs.
a. Write your observations. Capture the waveform in the PC and transfer to your record.
Ans)

b. Bring the width knob back to the original position, connect channel 2 of DSO to Q2 (of the
twin pulse generator module), using time cursors measure the delay between the two pulses
(between Channel 1 and 2) and note it down.
Ans)Delay is 42us
c. Rotate the delay knob to obtain a time shift of 75 micro secs. What kind of signal operation have
you performed? Capture the waveform in the PC and transfer to your record.
Ans)Time shifting

B. Relation between time and Phase


5. Locate the phase shifter module. Move the phase knob to the minimum position (anticlockwise)
and put the switch to 0 degree position.
a. Connect the 100 kHz sinewave to the input in the phase shifter block, also connect channel 1 of the
DSO to the input of the phase shifter block. Connect channel 2 of DSO to the output of the phase
shifter. Use autoset in DSO to acquire the signal, what do you observe on the screen.

b. Is output an advanced version of the input? Rotate the phase knob in the clockwise direction such
that the output waveform becomes a delayed version of the input? Capture the waveform in the PC
and transfer to your record.
Ans) output as advanced version of input and delayed version of input

c. Rotate the knob completely to the extreme clockwise direction and comment on the nature of the
signal seen on the screen in terms of the phase shift and the time delay.Capture the waveform in
the PC and transfer to your record.
Ans)180 degree phase shift

d. Using time cursors measure the time difference between the location of the peaks of the both
signals. c) Also measure phase between channel 1 and 2 using DSO functionality. D) Now relate
the time period, time separation between the peaks of the signals and the phase. Write down your
observations?
Td=5us T=10us.phase diff=Td/T*2pi=pi

C. Amplitude scaling and reversal


6. Take 8 kHz digital input from the master signal block and connect to CLK in the twin pulse
generator block and ensure that the knobs width and delay are in their minimal position i.e. turn
them completely anticlockwise.
a. Locate adder block on the Emona Kit (ADDER ON THE TOP LEFT CORNER ) you will find
two rotating knobs corresponding to two amplifiers turn the knobs in both the amplifiers to the
anticlockwise position (minimum position).
b. Connect Q1 output of the twin pulse generator to the port A in adder module. Connect Q1 to
DSO channel 1 also.
c. Connect channel 2 of DSO to GA+gb port in the adder module.
d. Use autoset in DSO to acquire the signals. If you could not see a proper signal in channel 2 rotate
the knob of the amplifier port A slightly in the clockwise direction. What kind of signal operation
do you observe on the DSO? Use the horizontal scale knob of DSO to obtain a single pulse on the
screen, use the vertical knobs to position them conveniently. Capture the waveform in the PC and
transfer to your record.
Ans)Amplitude reversal.

e. Work with the amplifier port A knob to increase or decrease the amplitude of the channel 2 signal.
What kind of signal operation do you think you have performed?Capture the waveform in the PC
and transfer to your record.

Ans)

f. Locate the buffer module in the Emona Kit. Rotate the gain knob to minimum position i.e. in
anticlockwise direction.
g. Connect output of GA+gb port to input of the buffer. Now connect channel 2 of the DSO to the
buffer output port, using autoset in DSO acquire the signal. If you do not see any signal in
channel 2 slightly rotate the gain knob in the buffer block. If you compare the signal in part d from
channel 1 with the part f) channel 2 what do you observe. What you think has happened to the
signal when you passed it through the buffer? Capture the waveform in the PC and transfer to your
record.
Ans)Amplitude is reversed again

h. Work with the gain knob of the buffer amplifier and make your observations. Capture the
waveform in the PC and transfer to your record.
Ans)

D. Addition and Subtraction of Signals


7. Using adder, twin pulse generator and buffer modules add two signals and subtract two signals.
Assume that Q1 of twin pulse generator as signal 1 and Q2 as signal 2.

E. Random Signal
8. Locate noise generator module connect channel 1 of DSO to 0dB port of noise generator what do
you observe. Capture the waveform in the PC and transfer to your record.
Ans) noise

a. Are you able to stabilize the waveform on the screen?


no
b. What are the frequency measurements on this signal?
Fluctuating
c. Is the measured frequency value constant or fluctuating?
Fluctuating
d. Is the pk-pk value constant or fluctuating?
Fluctuating
e. Based on the above observation how do you classify this signal?
Noise

NAME : IYER VISHNUVARDHAN


ID NO: 2013AAPS049H

Experiment 5: Hardware based signal operations: Time invariance and


Principle of Superposition using Emona Telecom Trainer Kit
Aim: In this experiment students will learn to perform signal operations of time invariance and
principle of superposition using Hardware Kit (from Emona Instruments). The experiment
involves using modules based on signals and systems such as the Signal Generation, , Adder,
Buffer, and so on. Students are expected to do the connections on Emona Telecoms-Trainer 101
kit and interpret the results.
Equipment Required: Emona Telecom Trainer Kit 101, digital storage oscilloscope (DSO),
connecting patch cards, screwdriver (to turn the knobs in Emona Kit) etc. A snapshot of the
trainer kit front panel is as shown below.

Verifying Time-invariance property


The time invariance property states that the systems response for the same input but for
its time delay remains the same.
Procedure :
(i)

To generate input signals with same property but for the delay you may use the
outputs from Twin pulse generator and its delay feature. Use 2 kHz digital as
CLK input for the twin pulse generator.

(ii)

Using the output from Twin pulse generator, Adder and Buffer modules
generate a signal x(t) of the following type (as shown in Figure 1) and observe it in
channel 1 of DSO.

(iii)

Use the external trigger feature of DSO with input from 2 kHz digital of Master
signals generator. (Need for this step will be explained later)

FIGURE 1

(iv)

Assume that the given SYSTEM is Channel BPF on EMONA kit. Using the above
signal settings, connect as below

Now, you will observe in DSO, for two distinct input pulses (as shown in Figure 1) two distinct
responses in Channel 2. After this observation,
Perform the following steps:
1) Take out B input to the adder, and using time cursors of DSO, record the starting location
of the input pulse and starting location of the response.

Delay is : 6 microseconds

2) Connect back B input and take out A input, using time cursors of DSO, again record the
starting location of the input pulse and starting location of the response.

Delay is : 6 microseconds

3) Can you deduce whether the above system (channel BPF) is time invariant from the
above observations (1) and (2) ?

Yes the system is time invariant because the time delay between
the input and output response for various inputs is the same.

Verification of Superposition Principle


A linear system should follow the superposition principle (i.e scaling and additivity properties).
Here we are going to deal with two different input signals of different amplitudes being fed to a
system.

Procedure :
1) Let the system be RC LPF on EMONA kit
2) Let x1(t) = 2.5*sin(2*pi*2000*t), you may use Master signals generator and Adder
modules with gains to get the required amplitude for the signal

3) Let x2(t) = 3*sin (2*pi*2000*t)


4) Connect and get the response y1(t) for the input x1 (t) as shown below
x1(t)

y1(t)
SYSTEM

5) Use DSO to view x1(t) and y1(t) in channels 1 and 2 respectively.


6) Use 2 kHz sine wave to do external triggering of the DSO. Do not forget to set the trigger
mode in DSO to EXT trigger. (Need for this step will be explained later)
7) Use the waveform data capture option of the Tek Open choice Desktop software.
Get the channel 2 waveform data into a .csv file format (say file_1.csv) on the desktop.
8) Repeat steps 5 and 7 for exclusively input x2(t) also and call the .csv file as file_2.csv.

Check Scaling Property


ax1(t) ay1(t), bx2(t) b y2(t),
9) Let a = 1.2 and b = 0.8, then x3(t) = 1.2*x1(t) and x4(t) = 0.8*x2(t). Let the
corresponding system outputs be y3(t) and y4(t) respectively.
10) Capture the waveforms y3(t) and y4(t) as in step 7.

Graph of y3(t):

Graph of y4(t):

11) Verify whether y3(t) = 1.2*y1(t) and y4(t) =0.8*y2(t),

Yes , by observation their peak values are same.


12) To verify this import all .csv files into matlab (use import data menu/option) and
check the above equation.

For 1.2*y1(t):

For y3(t):

For 0.8*y2(t):

For y4(t):

Checking additivity property


x3(t) y3(t), x4(t) y4(t), then x3(t) +x4(t) y3(t)+y4(t)

13) Connect as below

x3(t)+x4(t)

y5(t)
SYSTEM

14) Using the waveform data capture option of the Tek Open choice Desktop software.
Get the channel 2 waveform data (i.e. y5(t)) into a .csv file format (say file-5.csv) on
the desktop.
15) Would you think that y3(t) + y4(t) = y5(t) ?
yes
16) To verify this import all .csv files into matlab and check the above equation.

Understanding the Importance of the Ext. trigger in the experiment


Now, remove the external trigger and trigger the waveforms with channel 1, perform the
following

1) x3(t) = 1.2*x1(t) and x4(t) = 0.8*x2(t). Let the corresponding system outputs be y3(t) and
y4(t) respectively.
2) Capture the waveforms y3(t) and y4(t).
3) Perform the operations as shown in block diagram below

x3(t)+x4(t)

y5(t)
SYSTEM

4) Capture y5(t).

5) Now, verify whether y3(t) + y4(t) = y5(t) ?.

Graph for y3(t)+y4(t)

Graph for y5(t)

6) Now explain the importance of trigger.

The trigger is used to pause the waveform so that calculations of its


parameters becomes easier.

Experiment 4: Generation and time operations on various signals using


Matlab with suitable practical examples

NAME:IYER VISHNUVARDHAN V
ID NO.:2013AAPS049H
SEC-2
Generation of Continuous Time Signals
In order to understand the nature of different signals that we come across in electrical engineering
and to study the behavior of various systems for different input signals, Matlab can be used
extensively.
One may note here that all the signals that we generate and the systems we consider for
simulating in Matlab, are discrete time signals and discrete time systems only. However,
assuming the time interval between the discrete events to be sufficiently small, continuous time
system can be simulated and experimented to study their behavior.
In this experiment we learn to simulate the common signals that we use in analyzing the systems.
Write Matlab programs for generating the following signals and plot them using subplot
command. Also, make sure to use : x-Label, y-label, Axis, Grid, Title appropriately.
You may use the following code snippet as an example for generating time vector of resolution 1
msec.:
%-------------% Time axis for signals
dt = 0.001;
% Time axis resolution 1 msec
Stime = 0;
% Start Time of the time axis. In this example it is 0 seconds
Etime = 10;
% End time of Time axis. In this example it is 10 seconds
Mytime = [Stime:dt:Etime]; % Total time axis
% You may change the Stime and Etime as per the need.
Ex a mple 1 --------------- --------- -------- ----------------- ----------------- -------- ------------

--------------------------------------------------------------------------------------------------------------------(1) Generate the following signals using Matlab code, and plot. Show the time and amplitude
scales :
a. A ramp signal starting at time = 345 msec and ending at time = 15.35 seconds and reaching
a maximum value of 2.3 volts.

b. A cosine wave signal of frequency 10 Hz, starting at time = 0 msec and ending at time =
15.356 seconds and reaching a maximum value of 1.3 volts.
(-2t)
c. The exponential signals: x = e
, starting at t = 0.5 sec and ending at t = 200.456 sec.

d. A sawtooth periodic signal with parameters.Amplitude = 1 and period T = 0.2 s Make sure
the time resolution is of 1 millisecond and the time duration of signals is 10 seconds.
Ramp signal

Cosine signal

1.4

1. 5

1.2

1
0. 5

0.8

A mplitu
de

Voltage

0.6
0.4

-1

0.2
0
0

-0.5

8
Time

10

12

14

-1. 5
0

16

Exponential signal

12

14

16

1
0.8
A mplitude

0.3
A mplitude

10

Sawtooth signal

0.4

0.2

0.1

0
0

8
Time

0.6
0.4
0.2

50

100

150

200

250

T ime

0
0

5
Time

10

Time Operations on Continuous Time Signals

%--------------Example 2-----------------------------------------------------------------------% Windowing effect of signals using relational operators


% let signal x is defined for (Stime t Etime) and we want to restrict it from ltime to utime
Stime = 0;
Etime = 5;
ltime = 1;
utime = 3;

% Start Time of the signal. In this example it is 0 seconds


% End time of the signal. In this example it is 5 seconds
% lower time limit of the signal. In this example it is 1 second
% upper time limit of signal . In this example it is 3 seconds

Stime = 0 ; dt = 0.01; Etime = 5;


t = [Stime:dt:Etime];
x=exp(-2*t)

% Expression of given signal (x)

ltime = 1;

% lower Time limit of the windowed signal. In this example it is 1 seconds

utime = 3;

% upper Time limit of the windowed signal. In this example it is 3 seconds

y=x.*(t>=ltime& t<utime)

% Expression for windowed signal between ltime and utime

% You may change the ltime and utime as per the need.

(2)
A. Windowing of given signals
a. Generate a sine wave signal x(t) of frequency 0.5 Hz, starting at time = -5 sec and ending at
time = 10 seconds and reaching a maximum value of 2 volts using Matlab Plot command.

Sine signal
1
0.8
0.6
0.4

Amplitude

0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-5

-4

-3

-2

-1

0
Time

b. Sketch the same sine wave windowed between 0 to 4 seconds and name it as signal y(t).

y(t)
1
0.8
0.6
0.4

Amplitude

0.2
0

-0.2
-0.4
-0.6
-0.8
-1
-5

-4

-3

-2

-1

0
Time

e. Plot signal y(t) using matlab in same figure window as x(t) using subplot command.
Show the time scale and labels. Index the plots using text command.

Sine signal
1

Amplitude

0.5
x(t)

0
-0.5
-1
-5

-4

-3

-2

-1

0
Time
y(t)

Amplitude

0.5
y(t)

0
-0.5
-1
-5

-4

-3

-2

-1

0
Time

B. Time Shifting operation on a Signal


a. Consider the signal x(t) = 1+ t

for ( 2 t 5)

b. Choose the time axis between -5 seconds to + 12 seconds at a resolution of 1 msec.


c. Generate x(t) and plot, using color blue and showing the time axis and labels

x(t)
7

Amplitude

x(t)
4

0
-4

-2

4
Time

10

12

d. Consider the time delayed signal y(t) = x(t+4.25). Generate y(t) and plot, overlaying on the
plot for x(t), using red color. Show the time scale and labels. Index the plots using
text command.

5.5

Amplitude

5
x(t)

y(t)=x(t+4.25)

4.5

3.5

-4 -2 0 2 4 6 8 10 12
Time

e. Consider the time advanced signal z(t) = x(t-4.25). Generate z(t) and plot, overlaying on
the earlier plot, with x(t) and y(t), using green color . Show the time scale and labels.
Index the plots using text command.

5.5

Amplitude

5
z(t)=x(t-4.25)
4.5

x(t)

y(t)=x(t+4.25)

3.5

2.5
-4

-2

4
Time

C. Time Folding operation on Signal:

10

a. Choose the time axis between -4 seconds to + 4 seconds at a resolution of 1 msec.


b. Generate x(t) and plot, using color blue and showing the time axis and labels.
1
0.9
0.8
0.7

x(t)

0.6
0.5
0.4
0.3
0.2
0.1
0
-4

-3

-2

-1

0
Time

c. Consider the time folded signal y(t) = x(-t) . Generate y(t) and plot, overlaying on the plot
for x(t), using red color. Show the time scale and labels. Index the plots using text
command.

0.9

0.8

0.7

0.6

x(t)

y(t)=x(-t)
0.5

x(t)

0.4
0.3
0.2
0.1
0
-2

-1.5

-1

-0.5

0
Time

0.5

1.5

Experiment 7: Experiment to understand Linear Convolution


Name :Iyer Vishnuvardhan V
Id no.:2013AAPS049H
This experiment is intended to expose students to MATLAB based convolution experiments,
relating to the convolution of continuous time signals. It is expected that the student will write a
readable code in a file and execute.
In this experiment,students are required to get impulse response of different systems and
convolve the impulse response with different test signals; and finally match the mathematically
convolved output with the systems output to the same given test signal.
NOTE:
(1) In the present experiment, though we are doing convolution operation on continuous time
signals, but note that practically in matlab,it is convolution on discrete time signals only.
(2) A necessary code for this is given below for Test signal 1 and system1, for which you will
modify accordingly for different systems and test signals given in PART A

Impulse response and Linear convolution


(i) The Matlab code/program given below takes impulse signal as input and obtains
impulseresponse for a given system1.
(ii) This impulse response is then convolved with the Test signal1 using Matlab conv
function.
(iii) This convolved output signal is then compared with the systems response to
the Test signal1
Note : Internally the system performs convolution which we are checking by
mathematically convolving the test signal with impulse response

Sample Code using SYSTEM1 AND TEST SIGNAL1:


% The following Matlab program obtains impulse response of a given system and verifies the
output of the system for the given Test signal1 with the convolution of the systems impulse
response and the given Test signal1
clc; close all;clear all% to clear all the command, variable, figure window variables
impulse1=[1 zeros(1,50)]; %generating an impulse signal

impulse_response=system1(impulse1); % impulse response of system 1


subplot(5,1,1),plot([1:length(impulse1)]*0.001, impulse1);% plot of input impulse
xlabel('Impulse signal'); % x-axis label
subplot(5,1,2),plot([1:length(impulse1)]*0.001, impulse_response);%plot of impulse response
xlabel('System1 output response of Impulse signal');
t=0:0.001:0.2; % defining time vector/scale
Testsignal1= square(2*pi*5*t);%Input test signal1
Testoutput=system1(Testsignal1);% output of the system1for the test signal1
subplot(5,1,3),plot(t,Testsignal1); % plot of input test signal1 signal
xlabel('Input Testsignal1'); % x-axis label
axis([0 0.25 -2 2])
subplot(5,1,4), plot(t,Testoutput);% Square wave response of system1
xlabel('System1 output response of Testsignal1'); % x-axis label
axis([0 0.25 -2 2]);
conv_output= conv(Testsignal1, impulse_response)% Convolution output using matlabconv
function
Time1=[1:length(conv_output)]*0.001; % Time scale/axis of the convolved signal
subplot(5,1,5),plot(Time1,conv_output);% plot of convolved output signal
xlabel('Convolution output of test signal1 and impulse response using matlabconv function');
axis([0 0.25 -2 2]);

Part A
Systems
Three systems are available for you to study its impulse response and to understand convolution
operation; These systems are a) system1, b)system2, and 3) system3.
Test signals
(1) Use the time vector t=0:0.001:0.2; given in the above sample program for generating the
signalsbelow for the given specifications, pk-pk amplitude is 2 V
i.

Square wave with Amplitude = 1 and f = 5 (Test signal1)

ii.

Square wave with Amplitude = 1 and f = 20 (Test signal2)

iii.

Sawtooth wave with Amplitude = 1 and f = 10 (Test signal3)

iv.

Triangular wave with Amplitude = 1 and f = 10 (Test signal4)

v.

Half wave rectified cosine waveform with Amplitude = 1 and f = 10 (Test signal5)

(2) Use the above given sample code and perform the following
a)
b)
c)
d)
e)

Take system2 and study its impulse response. Record your observations.
Write matlab code to generate Testsignal1.
Input the above generated Testsignal1 to the system2.
Convolve the impulse response to the test signal 1
Now compare the outputs from steps 3 and 4. Do they match?

(3) Repeat the above steps for each Testsignals given above, record your observations.
(4) Repeat the above steps for each test signal given above using system 3. Record all your
observations
.
System 1:
Cosine half wave

Square wave f=5

Square wave f=20

Sawtooth

Triangular

System 2:
Triangular

Rectified cos

Square f=20

Sawtooth

Square 5

System 3:
Triangular

Square f=20

Square f=5

Sawtooth

Half wave cos

Name: IYER VISHNUVARDHAN V


ID NO.: 2013AAPS049H
Experiment 8: Fourier Series and Fourier Transform (Using Matlab)
This experiment is intended to make the student to learn about Fourier Series (FS) and Fourier
Transform (FT) of Continuous Time Signals by using Matlabas a tool for computations. First, the
student is expected to perform FS expansion of a given signal, obtain the FS coefficients and
reconstruct the given signal from the FS coefficients and the harmonic terms. This is done in
Part A. The effect of considering finite number of FS terms in the reconstruction of the signal is
to be understood experimentally. In Part B, experiments are performed to understand the
Fourier Spectra, effect of the duration of the signal on the spectral separation in FS spectra.

Part A: Fourier Series and reconstruction of a signal.


For the signal f(t) shown below

1) DeriveTrigonometric Fourier series coefficients a ,a ,and b forthe above signal considering


a signal of duration from t1=9sand t2=13 s.(T0= 4 s)
2)

Write Matlab code for computing a0,an,and bnas a function of n.

3) Write Matlab code for reconstructing the signal using FS coefficients. The reconstruction
should be limited to the duration t1=9 sand t2=13 s.(T0= 4 s)

The above figure is of Coefficient an vs n

The above figure is of Coefficient bn vs n

4) Consider n=5 and use the above code to reconstruct the signal (f(t))during t=9 sand t=
1

13 s.(T = 4 s)and overlay the plots of the reconstructed signal and the given f(t).

Comment on your observations on how closely the reconstructed signal is following


a. at the rising and falling edges of the pulse
b. At the flat portion (3V region) and
c. At the flat portion (0 V region)
5

5) Compute the mean square error E = (1/N) (f(t)f(t)) ,where N is the length of the signal

vector

The above shows overlay of constructed signal form Fourier transform for
n=5 vs n=100
(Rising and falling edge )The rising and fall time has increased .
(the flat region 3V) the flat region is sinusodial not straight as the original.
( the flat region 0V) the flat region is sinusodial is not straight as original

The above shows overlay of constructed signal form Fourier transform for n=10 vs n=100

(Rising and falling edge )The rising and fall time has increased .

(the flat region 3V) the flat region is sinusodial not straight as the original.

( the flat region 0V) the flat region is sinusodial is not straight as original

The above shows overlay of constructed signal form fourier transform for n=20 vs n=100

(Rising and falling edge )The rising and fall time has increased and now is
closer to original
(the flat region 3V) the flat region is not straight as the original, but the
deviation hadecreased
( the flat region 0V) the flat region is s not straight as original but the
deviation has decreased

The above shows overlay of constructed signal form fourier transform for n=50 vs n=100

(Rising and falling edge )The rising and fall time is now is closer to original
(the flat region 3V) the flat region is not straight as the original, but the
deviation is minimal preturbations from the original
( the flat region 0V) the flat region is s not straight as original but the
deviation is minimal preturbations from the original

The above shows overlay of constructed signal form fourier transform for n=500 vs n=100

(Rising and falling edge )The rising and fall time is now is enhanced and is now
same to original
(the flat region 3V) the flat region is not perfect straight as the original, but
the deviations can be neglected
( the flat region 0V) the flat region is not perfect straight as the original, but
the deviations can be neglected.
6) Repeat steps 4 & 5 for n=10, 20, 50, 100, 500.
n

7) Plot E Vs nand comment on the observations.

En vs n graph
8) For n=100, evaluate the reconstructed signal f(t) for a time duration 0 to 20 sand
plot. How is this different from original f(t)? Comment on your observation.

Comparison of reconstructed signal for n=100 and original signal


Part B: Fourier Series and Fourier Spectra.
0

The Fourier spectra are the values of a and c = (a *a + b *b )for various values of n.

a) Write Matlab code for computing cfor n=5. Plot (n*)Vs cWhat is thespectral
n

0 n.

separation between the adjacent spectral points? Does this separation depend on
the number of terms used in FS based
reconstruction?
0

Ans : the difference between the adjacent spectral points is ( )which depends upon the T0 so if
0

T0 is changed , ( ), so if we take a region on the x axis for observation with increase in the T0

no.of spectral points in that region increases

b) Consider the signal from t1=7 sand t2=15 s.(T0= 8 s). Using the Matlab code
developed before, compute a,a,and bfor n= 100and Plot (n*)Vs cWhat is
0n

0 n. .

thespectral separation between the adjacent spectral points? How is this different
from the one in part (a). Comment on your observations.
The

above shown is Fourier spectrum


for the T0=8micro seconds
0

As mentioned T0 has changed the ( )will also changes the separation between the adjacent

spectral points now we see more points in the same amount of space.
c) Repeat (b) for t=3 sand t=19s.(T= 16 s). What is the impact on the spectral
separation
1

The above shown is fourier spectrum for the T0=16micro seconds


1

d) Guess what happens to the spectral separation if t =0 sand t = s.

Every point in the graph becomes 0 when the T0 goes to infinity

Experiment 9: Study of Passive Analog Filters


Aim: This experiment is intended to make the student learn about passive analog filters. Students
are expected to write Matlab code, compute and plot the frequency response characteristics of a
given filter. Then, by building the filter using R,L & C components, one is expected to measure
the gain response of the filter and compare with theoretical estimations.

A. Study of Analog Filters Using RLC components:


Consider the RLC circuit given in Figure 1.
Given : L= 100mH, C = 0.01F and R = 10K

Vin

Vout

Figure 1
1. What type of filter is this? (LPF/HPF/BPF/BSF) Justify your answer heuristically.
BPF
This Circuit is a combination of a Capacitor and Inductor in Parallel . A Capacitor is a
Low-Pass Filter and an Inductor is a High Pass Filter . So , a combination of these two
will lead to a filter which allows a specific range of frequencies depending on the values
of L and C , therefore , a Band Pass Filter .
2. Derive an expression for the magnitude square of the transfer function |()|2 of the
circuit in your note book.
3. Write Matlab program to Plot the magnitude square of the transfer function taking
frequency f on x axis using subplot

4. Write Matlab program to normalize the above magnitude plot using the expression
given below and plot it using subplot

|()|
]
(|()|)

|()| = 1010 [

H2 = sqrt(H(f));
A = 10*log(H(f).*H(f));
Plot(log(f),A);

5.

Choose the frequency values such that you cover the |H(f)| (normalized) values in the range
of 0 dB to -20 dB. Use semilog scale for the frequency axis and dB for Y-axis.

6. From the frequency response, Note down the 3 dB cut off points. What is the Bandwidth
of this filter?
4.31 KHz and 5.91 KHz

7. Using the circuit board provided, connect the circuit as given in figure 1.
8. Adjust the output voltage of the Analog Function Generator (AFG) to 1 Volt peak to
peak and select the signal to be a 1000 Hz sine wave and connect the AFG to the input
of the circuit. Connect the input and output of the circuit to channel1 and channel 2 of
DSO, respectively.
9. For various values of the input sinusoid frequencies, note the input and output
amplitudes of the signal (Use DSO). Calculate the gain of the filter for various
frequency values and tabulate them. Make sure that you select the frequencies so as
to cover the frequency response you obtained using Matlab.
10. Use Matlab to plot the frequency (semilog scale) Vs normalized power gain (gain
normalized to maximum gain) (dB) for the circuit you connected.

11. Compare the plots, obtained in question 9, with those of Question 4, and obtained
using Matlab. Comment on the discrepancies if any.

Additional Problem
Frequency Response Characteristics of Channel Band Pass filter on Emona kit. :
Locate the VCO Module on the Emona kit.
Set the sliding switch to HI Position.
Set the rotating frequency knob to left most position.
Connect the sine output to input of the channel BPF Module.
Connect the input and output of the Channel BPF to channel 1 and channel 2 of DSO,
respectively.
6. By varying the frequency knob in VCO, for various values of the input sinusoid
frequencies, note the input and output amplitudes of the signal (Use DSO). Calculate
the gain of the filter for various frequency values and tabulate them. Continue the
experiment till the knob is turned to the right most position completely.
7. Use Matlab to plot the frequency (semilog scale) Vs normalized power gain (gain
normalized to maximum gain) (dB).
8. From the plot, Tabulate the following measurements for the above filters.
1. 3dB bandwidth
2. Maximum Pass band ripple
3. Maximum Stop band ripple
4. Roll off in terms dB/KHz at 3dB, 6dB and 12 dB points
1.
2.
3.
4.
5.

You might also like