0% found this document useful (0 votes)
23 views68 pages

SNS Final - 1-Merged

The document is a lab manual for the Signals and Systems course (EE-232) at NED University, detailing laboratory sessions, objectives, and activities related to electrical engineering experiments. It includes instructions for using oscilloscopes, MATLAB software, and various signal processing techniques. The manual also outlines attendance and grading rubrics for students participating in the lab sessions.

Uploaded by

ahzemsiddique
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)
23 views68 pages

SNS Final - 1-Merged

The document is a lab manual for the Signals and Systems course (EE-232) at NED University, detailing laboratory sessions, objectives, and activities related to electrical engineering experiments. It includes instructions for using oscilloscopes, MATLAB software, and various signal processing techniques. The manual also outlines attendance and grading rubrics for students participating in the lab sessions.

Uploaded by

ahzemsiddique
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/ 68

NED University of Engineering & Technology

Department of Electrical Engineering

LAB MANUAL
For the course

SIGNALS AND SYSTEMS


[EE-232] For SE [EE]

Instructor Name:__________________________________
Student Name:____________________________________
Roll No: Batch:___________________
Semester: Year:____________________
Laboratory Session Signals & Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

LAB MANUAL
For the course

SIGNALS AND SYSTEMS


(EE-232) For S.E.(EE)

Content Revision Team:


Dr. Krishan Lal Khatri, Engr. Rashid Hussain

Last Revision Date:

Approved By

The Board of Studies of Department of Electrical Engineering


To be filled by Lab technician

Attendance: _______ Present out of _______ Lab sessions

Attendance Percentage: _______

To be filled by Lab Instructor

Lab Score Sheet

Roll No. Rubric Rubric Rubric Rubric Rubric Rubric OEL/PBL Final LAB Attendance Final weighted Score for
based based based based based based Rubric Rubric Percentage MIS System
Lab I Lab II Lab III Lab IV Lab V Lab VI Score Score [10(A)+10(B)+5(C)]/25
A B C Round to next higher
multiple of 5

EE-232 Signals and Systems Rubric Based Labs 1, 2, 3, 4, 7, 9

Note: All Rubric Scores must be in the next higher multiple of 5 for correct entry in MIS system.
Laboratory Session Signals & Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

CONTENTS

Sr. No. Date Title of Experiment Signature

To get introduced with the basic features and functions of


1 Oscilloscope, function generator and DC power supply.

2 Get introduced with the MATLAB software.

Plotting of Basic Signals in MATLAB & familiarization with


3(a) procedural programming in MATLAB

Manipulating signals and developing systems on MATLAB.


3(b)
Understand concepts of Fourier series hypothesis through
4 MATLAB.

5 To study different types of signals using MATLAB.

Using MATLAB Simulink, explore the response of a simple


6 RC circuit.

Time Domain Analysis of FIRST ORDER Circuit – To


simulate, understand, and validate Zero-Input Response of
7 RC Series Circuit

Time Domain Analysis of SECOND ORDER Circuit – To


simulate, understand, and validate Zero-Input Response of
8 RLC Series Circuit

To perform and understand Convolutional Integral (C.I) of


two signals using MATLAB and compare it with C.I
9 calculated analytically

To solve Ordinary Differential Equation (ODE) using


10 MATLAB

Problem based Learning [Open Ended Lab]


11 Design and observe the working of Low Pass Filter

Problem based Learning [Open Ended Lab]


12 Design and observe the working of High Pass Filter
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 01

Objective:

To get introduced with the basic features and functions of Oscilloscope, function generator
and DC power supply.

Theory:

Introduction to Oscilloscope:
It is an instrument which is used to display the waveform or time vs value curves of electrical signals.

Front View of Oscilloscope

1
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Control Function Purpose


1. Power Button Turn the oscilloscope on and off.
2. Auto-set It automatically identifies suitable scales (horizontal and vertical) for the
channels.
3. Cursor It measures the time domain characteristics of a circuit.
4. Run/Stop It freezes the waveform until the run/stop button is pressed again.
5. Measure It measures two types of characteristics; Time characteristics and voltage
characteristics.
6. Math Used to define math waveform using the math menu. This operation
allows us to add two waveforms together, creating a new waveform
display.
7. Channel Parameters Used to access signal parameters which includes coupling, invert, probe,
impedance. These parameters can be changed by function keys F1, F2, F3,
F4 and F5.
8. Acquire Used to control how waveform points are generated from sample points
referring to digital values taken directly from ADC.
9. Display Used to access screen display parameters which includes dots and
vectors, accumulate, refresh, contrast, grid and bandwidth. These
parameters can be changed by function keys F1, F2, F3, F4 and F5.
10. Channel1 Used to detect signal from the Oscilloscope.
11. Channel2 Used to detect signal from the Oscilloscope.
12. EXT. Trigger Used to detect signal from the Oscilloscope with repetitive transient wave
forms.
Characteristics of Oscilloscope

a) Basic Purpose

It is an instrument which is used to display the waveform or time vs value curves of electrical
signals.

Setting Up Connections;

Before using the Oscilloscope, the proper grounding is very important for safety purpose, not for
the user but also for testing the integrated circuits (ICs), necessary because if a high voltage
contacts with any grounded part, the current travels through the grounding path to earth, rather
harming the user.

Connecting the Probes;


Once the Oscilloscope the properly grounded, the probes are to be connected which will enable
a user to access all of the power and performance in the Oscilloscope and will ensure the integrity
of the Signal which is to be measure. It requires two connections to measure a Signal.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

2. Types of Waves

Following are the waves produced by the function generator;

Sine Wave Square Wave Triangular Wave

3. Duty Cycle

The term duty cycle describes the proportion of 'on' time to the total fundamental time. For 90%
it is ‘ON’ time and for 10% it is for ‘OFF’ time. It is only for square waves.

Duty Cycle
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

LAB#1
Activity: Add two waves of 50Hz and 100Hz.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 02

Objective:

Get introduced with the MATLAB software.

Theory:

Defining Variables

• Delimit to suppress command window results

>> a = 2; % Initializes and defines in a single step

[Note: Semicolon’s are not used if user want to display value on command window.]

>> a = 2

a=

>> y = 3+a; % Creates variable y


>> z = y+a; % Creates variable y
>> clear a; % Deletes variable a
>> clear all; % Delete all variables in single step

************************Above is the command window output************************

[Note: Variable names should start from letter, MATLAB default variables cannot be used such as pi,
i, ans, NaN etc.]
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Plotting Command

>> t = 0 : 0.001 : 0.5;


>> y = sin(2*pi*30*t);
>> plot(t,y) % plots labeled graph
>> plot(t,y), xlabel('Time'), ylabel('f(t)'), title('f(t)=sin(2\pi30t)'), grid on; %plots with other attributes like labels, grid
and title
>> plot(t,y, 'r'), title('sin(2\pi30t)', 'Color' ,'b'); %plots with colored titles
Code 02: Plotting using MATLAB

Observation:

Advanced plotting tools

• Contour Plots

>> [x,y] = meshgrid(-5:.1:5, -5:.1:5);


>> z = -(x.^2 + y.^2);
>> contour(x,y,z) %Develop 2-D contour plots from 3-D information
Code 03: Contour Plot from 3D information using MATLAB

Observation:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

• Surface Plots
>> surf(x,y,z), xlabel('x'), ylabel('y'), zlabel('-(x^2+y^2)'); % Develop 3-D surface
>> surfc(x,y,z), xlabel('x'), ylabel('y'), zlabel('-(x^2+y^2)'); % Develop 3-D surface with their contour on xy plane
Code 04: Contour Plot from 3D information using MATLAB

Observation:

• 3-D Line Plot

>> clear all;


>> t = 0:0.0001:0.05;
>> x = cos(2*pi*50*t);
>> y = sin(2*pi*50*t);
>> plot3(t,x,y), xlabel('Time'),
ylabel('cosine axis'), zlabel('sine axis')

Observation:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

MATLAB Plotting GUI: -

Fig. 2.6 illustrates the GUI (Graphical User Interface) of MATLAB plotting. GUI helps to
customize the plotted figures; labels, orientation, colours and many of its insights.

GUI

Fig.2.7 depicts the menu bar and tool bar of GUI of plotting figures. Below Following fig. 2.8 shows the
options of menu bar. They are very helpful to copy image with high quality, label axis, Zoom In-Out, scaling
etc. On a side, tool bar has shortcut keys like 3D rotation, coloring, Zoom In-Out etc.

Menu bar and Tool bar

File Menu Edit Menu Insert Menu Tools Menu View Menu
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

POST LAB ACTIVITY:

Activity 1:
For given Matrices:

Find results of:


a) A.b
b) a+4
c) b.a
d) a.bT
e) A.aT

CODE:
A = [2 9 0 0; 0 4 1 4;7 5 5 1; 7 8 7 4]
b = [ -1;6;0;9 ]
a = [ 3 -2 4 -5]
disp("A.b:")
disp( A*b )
disp("a+4:")
disp( a+4 )
disp("b.a:")
disp( b*a )
try
disp ("a.bT:")
disp ( a*b' )
catch
disp ( "Cannot perform 'a.bT'")
end
try
disp ("A.aT:")
disp ( A*a' )
catch
disp ( "Cannot perform 'A.aT'")
end
COMMAND WINDOW OUTPUT:
A =

2 9 0 0
0 4 1 4
7 5 5 1
7 8 7 4
b =

-1
6
0
9
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

a =

3 -2 4 -5

A.b:
52
60
32
77

a+4:
7 2 8 -1

b.a:
-3 2 -4 5
18 -12 24 -30
0 0 0 0
27 -18 36 -45

a.bT:
Cannot perform 'a.bT'
A.aT:
-12
-24
26
13
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 03(a)

Object:
Plotting of Basic Signals in MATLAB & familiarization with procedural
programming in MATLAB

Theory:

In the fields of communications, signal processing, and in electrical engineering more


generally, a signal is any time‐varying or spatial‐varying quantity. This variable (quantity)
changes in time.

• Speech or audio signal: Sound amplitude that varies in time


• Temperature readings at different hours of a day
• Stock price changes over days etc.

Signals can be classified by continues‐time


signal and discrete‐time signal:
 A discrete signal or discrete‐time
signal is a time series, perhaps a
signal that has been sampled from
continuous time signal.
 A digital signal is a discrete‐time
signal that takes on only a discrete set
of values.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

More exercises with for loop:


 What result will be output to the screen in each of the following examples?

y = 0;
for k = 1:5
y = y + k;
end
y

 What is the value of y:

y = 0;
for k = 2:2:8
y = y + k;
end
y
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

 What would be contained in the vector y?

for k = 1:5
y(k)=k^2;
end
y

Nested Loops:
for j = 1:3
for k = 1:3
T(j,k) = j*k;
end
end
T

Decision Making Constructs:


if(condition) if(condition)
statement1 statement1
statement2 statement2
end else
statement3
statement4
end

Plotting with Loops:


 Consider this equation:


 Plot this equation using ‘for loop’ for values of x from -10 to 10.

 Hint: Use a for loop to calculate and store x and y values in one-dimensional arrays

for i = 1:21
x(i) = -10 +(i-1);
y(i) = 2^(0.4*x(i)) + 5;end
 After running these lines of code, two one-dimensional arrays, x and y, have been
created, each with 21 elements
 The stored arrays can be plotted with the command: plot(x,y)
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

 Any two one-dimensional arrays can be plotted, as long as they are exactly the same
size
 The plot will be created in a new window

Now, add x label, y label and set x limit and y limit yourself.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

POST LAB ACTIVITY:

Activity: Acquire 1000 points of cosine wave having frequency of 60Hz using for loop. Plot the Signal.

Observation

Conclusion
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 03(b)

Objective:

Manipulating signals and developing systems on MATLAB software.

Theory

Numerical models of Exponential Signals

• Imaginary Power
• Real Power
• Complex Power

Numerical models of Exponential Signals with Imaginary Power

>> t = 0 : 0.001 : 0.8;


>> y1 = exp(-3*i*t); % Developing imaginary numerical model of simple decaying exponential signal
>> plot3(t,real(y1),imag(y1)),title('f(t)=\ite^{-3jt}'); % plots negative frequency signal
>> y2 = exp(+3*i*t); % Developing imaginary numerical model of simple rising exponential signal
>> plot3(t,real(y2),imag(y2)),title('f(t)=\ite^{3jt}'); % plots positive frequency signal
Code 01: Plotting imaginary numerical model using MATLAB

Imaginary Decay Exponential Plot Imaginary Oscillatory Exponential Plot

The plot is in the form of Sine and Cosine wave curves. When we plot imaginary values, cycles are to
be appeared, negative cycles classified them into decay of exponential plot as they are dealt in
negative signs. Similarly, for the oscillatory exponential signal these cycles are positive cycles as they
are dealt in positive sign. They just differ by signs which kept them different and classified into Decay
and Oscillatory Exponential cycles when they are imaginary values. But these are not useful to us
because they cannot be described in our physical world.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

>> y5 = exp(-20*t); % Developing numerical model of simple rising exponential signal


>> plot(t,y5),xlabel('Time'),ylabel('f(t)'),title('f(t)=\ite^{-20t}'), grid on; % plots rising exponential signal

OBSERVATION
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

▪ Numerical models of Exponential Signals with Complex Power

>> t = 0 : 0.001 : 0.8;


>> y6 = exp((-0.2+3*i)*t); % Developing complex numerical model of simple decaying exponential signal
>> plot3(t,real(y6),imag(y6)),title('f(t)=\ite^{-0.2+3jt}'); % plots decaying complex exponential signal
>> y7 = exp((0.2+3*i)*t); % Developing complex numerical model of simple oscillating exponential signal
>> plot3(t,real(y7),imag(y7)),title('f(t)=\ite^{0.2+3jt}'); % plots oscillating complex exponential signal

OBSERVATION
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Run the following codes on MATLAB and attach the output and comment on it.

>> t2 = 0 : 0.001 : 0.8;


>> y8 = exp((0.2+3*i)*t2))+ exp((0.2-3*i)*t2);% Developing real signal using two complex exponential signal
>> plot3(t2,real(y6),imag(y6)),title('f(t)=\ite^{-0.2+3jt}'); % plots real signal using two complex exponential signal
>> plot(t2,y8),title('f(t)=\ite^{0.2+3jt}+\ite^{0.2-3jt}'); % plots oscillating complex exponential signal
Code 05: Plotting real signal using two complex exponential signal using MATLAB

OBSERVATION
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Sample Model

OBSERVATION
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

CONCLUSION
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 04

Objective:

Understand concepts of Fourier series hypothesis through MATLAB.


Theory:

Fourier Series Hypothesis

a) Statement
“Any periodic signal can be expressed as a linear combination of sinusoids or infinite sum of
sines and cosines”

b) Analysis Equation

The Fourier series can be analyzed in trigonometric form, compact trigonometric form and
exponential form. Where, “a0” is the zero harmonic (i.e. DC Offset at zeroth harmonic) and
“n” is no. of harmonics.

i. Trigonometric Form
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session#04 Signals &Systems (EE-231)


Department of Electrical NED University of Engineering and
Engineering Technology
ii. Compact Trigonometric Form

iii. Exponential Form


Fourier Synthesis using MATLAB
(a) Find the trigonometric Fourier series for y(t) shown below.

T=pi; w=2;
syms t
a0=(1/T)*(int(exp(-t/2),t,0,T)); x=a0;
d = -2*pi:0.01*pi/2:2*pi;
%d=(-d);
for n=1:16
an=(2/T)*(int(exp(t/2)*cos(2*t*n),t,0,T));
bn=(2/T)*(int(exp(t/2)*sin(2*t*n),t,0,T)); x=x+(an*cos(2*n*d))+(bn*sin(2*n*d));
subplot(4,4,n), plot(d,x),xlabel('t'),ylabel('x(t)'); cn(n+1)=sqrt((an^2)+(bn^2));
thetha(n+1)=((atan(-bn/an))*(180/pi)); temp(n+1)=n;
end cn(1)=a0; thetha(1)=0; temp(1)=0;
%plot(-d,x),xlabel('t'),ylabel('x(-t)'),title('x(t)=\ite^{-t/2}');
%subplot(2,1,1),
%stem(temp,cn),xlim([- 1,10]),ylim([0,0.7]),xlabel('n'),ylabel('Cn'),title('Amplitude Spectrum');
%subplot(2,1,2),
%stem(temp,thetha),xlim([-1,10]),xlabel('n'),ylabel('Thetha(n)'),title('Phase Spectrum');
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Fourier Synthesis using MATLAB


(a) Find the trigonometric Fourier series for y(t) shown below.

T=pi;
w=2;
syms t
a0=(1/T)*(int(exp(-t/2),t,0,T));
x=a0;
d = -2*pi:0.01*pi/2:2*pi;
%d=(-d);
for n=1:16
an=(2/T)*(int(exp(t/2)*cos(2*t*n),t,0,T));
bn=(2/T)*(int(exp(t/2)*sin(2*t*n),t,0,T));
x=x+(an*cos(2*n*d))+(bn*sin(2*n*d));
subplot(4,4,n), plot(d,x),xlabel('t'),ylabel('x(t)');
cn(n+1)=sqrt((an^2)+(bn^2));
thetha(n+1)=((atan(-bn/an))*(180/pi));
temp(n+1)=n;
end
cn(1)=a0;
thetha(1)=0;
temp(1)=0;
%plot(-d,x),xlabel('t'),ylabel('x(-t)'),title('x(t)=\ite^{-t/2}');
%subplot(2,1,1),
%stem(temp,cn),xlim([-
1,10]),ylim([0,0.7]),xlabel('n'),ylabel('Cn'),title('Amplitude Spectrum');
%subplot(2,1,2),
%stem(temp,thetha),xlim([-1,10]),xlabel('n'),ylabel('Thetha(n)'),title('Phase
Spectrum');
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Observations:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

CONCLUSION
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

b. The signal y(t) can be obtained by time reversal of x(t) shown below. Use this fact to obtain
the Fourier series for y(t) from the results in your textbook “Example 6.1”. Verify that the
Fourier series thus obtained is identical to that found in part (a).

Code:
T=pi;
w=2;
syms t
a0=(1/T)*(int(exp(-t/2),t,0,T));
x=a0;
d = -2*pi:0.01*pi/2:2*pi;
d=(-d);
for n=1:16
an=(2/T)*(int(exp(-t/2)*cos(2*t*n),t,0,T));
bn=(2/T)*(int(exp(-t/2)*sin(2*t*n),t,0,T));
x=x+(an*cos(2*n*d))+(bn*sin(2*n*d));
subplot(4,4,n), plot(-d,x),xlabel('t'),ylabel('x(t)');
cn(n+1)=sqrt((an^2)+(bn^2));
thetha(n+1)=((atan(-bn/an))*(180/pi));
temp(n+1)=n;
end
cn(1)=a0;
thetha(1)=0;
temp(1)=0;
%plot(-d,x),xlabel('t'),ylabel('x(-t)'),title('x(t)=\ite^{-t/2}');
%subplot(2,1,1),
%stem(temp,cn),xlim([-
1,10]),ylim([0,0.7]),xlabel('n'),ylabel('Cn'),title('Amplitude Spectrum');
%subplot(2,1,2),
%stem(temp,thetha),xlim([-1,10]),xlabel('n'),ylabel('Thetha(n)'),title('Phase
Spectrum');
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Output:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

c. Show that, in general, time reversal of a periodic signal does not affect the amplitude
spectrum, and the phase spectrum is also unchanged except for the change of sign.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 05

Objective:
To study different types of signal using MATLAB

THEORY
 Singularity Functions:
Singularity functions are discontinuous functions, or their derivatives are discontinuous.
A singularity is a point at which a function does not possess a derivative. In other words,
a singularity function is discontinuous at its singular points.
Singularity functions are a class of discontinuous functions that contain singularities, i.e.
they contain points in which their derivatives do not exist. In other words, a singularity
function is discontinuous at its singular points.

 Elementary Signals:
The elementary signals are used for analysis of systems. Such signals are,
1. Step
2. Impulse
3. Ramp
4. Exponential
5. Sinusoidal

 Some Useful Signals:


1. Dirac Delta Function:
The Dirac delta can be loosely thought of as a function on the real line which is zero
everywhere except at the origin, where it is infinite,

and which is also constrained to satisfy the identity

This is also called unit impulse function.


Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

2. Unit Step Sequence:


The unit step function is a discontinuous function, whose value is zero for negative
arguments and one for positive arguments.

It can also be defined as the integral of the Dirac delta function.

3. Ramp Sequence:
The ramp function is a unary real function which is 0 for negative inputs; output equals
input for non-negative inputs.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

5. Rect Function:
The Rect Function is a function which produces a rectangular-shaped pulse with a width
of 1 centered at t = 0. The Rect function pulse also has a height of 1. A rect function cn
be written in the form :
𝑡−𝑋
Rect ( 𝑌 )
where the pulse is centered at X and has width Y.

6. Signum Function:
The sign function or signum function is an odd mathematical function that extracts
the sign of a real number.
The signum function of a real number x is defined as follows:

Alternatively,
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

7. Square Wave:
A square wave is a non-sinusoidal periodic waveform in which the amplitude
alternates at a steady frequency between fixed minimum and maximum values, with
the same duration at minimum and maximum.
It can be defined as simply the sign function of a sinusoid:

8. Sawtooth wave:
The sawtooth wave, called the "castle rim function" is the periodic function given by

where is the fractional part , is the amplitude, is the period of


the wave, and is its phase. It therefore consists of an infinite sequence of
truncated functions concatenated together.

POST LAB ACTIVITY:


Activity: Plot various functions as outlined above using Matlab, both as continuous-time
signals, and discrete-time signals
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

1) Unit Impulse:

2) Unit Step:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

3) Ramp:

4) Sinc:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

7) Square:

8) Sawtooth:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 06

Objective:

Using MATLAB Simulink, explore the response of a simple RC circuit.

Theory:

Time Delay Circuits


A circuit in which the output signal is delayed by a specified time interval with respect to the
input signal is known as Time delay circuit or simply a delay circuit. All the Electrical systems
experiences some sort of “time delay” between its input and output when the voltage or
signal is applied to it.

Time Constant ( τ )
The delay in the time delay circuits is generally known as the Time Constant of the
circuit and is defined as;

“The time required for the response to decay to a factor of 1/e or ≈36.8% of its initial value,
conversely, the time required to charge the capacitor from an initial voltage of zero to ≈63.2%
of the value of an applied source voltage”

The time constant of a circuit mainly depends upon the reactive components either
capacitive or inductive connected to it and is a measurement of the response time with
the unit of Tau (τ).

RC as a Time Delay Circuit


Consider a simple series RC circuit having;

 R=1.8k Ω
 C=1µF
 VS = 5Vpp
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

This is the response of the RC circuit to abrupt change of source when the capacitor was initially
charged to some voltage Vo at t – instant. Since the voltage of a capacitor cannot change
abruptly, therefore

When the initial conditions are zero then,

For the desired circuit VS = 5V and τ = 1.8 ms;

POST LAB ACTIVITY:


Plot the natural and forced response of the circuit using MATLAB and Validate its total response.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 7

Objective:

Time Domain Analysis of RC Circuit – To simulate, understand, and validate Zero-Input


Response of RC Series Circuit

Theory:

TIME CONSTANT

In an RC circuit, the product of Resistance and capacitance of the circuit is called RC time
constant (). It has a good contribution in the time delay of RC circuits. Mathematically;
Where R is the resistance of the circuit and C is the capacitance of the circuit.

Significance of Time Constant

The value of time constant is measured in seconds. It is the value of time that shows how
much a capacitor will be charged and discharged. One must note that five times the time
constant (tau) refers to the state when a capacitor is either fully charged or fully
discharged depending on whether an RC circuit is charging or discharging.

RESPONSE OF SYSTEM:

System’s output is the result of two causes that are independent:

I. Initial conditions at t = 0
II. Input of system at t ≥0
The total response of system is sum of two components.

TYPES OF RESPONSE:

Zero input response:


That results from initial conditions at t = 0, with input x(t) = 0, for t≥0.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Zero-state response:
Response that results from input x(t) for t ≥ 0, with initial conditions (at t = 0)
are zero.

TOTALRESPONSE

TOTAL RESPONSE = Zero-input response + Zero-state response

To calculate zero input response of RC Series circuit,

𝑦0 (𝑡) = 𝑦(0). 𝑒 −𝑡/𝑅𝐶

Activity 1: Simulate RC Circuit using Simulink, given,

C = 220µF , R = 10000 Ohm, Initial Conditions: Vc(0) = y(0) = 5V


Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity 2: Calculate Time Constant and draw the graph of Vc


Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity 3: Observe Zero-Input response using Simulink’s scope element and observe
values as mentioned in each column below:

Time Constant = 2.2 sec

Time (t) Observed Observed Calculated Calculated Remarks


Value y(t) %age y(0) Value y(t) % of y(0)
t = 1.T 1.844 36.88 1.839 36.78
t = 2.T 0.676 13.52 0.676 13.53
t = 3.T 0.249 4.98 0.249 4.98
t = 4.T 0.092 1.84 0.091 1.83
t = 5.T 0.030 0.6 0.033 0.673

POST LAB ACTIVITY:

Activity 1: Simulate RL Circuit using Simulink. Assume the values of each element
R=100 , L=10 , Time Constant=0.1 sec
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity 2: Calculate Time Constant and draw the graph of current through inductor
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity 3: Observe Zero-Input response using Simulink’s scope element and observe values
of parameters mentioned in the table below:

Time (t) Observed Observed Calculated Calculated Remarks


Value y(t) %age y(0) Value y(t) % of y(0)
t = 1.T 1.841 36.82 1.839 36.78
t = 2.T 0.679 13.58 0.676 13.53
t = 3.T 0.249 4.98 0.249 4.97
t = 4.T 0.092 1.84 0.091 1.83
t = 5.T 0.030 0.6 0.037 0.67
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 08

Objective:

Time Domain Analysis of SECOND ORDER Circuit – To simulate, understand, and validate
Zero-Input Response of RLC Series Circuit

Theory:

SECOND ORDER CIRCUITS

Circuits that include an inductor, capacitor, and resistor connected in series or in parallel are
second-order circuits.

If you can use a second-order differential equation to describe the circuit you’re looking at, then
you’re dealing with a second-order circuit.

TIME CONSTANT

In an RC circuit, the product of Resistance and capacitance of the circuit is called RC time constant
or (). It has a good contribution in the time delay of RC circuits.
Mathematically; for RC Circuit,
𝜏 = 𝑅𝐶
For RL circuit,
𝑅
𝜏=
𝐿

Where R is the resistance of the circuit, C is the capacitance, and L is inductance of the circuit.
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity:

Construct a series RLC circuit using Simulink with R = 3 Ohms, L=1 H, C=1.5 F. Visualize the response of
circuit as voltage across capacitor and current through the circuit.

Circuit:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Current:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Voltage:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

POST LAB ACTIVITIES


Activity 1:

Simulate zero input response of RLC Series circuit, given Vc (0) = y (0) = 5V and visualize the
response as current through inductor

C = 0.22F, R = 1-Ohm, L = 1H, Initial Conditions: Vc (0) = y (0) =5V

Circuit:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Current:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Voltage:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity 2:

Simulate zero input response of RLC Series circuit, given Vc (0) = y (0) = 5V and visualize the
response as current through inductor

C = 4F, R = 1-Ohm, L = 1H, Initial Conditions: Vc (0) = y (0) =5V

Circuit:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Current:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Voltage:
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 9

Objective:

To perform and understand Convolutional Integral (C.I) of two signals using


Matlab and compare it with C.I calculated analytically

Theory:

CONVOLUTION

Convolution between two continuous time signals 𝑥(𝑡) and ℎ(𝑡) is defined as:

𝑥(𝑡)ℎ(𝑡) = ∫ 𝑥(𝜏)ℎ(𝑡 − 𝜏)𝑑𝜏
−∞
Where, τ is a dummy variable for integration.

Activity 1: Perform Continuous Time Convolution using Matlab and draw graphs of signals and
convolutional integral using Matlab for following signal,

𝑥(𝑡) = 0.5, 2 < 𝑡 < 4


𝑥(𝑡) = 0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
And
ℎ(𝑡) = 𝑒 −3𝑡 𝑢(𝑡)

Matlab Script:
t0=0;
tf=12;
N=5000;
dt=(tf-t0)/N;
t=t0:dt:tf;
for k=1:length(t)
if t(k) < 2
x(k)=0;
else if t(k) < 4
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

x(k)= 0.05;
else
x(k)=0;
end
end
end
h=exp(-3*t);
y=conv(x,h);
subplot(3,1,1), plot(t,x,'r')
axis([t0,tf,0,0.1])
ylabel('x(t)'), xlabel('t')
subplot(3,1,2), plot(t,h,'r')
axis([t0,tf,0,2])
ylabel('h(t)'), xlabel('t')
subplot(3,1,3), plot(t,y(1:length(t)),'r')
axis([t0,tf,0,10])
ylabel('y(t)'),xlabel('t')

OUTCOME
LAB#9
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Activity 2: Perform convolution analytically and draw graphs. Compare the graphs drawn in matlab to
the manual graph of analytically derived C.I.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 10

Objective:

To solve Ordinary Differential Equation (ODE) using Matlab

Theory:

An ordinary differential equation (ODE) is defined as the equation that contains one or more functions of
one independent variable and its derivatives.
𝑑𝑦(𝑡)
𝑑𝑡
+ 𝑦(𝑡) = 𝑡 , where y(t) is function of independent variable t
The solution of such equation contains two parts.
1) Homogeneous Solution, which is computed with assumption that Input to the system is Zero.
2) Particular Solution, which is calculated assuming Zero Initial Conditions.
3) The total solution is linear sum of both homogeneous solution and particular solution as given
below:

𝑦(𝑡) = 𝑦ℎ (𝑡) + 𝑦𝑝 (𝑡)

Activity 1: Solve following 2nd order ODE using Matlab


𝑑2 𝑦(𝑡) 𝑑𝑦(𝑡) 𝑑𝑦(𝑡)
𝑑𝑡
+ 𝑑𝑡
= 𝑥(𝑡) , given x(t) = 2t, and initial conditions, y(0) = 0 and 𝑑𝑡
=0
Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

LAB#10 Activity:1

Post Lab Activity 1:


Laboratory Session Signals &Systems (EE-232)
Department of Electrical Engineering NED University of Engineering and Technology

Post Lab Activity 2:


Considering an example of 1st order ODE:
dx/dt= 3e^-t with initial condition x(0)=0

You might also like