0% found this document useful (0 votes)
161 views

Signals and Systems Lab Manual-2020

This document appears to be the introductory section of a lab manual for a Signals and Systems course. It provides information about the course code, instructor, revision team, and table of contents for the lab sessions. The lab sessions will introduce students to equipment like oscilloscopes and function generators. They will also involve MATLAB simulations of signals and circuits. The document outlines the contents, objectives, and evaluation criteria for the lab sessions.

Uploaded by

shayan sheikh
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)
161 views

Signals and Systems Lab Manual-2020

This document appears to be the introductory section of a lab manual for a Signals and Systems course. It provides information about the course code, instructor, revision team, and table of contents for the lab sessions. The lab sessions will introduce students to equipment like oscilloscopes and function generators. They will also involve MATLAB simulations of signals and circuits. The document outlines the contents, objectives, and evaluation criteria for the lab sessions.

Uploaded by

shayan sheikh
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/ 92

NED University of Engineering & Technology

Department of Electrical Engineering

LAB MANUAL
For the course

SIGNALS AND SYSTEMS


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

Instructor name:__________________________________
Student name:____________________________________
Roll no: Batch:___________________
Semester: Year:________________
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

LAB MANUAL
For the course

SIGNALS AND SYSTEMS


(EE-231) For T.E.(EE)

Content Revision Team:


Ms. Ayesha Saeeed, Dr Mohsin Aman
Last Revision Date:

Approved By

The Board of Studies of Department of Electrical Engineering

______________________ _____________________

______________________ ____________________

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

CONTENTS
Psychomotor / Cognitive Level:
CLO/PLO:

S.No. Date Title of Experiment Total Marks Signature

To get introduced with the basic features and


1 functions of Oscilloscope, function generator
and DC power supply.

2 Get introduced with the MATLAB software.

Plotting of Basic Signals in MATLAB &


familiarization with procedural programming in
3 MATLAB

Understand concepts of Fourier series hypothesis


4 through MATLAB.
Observe the charging and discharging of an RC
5 circuit.
Using MATLAB Simulink, explore the response of
6 a simple RC circuit.
Time Domain Analysis of RC Circuit – To
7 simulate, understand, and validate Zero-Input
Response of RC Series Circuit
Time Domain Analysis of SECOND ORDER
8 Circuit – To simulate, understand, and validate
Zero-Input Response of RLC Series Circuit
To perform and understand Convolutional
9 Integral (C.I) of two signals using Matlab and
compare it with C.I calculated analytically
To solve Ordinary Differential Equation (ODE)
10 using MATLAB

Open Ended Lab


11 Design and Observe the working of Low Pass
Filter
Open Ended Lab
12 Design and Observe the working of High Pass
Filter
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

➢ Passive Oscilloscope Probe: In passive Oscilloscope probe there are no active components
such as transistors or amplifiers in the probe and therefore passive probes do not need to be
powered.

Probe of an Oscilloscope

Most of the Oscilloscope have at least two input channels and each channel display a waveform on
the screen. Both of the channels are used to compare the waveforms. Digital Oscilloscope has
AUTOSET button, which is used to produce a stable waveform when waveform scale is larger than
the screen scale. During setting up the Oscilloscope make sure the following things are done.

b) Features Explored

1. Vertical Controls

The Vertical control is used to set or modify the Vertical Scale, position and other signal
conditioning for each of the analog input channels. There is a set of vertical controls for each
input channel. These controls are used to scale, position, and modify that channel’s input signal
so it can be viewed appropriately on the oscilloscope display.

2. Horizontal Controls

The horizontal controls are used to scale and position the time axis of the oscilloscope display.
There is a dedicated front-panel control for setting the horizontal scale (time/division) of the
display and another for setting the horizontal position of the displayed signals.

3. Trigger Controls

The trigger defined when a signal is acquired and stored in memory. For a repetitive signal, a
trigger is required to stabilize the display.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

4. Channel Parameters

For selecting channel parameters press CH button, a menu will open. It will have several
more parameters and those parameters can be changed by function keys F1, F2, F3, F4 and
F5.

Coupling: In our case the coupling is the connection from function generator to the
oscilloscope. Input coupling determines which part of the signal is displayed. The coupling
can be set to DC, AC and ground.

i) DC COUPLING: DC coupling allows all the components of input signal. DC


offset will be considered. When using DC coupling, no additional capacitor is added
to filter the signal.

ii) AC COUPLING: AC coupling blocks DC component of the signal, centering the


waveform at 0 volts. If the signal will have any constant value of DC offset then it will move
the waveform upward of origin. AC coupling consists of a capacitor to filter out the DC signal
component from a signal with both AC and DC components. The capacitor must be in series
with the signal. AC coupling is useful because the DC component of a signal acts as a voltage
offset and removing it from the signal can increase the resolution of signal measurements.
AC coupling is also known as capacitive coupling.

iii) GROUND: Ground coupling disconnects the input signal to show where 0 volts is on
the screen, it means no signal will be read at ground. We can easily bring position of signal
or channel to the central reference line or mean after selecting ground.

AC and DC Coupling

Invert: It is used to change the orientation of the voltage signal i.e. negative voltages become
positive and positive voltages become negative.

Probe: It is basically the multiplication factor of the signal. We can multiply our signal by 1, 10 and
100.
THE 1X PROBE: The 1X probes are suitable for low frequency applications, they offer the same
impedance as the oscilloscope which is 1M ohm.
THE 10X PROBE: The 10X probe will reduced our signal by ten it means that the signal entering the
oscilloscope itself is reduced.
THE 100X PROBE: The 100X probes are used when very high voltages are need to be monitored.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Impedance: Every oscilloscope will add a certain impedance to a circuit called the input
impedance which is generally represented as a large resistive impedance of 1Mohm.
Oscilloscope can bear 1MV /1A. If more than 1 ampere current is applied, it can damage the
oscilloscope.

5. Display

Display Characteristics

1. Dots and Vectors: We can represent our waveform in dots and in vectors. Dot
drawing displays the waveform in points form. Vector drawing connects the dot with the
lines.

2. Accumulate: Press the second function button accumulates will be ON. When
accumulate is ON our waveform is recorded continuously on the display. If our waveform is
changing with time then it will show our previous image until accumulate is switched OFF
by pressing the second function button again.

3. Refresh: Refresh is selected by pressing the third function button.

4. Contrast: Contrast is selected by pressing the fourth function button. To increase


the contrast, rotate the VARIABLE knob clockwise and to decrease the contrast rotate the
VARIABLE knob counter clockwise.

5. Grid: Grid is selected by pressing the fifth function button. There are three grid
settings; full, cross and frame. In full grid, the axes and all grid lines are displayed. In cross
grid, only the axes are displayed. In frame grid, no axes and grid lines are displayed.

6. Bandwidth: Oscilloscopes are most commonly used to measure waveforms which


have a defined frequency. The bandwidth of the oscilloscope specifies the range of the
frequencies. Most oscilloscope have a circuit that limits the bandwidth of an oscilloscope.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

By limiting the bandwidth, we can reduce the noise that sometimes appears on the
displayed waveform which results in a cleaner display signal.

6. Cursor

The cursors allow you to get very accurate readings of either time or voltage differences
between different parts of a wave. Its application is in under-damped, over-damped,
critically damped circuits etc.

There are two types of cursors:

1. Horizontal Cursor: It is parallel to x-axis (time axis). It is selected by pressing the


F2 key. There are two horizontal cursors. Select the one you want to move with the
function key and vary it with the help of variable knob. It can be used to obtain voltage
value of small part of a waveform etc.

2. Vertical Cursor: It is parallel to y-axis (voltage axis). It is selected by pressing the


F3 key. There are two vertical cursors. Select the one you want to move with the function
key and vary it with the help of the variable knob. It can be used to obtain peak values,
peak to peak values and other time domain characteristics.

7. Measure

Fig. 1.9: Measure Characteristics

With the help of measure button, we can measure two types of characteristics: Time
characteristics and voltage characteristics.

1. Time Characteristics: -

i. Frequency and Time period: Frequency is defined as the number of cycles in 1 second
while time period is its reciprocal. We can measure frequency and time period of a wave
form with the help of an oscilloscope. It can be selected with the help of function key
parallel to it.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

ii. Duty Cycle: Duty cycle is defined as the percentage of on time to total fundamental time.
It is a property of a square wave. It can be measured through an oscilloscope. It can be
selected with the help of function key parallel to it.

iii. Rise and Fall time: The duration of a wave going from a low point to a high point is
called rise time. It is important when we determine how fast a circuit can respond to
signals. It can be measured through an oscilloscope. It can be selected with the help of
function key parallel to it.

2. Voltage Characteristics: -

i. Amplitude: It is the measure of the magnitude of a signal. There are two types of
amplitudes: Peak voltage and peak to peak voltage. Peak voltage is the measure from 0V to
the peak value. Peak to peak voltage is the measure from negative peak to positive peak. It
can be measured through an oscilloscope. It can be selected with the help of function key
parallel to it.

ii. Maximum and Minimum Voltage: Oscilloscope can tell you exactly how high and low
the voltage of your signal can get. Voltage from peak to peak can be calculated as
Vpp=Vmax-min.

iii. Average and Vrms Voltage: Oscilloscope can measure the mean and root mean square
value of your signal and it can also tell the mean and average value of your signal's
maximum and minimum voltage. Also, Oscilloscope helps to calculate Vamp=Vhigh-Vlow.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Introduction to Function Generator

Analog Function Generator

Control Function Purpose


1. Power Button Turn the Function Generator on and off.
2. Frequency Dial Determines the frequency of the function generator output, within
the range set by the MULTIPLIER buttons.
3. Function Selection Used to select the type of waveform generated as sine, triangle, or
Switches square.
4. Multiplier Buttons Set the frequency range.
5. Duty Cycle Knob Adjusts the range of frequencies that are traversed by each sweep.
6. DC Offset Knob Sets the DC level (and therefore the polarity) of the MAIN OUT
signal.
7. Amplitude Control Adjusts the voltage within the presently selected range.
Knob
8. Output Port It is used to get the desirable output waveform through channel
probes (having impedance of 50 Ω).
9. Voltage Dependent It takes voltage as an input and with the change of voltage its value
Frequency Port changes.
Characteristics of Analog Function Generator
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Analog Function Generator

Control Function Purpose


1. Power Switch Turns the Instrument ON and OFF.
2. Setting adjustment knob Adjust the parameter selected by the other buttons.
3. Sine Wave Selection Selects Sine Wave output.
4. Counter Wave Selection Port Selects Sine wave output.
5. Ramp wave Selection Port Selects ramp (triangle) wave output.
6. Modulation signal output Port Input terminal for external modulation signal.
7. Square wave Selection Port Selects square wave output.
8. Synchronization signal output Provides a signal (Square wave or pulse) that is in
phase with the output signal.
9. Amplitude-offset adjustment Knob to adjust either the signal amplitude or DC offset
voltage.
10. Signal output Output terminal for the function generator signal.
11. Set to counter mode Enables the counter input and displays the frequency
of the input signal on item 4.
12. Change utility settings Adjust frequency sweep start frequency, sweep stop
frequency, and display intensity.
13. Set DC offset Enable the adjustment of the DC voltage added to the
signal output (Control 10).
14. Select Modulation Selects number of modulation, internal AM
modulation, FM modulation deviation, and external FM
modulation.
15. % duty Cycle Adjusts the duty cycle or symmetry of the displayed
waveform.
16. Sweep Turns the frequency sweep mode ON and OFF.
17. Frequency After pressing this button, the adjustment knob
(Control 2) will adjust.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

18. Mode Selects the type of operations: continues output,


trigger repetition rate (sets the interval between the
internal trigger; each trigger signal causes the
generator to output one period), external trigger,
manual trigger (pressing the → button causes one
cycle
to be output), external gated (waveform cycles are
output while the gate signal is above a threshold).
19. Digit Adjustment ← Moves the digit selection left.
20. Digit Adjustment → Moves the digit selection right.
21. Display Shows the function generator’s settings, such as
frequency, amplitude, waveform, etc.

Characteristics of Digital Function Generator

a) Basic Purpose

A function generator is an electronic instrument used to generate different types of electrical


waveforms over a wide range of frequencies.

Setting Up Connections;

Power on the generator and select the desired output signal: square wave, sine wave or triangle
wave. Connect the output leads to an oscilloscope to visualize the output signal and set its
parameters using the amplitude and frequency controls. Attach the output leads of the function
generator to the input of the circuit you wish to test. Attach the output of your circuit to a meter
or oscilloscope to visualize the resulting change in signal.

b) Features Explored

1. DC Offset

DC offset is a mean amplitude displacement from zero. With this utility of function generator, we
can clamp up or down the output wave form. It adds a specific amount of DC voltage to the time-
varying waveform. It basically changes the DC reference level.

DC Offset
Laboratory Session Signals &Systems (EE-231)
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

Introduction to Power Supply

DC Power Supply

Control Function Purpose


1. Power Button Turn the Power Supply on and off.
2. Slave Battery (CH2) Use to connect the source to a circuit provided that the correct
Terminals polarity conventions are obeyed.
3. Master Battery (CH1) Use to connect the source to a circuit provided that the correct
Terminals polarity conventions are obeyed.
4. Output Terminals Used as common power supply.
5. Slave Battery Knobs Used to control voltage and Current given by Slave Battery
6. Master Battery Used to control voltage and Current given by Master Battery.
Knobs
7. CV and CC LED Represent the Constant Voltage and Constant Current mode.
indicators
Characteristics of DC Power Supply

a) Basic Purpose

It is an instrument use to supply electric power to electric loads, also it is used to convert current
draw from electric source to appropriate voltage, current and frequency to power the load because of
this ability power supplies are called electric power converters.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Setting Up Connections;

In power supply, there are 2 independent voltage sources which are internally connected. For
internal connections the buttons are available. These independent sources can be connected in
series and parallel. To achieve higher voltage, these sources are connected in series.

Internal View of Power Supply

b) Features Explored

1. Controlling Current

Two voltage sources are present in a power supply, if we short positive and negative terminals
of anyone of the voltage source we can control the current to maintain the healthy condition of
the circuit. We can set a current by rotating a knob basically we are selecting its input
impedance that how much current we want to flow through the circuit. If the value of current
exceeds the value which we have set our circuit can destroy. To prevent this condition, we short
the two terminals to safe our circuit. At voltage zero we set the maximum value of current
which circuit can bear.

In a voltage source, voltage is controlled but infinite current is drawn. We can use short circuit
method for infinite current. Similarly, in current source we should have controlled current. To
maintain constant current, we need to apply infinite impedance. As impedance becomes infinite
voltage also becomes infinite between terminals. Due to infinite voltage it starts flowing without
any medium because of this device destroys itself that is why we do not have any current
source practically but it can exist in any branch or in any circuit as shown in Fig. 1.17.

Ideal Current Source


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

2. Reference Node

Reference node is a node with maximum number of elements. Generally, grounds have the
most elements and will therefore be chosen as the reference node. The ground of a circuit is
only a reference for the circuit and it is common for the whole circuit. By referencing
everything to a common ground, different circuit components are able to interact with each
other else the connection is supposed to be incomplete due to the reason that a common
reference point is not provided to the circuit.

Reference Node

3. Master and Slave Mode

We can control one battery by another battery, connecting them in parallel combination to act
as Master and Slave. The Fig. 1.15 illustrates the Channel1 as Master and Channel2 as Slave,
connecting these batteries in parallel combination as shown in Fig. 1.19(b), we can have a
control on Channel2(Slave Battery). In series combination of batteries there is no such
controlling or Master and Slave mode exist.

Internal Series Combination Internal Parallel Combination


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

POST LAB ACTIVITY:

Activity: Add two waves of 50Hz and 100Hz.

Procedure:
1. Power the Oscilloscope and function generator. Use two channels of function generator to
generate two signals of 50V, one with a frequency of 100Hz and another with 50Hz.
2. Select Sine wave as input signal by the function generator.
3. Connect two signals in series so that the signals can add.
4. Connect wires to complete the rest of the circuitry.
5. Select the reference node (ground) to which the reference is common to the whole circuit.
6. Connect probes to display the signal on the oscilloscope and use Oscilloscope to align the
signal.
7. Check the insights of the signal on the oscilloscope and use multimeter to verify the voltages
at different nodes.

OBSERVATION

CONCLUSION
Laboratory Session Signals &Systems (EE-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Basic Operations

>> a=2;b=3;c=4; % Initialize some variables


>> a+b %Addition

ans =

>> a-b %Subtraction

ans =

-1

>> a*b %Multiplication

ans =

>> a/b %Division

ans =

0.6667

>> a\b %Inverse

ans =

1.5000

>> a+b-a*c/a\b

ans =

0.5000

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

[Note: All operations can be used as at the same time simultaneous.]


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

Numerical Formats

>> format short % Display only five Digits


>> pi

ans =

3.1416

>> format long % Display upto 15 Digits


>> pi

ans =

3.141592653589793

>> format rat % Replaces number by its closest rational number


>> pi

ans =

355/113

>> format short e % expresses numbers in power of 10


>> pi

ans =

3.1416e+00

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

More on Mathematical Operations

>> sqrt(3) % get square root of given argument

ans =

1.7321

>> 3^(1/2) % Evaluates number for any given power

ans =

1.7321

>> log(1000) %Natural Logarithm

ans =

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

>> log10(1000) %Log to the base 10

ans =

3
>> cos(60*pi/180) %Trigonometric Functions are evaluated with arguments in radians
ans =

0.5000

>> acos(0.5) % Cosine inverse

ans =

1.0472

>> floor(3.3) % Round Toward Negative Infinity

ans =

>> ceil(4.23) % Round Toward Positive Infinity

ans =

>> round(0.5) % Round to the nearest Integer or Decimal

ans =

>> abs(1+i) % Evaluates magnitude of a complex number


ans =

1.4142

>> angle(1+i)*180/pi %Evaluates Angular distance from '+x' axis for 2-D problems

ans =

45

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


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

Introduction to Vectors and its Operations

>> a=[1;2;3] %Initialize a 3-D vector

a=

1
2
3

>> b=[4,5,6] %Initialize a row-vector b

4 5 6

>> a' %Transpose of a vector

ans =

1 2 3

>> c=2*a %Multiplication by a scalar

c=

2
4
6

>> a+2* a % Addition of two vectors

ans =

3
6
9

>> sum(a) % Adds all elements of a vector

ans =

>> prod(b) %Multiply all elements

ans =

120

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


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

start = 0;
final = 1;
increment = 0.2;
x = start: increment: final

>> x = 0 0.2000 0.4000 0.6000 0.8000 1.0000;


Code 01: Generates equally row-vector

• Element wise operation

>> y = x.^2 %Each Element gets squared

y=

0 0.0400 0.1600 0.3600 0.6400 1.0000

>> c = y.*x %Element wise Multiplication

c=

0 0.0080 0.0640 0.2160 0.5120 1.0000 >> d =

y./x %Element wise division

d=

NaN 0.2000 0.4000 0.6000 0.8000 1.0000

>> e = y'*x %Matrix Multiplication

e=

0 0 0 0 0 0
0 0.0080 0.0160 0.0240 0.0320 0.0400
0 0.0320 0.0640 0.0960 0.1280 0.1600
0 0.0720 0.1440 0.2160 0.2880 0.3600
0 0.1280 0.2560 0.3840 0.5120 0.6400
0 0.2000 0.4000 0.6000 0.8000 1.0000

>> f = y*x' % Matrix Multiplication

f=

1.8000

>> length(x) %Count number of elements in a vector

ans =

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

>> max(x) % Find maximum value in vector

ans =

>> min(x) % Find maximum value in vector

ans =

>> sqrt(sum((x.^2))) %Determine magnitude of higher order vector


ans =

1.4832

>> sqrt(((x*x'))) % Alternate method but efficient


ans =

1.4832

>> size(x)

ans =

1 6

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

Introduction to Matrix and its Operations

>> A = [1 2 3;4 5 6;7 8 9] % Learn to initialize Matrix

A=

1 2 3
4 5 6
7 8 9

>> c = A (1,2) % Address element of 1st row and 2nd column


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

>>B=2*A % Multiplication by scalar

B=

2 4 6
8 10 12
14 16 18

>> C = A + B % Matrix Addition C

3 6 9
12 15 18
21 24 27

>> D = A*B' % Matrix Multiplication

D=

28 64 100
64 154 244
100 244 388

>> E = A.*B %Element wise multiplication

E=

2 8 18
32 50 72
98 128 162

>> d = A(:,2) % Access all row but 2nd column

d=

2
5
8

>> e = A(2,:) % Access all columns but second row

e=

4 5 6

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


Laboratory Session Signals &Systems (EE-231)
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 coloured 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-231)
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-231)
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-231)
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

Activity 2:
Difference between a^2, a.^2 & a*a where ‘a’ is any matrix
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 03

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-231)
Department of Electrical Engineering NED University of Engineering and Technology

While plotting in MATLAB one must be careful that a


vector is plotted against a vector and lengths of
vectors must match. Two functions are used for
plotting:
• plot (for CT signals)
• stem (for DT signal)

Plotting in MATLAB
Plot the function y=cos(x) between -π ≤x≤π
Code (write in m file):
clear all;
close all;
clc;
x=-pi:0.001:pi;
y=cos(x);
plot(x,y);
xlabel(‘Time’)
ylabel(‘y=cos(x)’);
legend(‘cos(x)’);
title(‘Graph of cosine waveform’);
grid on;

Exercise: Plot the function e-x/3sin(x) between 0≤x≤4π

Example:
x = 10sinπt
MATLAB Commands:
t = [-2:0.002:2]
x = 10 * sin (pi * t)
plot(t, x)
title(‘Example Sinusoid’)
xlabel(‘time(sec)’)
ylabel(‘Amplitude’)

Multiple Plots:
For drawing multiple signals on the same graph, write first signal’s x and y axis vectors
followed by the next signal.
Syntax:
plot(X1,Y1,…,Xn,Yn)
In order to differentiate them by colors, write line style specifies and color code.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Example
plot (t, y, ’r-’, t, x, ’g-’);
legend (’Sine curve’, ’Cosine
curve’)

Generating Subplots
x=10*sin(-2*pi*t)
y=10*cos(-2*pi*t)
u=10*sin(-5*pi*t)
v=10*cos(-5*pi*t)
t = [-2:0.002:2]
subplot(2, 2, 1), (t, x);
xlabel(’t’),ylabel(‘x’);
subplot(2, 2, 2), plot(t, y);
xlabel(’t’),ylabel(’y’);
\subplot(2, 2, 4), plot(t, u);
xlabel(’t’),ylabel(‘u’);
subplot(2, 2, 3), plot(t, v);
xlabel(’t’), ylabel(’v’);

DT Plots:

Example: Plot the DT


sequences:
n = -6:3;
x = [2, 3, -1, 5, 4, 2, 3, 4, 6, 1];
stem(n, x);

Zero & One Vectors:

To generate zero or one


vectors, use following
statements:
zeros(1, 5)
Output: [0 0 0 0 0]
ones(1, 5)
Output: [1 1 1 1 1]
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Using ‘For loop’ in MATLAB


Also called a do loop in other languages. Used when you want the calculations to be
performed a defined number of times. In MATLAB, a for loop begins with the statement
indicating how many times the statements in the loop will be executed
A counter is defined within this statement.

Example: for k = 1:100


(counter = k, the loop will be executed 100 times)
for i = 1:2:7
(counter = i, the counter will be incremented by a value of 2 each time until its value
reaches 7. Therefore, the loop will be executed 4 times (i = 1,3,5, and 7)

The loop ends with an end statement


In M-files, the MATLAB editor will automatically indent text between the for and end
statements.

Procedural Programming in MATLAB:


In MATLAB we can do procedural programming using the same constructs as in C/C++.
Looping Constructs in MATLAB:
a) while-loop

while(termination condition)
statement1
statement2
statement3
end
b) for-loop
for var=startvalue: step : endvalue
statement1
statement2
statement3
end

Using for Loops:


We will use for loops extensively in MATLAB, use of while loop will be seldom.
◼ In MATLAB, a for loop begins with the statement indicating how many times the
statements in the loop will be executed

◼ A counter is defined within this statement

◼ Examples:

for k = 1:100
(counter = k, the loop will be executed 100 times)
for i = 1:2:7
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

(counter = i, the counter will be incremented by a value of 2 each time until its value
reaches 7. Therefore, the loop will be executed 4 times (i = 1,3,5, and 7)
◼ The loop ends with an end statement

◼ In M-files, the MATLAB editor will automatically indent text between the for and end
statements:

Can you determine what the variable x will be after running this M-file?
Explanation of the loop run:
◼ The first time through the loop, j = 1

◼ Because of the single value in parentheses, x will be a one-dimensional array

◼ x(1) will be set equal to 5*1 = 5

◼ The second time through the loop, j = 2

◼ x(2) will be set equal to 5*2 = 10

◼ This will be repeated until j = 10 and x(10) = 50

◼ x will be a one-dimensional array (a row matrix) with 10 elements:

Loops in the Command Window:


◼ Loop commands can be entered directly from the command prompt

◼ The calculations are not performed until the end statement is entered

◼ Remember that if you leave off the semi-colon, the results of the calculations will be
written to the screen in every loop:
Laboratory Session Signals &Systems (EE-231)
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-231)
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-231)
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-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 03

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-231)
Department of Electrical Engineering NED University of Engineering and Technology

▪ Numerical models of Exponential Signals with Real Power


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

>> t = 0 : 0.001 : 0.8;


>> y3 = exp(-2*t); % Developing real numerical model of simple decaying exponential signal
>> plot(t,y3),xlabel('Time'),ylabel('f(t)'),title('f(t)=\ite^{-2t}'). grid on; % plots real decaying exponential signal
>> y4 = exp(2*t); % Developing real numerical model of simple oscillatory exponential signal
>> plot(t,y4),xlabel('Time'),ylabel('f(t)'),title('f(t)=\ite^{2t}'), grid on; % plots real rising exponential signal

OBSERVATION

>> t = 0 : 0.001 : 0.8;


>> 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-231)
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

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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Basic Operations and Manipulation of Signals


i) Multiplying fundamental signal with itself

>> F = 1; % setting fundamental frequency


>> instants = 1000;
>> t = 0:1/(instants*F):1/F;
>> y1 = sin(2*pi*F*t); % generates fundamental signal
>> plot(t,y1.*y1); % plots the signal multiplied by itself
>> area(t,y1.*y1); xlim([0 1]); %area under the curve of the plot
Code 06: Plotting the product of fundamental signal with itself using MATLAB

OBSERVATION

ii) Multiplying signal with second harmonically related signal

>> F = 1; % setting fundamental frequency


>> instants = 1000;
>> t = 0:1/(instants*F):1/F;
>> y1 = sin(2*pi*F*t); % generates fundamental signal
>> y2 = sin(2*pi*2*F*t); % generates second harmonic signal
>> plot(t,y1.*y2); % plots the signal multiplied by second harmonic signal
>> area(t,y1.*y2); xlim([0 1]); %area under the curve of the plot
Code 07: Plotting the product of fundamental signal with second harmonic signal using MATLAB

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

iii) Multiplying cosine signal with sine signal of same frequency

>> F = 1; % setting fundamental frequency


>> instants = 1000;
>> t = 0:1/(instants*F):1/F;
>> y3 = cos(2*pi*3*F*t); % third harmonic cosine signal
>> y4 = sin(2*pi*3*F*t); % third harmonic sine signal
>> plot(t,y3.*y4); % plots the signal multiplied by sine and cosine signal with same frequency
>> area(t,y4.*y5); xlim([0 1]); %area under the curve of the plot
Code 08: Plotting the product of sine signal and cosine signal with same frequency using MATLAB

OBSERVATION

iv) Multiplying cosine signal with sine signal of different frequency

>> F = 1; % setting fundamental frequency


>> instants = 1000;
>> t = 0:1/(instants*F):1/F;
>> y1 = sin(2*pi*F*t); % fundamental sine signal
>> y3 = cos(2*pi*3*F*t); % third harmonic cosine signal
>> plot(t,y3.*y1); % plots the signal multiplied by sine and cosine signal with different frequency
>> area(t,y3*y1); xlim([0 1]); %area under the curve of the plot
Code 09: Plotting the product of sine signal and cosine signal with different frequency using MATLAB

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

Basic circuit models on Simulink

Analyzing the RC response.

PROCEDURE

For basic circuit model on Simulink we use Simcscape and its sub-libraries, power systems library
is most frequently used. All the required components can be find out in the libraries. The sample
model is shown in Fig. 3.14.

Libraries Power System Library

Searching the required components from the tool bar as shown in fig. 3.11. RLC branches,
PowerGUI, Step, Controlled Voltage source, Multimeter, Scope. This search may reduce our work
and search throughout all the sub-libraries.

Component Searching

BLOCK PARAMETERS

The basic parameters of branches can be changed by simply double clicking on them as shown in
figure below. It sets the value for RLC and also sets initial and final value of storing elements
(C,L). Voltage and current response can also be measured by using multimeter.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Block parameters of resistor Block parameters of capacitor

SOLVER SELECTION

1. Ode 45 solver:
It works on the numerical method called R-K method. It selects a step size at the beginning of
a response and plots the whole response with the same step size regardless of the changing
differences between the values.

2. Ode 23 solver:
It is the most suitable solver for ODEs as it adjusts its step size according to the responses
changing with respect to time. It is a dynamic solver.

Configuration Parameters Window

[Note: We prefer “ode23tb” over “ode45tb” for fast simulation and more accurate result.]
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Sample Model

OBSERVATION

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

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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-231)
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


Laboratory Session Signals &Systems (EE-231)
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.

MATLAB CODE

OBSERVATIONS

CONCLUSION
Laboratory Session Signals &Systems (EE-231)
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).

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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

It can also be defined as the integral of the unit step function.

4. Sinc Function:
The sinc function , also called the "sampling function," is a function that arises
frequently in signal processing and the theory of Fourier transforms. The full name of
the function is "sine cardinal," but it is commonly referred to by its abbreviation,
"sinc."

This has the normalization


Laboratory Session Signals &Systems (EE-231)
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-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Series RC circuit

The Fig. 5.1 shows a resistor (R) in series with a capacitor (C) forming a series RC Circuit
connected to a function generator that gives a square wave of peak to peak voltage. The
output of this simulink model is shown in Fig.5.2 (as shown below).

Series RC circuit response [ v(t) vs t]


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

RC time constant:

The capacitor will charge up gradually through the resistor until the voltage across the
capacitor reaches that of the supplied voltage. The transient response required for the
capacitor to fully charge is equivalent to about 5-time constants or 5τ.

𝜏 = 𝑅𝐶 = (1.8x1000)(1x10−6 )
𝝉 = 𝟏. 𝟖𝒎𝒔 (Transient response)

In our time delay circuit, we would like to observe the complete charging and discharging
of the capacitor this is why we selected the elemental values carefully for a time constant of
1.8ms. As the time required by a capacitor to fully charge or discharge is approximately
equal to 5τ, we will setup the function generator to produce a square wave of 5VPP with
ON time and OFF time both of 5τ = 9ms or greater than that, setting frequency f = 30 Hz.
∵ T = 1/f = 1/30 = 33ms

Since, the time period of square wave is 33ms > 18 ms (i.e. 10 τ) which implies that the RC
response can be easily observed for this input. However, the circuit impedance should be
high for an input of low frequency otherwise the input waveform will be deformed. For the
circuit in Fig. 5.1 the total impedance is;

Z = R + 𝑋 = 7.105kΩ

ANALYSIS OF RC RESPONSE

The total RC response is given by:

Total response = natural response + forced response

a) Natural Response
In RC circuit, natural response is the system's response to initial conditions with all
external independent voltage sources set to zero volts (short circuit).

Fig. 5.3. Series RC circuit for zero input condition


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

Apply KCL at node “a” in Fig.5.3;

Integrating;

Taking exponentials both sides,

Where, Vo is the initial voltage stored in capacitor at the instant of discharging i.e. t=0.
This shows that the natural response of an RC circuit is an exponential decay of its initial
voltage.

For the desired circuit, V0 = 5 and τ = 1.8ms.

b) Forced Response
The forced response is the system's response with source turned on but with the initial
conditions set to zero. The forced response of a circuit is its behavior for a long time after
the excitation is applied.

Fig. 5.4. Series RC circuit when voltage source is connected

Applying KCL at node A in Fig. 5.4;

Integrating;
Laboratory Session Signals &Systems (EE-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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 OFSYSTEM:

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-231)
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: V c(0) = y(0) = 5V

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

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

Time (t) Observed Observed Calculated Calculated Remarks


Value y(t) %age y(0) Value y(t) % of y(0)
t = 1.T
t = 2.T
t = 3.T
t = 4.T
t = 5.T
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

POST LAB ACTIVITY:

Activity 1: Simulate RL Circuit using Simulink. Assume the values of each element

Activity 2: Calculate Time Constant and draw the graph of current through inductor

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
t = 2.T
t = 3.T
t = 4.T
t = 5.T
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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,
𝑅
𝜏=
𝐿
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Where R is the resistance of the circuit, C is the capacitance, and L is inductance of the circuit.

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.

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

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
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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-231)
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
Laboratory Session Signals &Systems (EE-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
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-231)
Department of Electrical Engineering NED University of Engineering and Technology

Matlab Script:

POST-LAB ACTIVITIES

Activity 1:

Solve a differential equations solved examples from B.P. Lathi’s book suggested in your course using
this command and compare it with analytical solutions.
(Write example equation, Matlab expression and fill following table)

Example No. Differential Equation Analytical Solution Remarks

Plot the solution using Matlab

Activity 2: Explore the command ‘ODE solver’ and use it in the solving of differential equation to
achieve complete response choosing any solved examples from your textbook.
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 11

Objective:

Design and Observe the working of Low Pass Filter

Theory:

LOW PASS FILTER

A low-pass filter (LPF) is a filter that passes signals with a frequency lower than a selected cutoff
frequency and attenuates signals with frequencies higher than the cutoff frequency. The
exact frequency response of the filter depends on the filter design. The filter is sometimes called a high-
cut filter, or treble-cut filter in audio applications.

RC FILTER

A simple RC low-pass filter circuit consists of a resistor in series with a load, and a capacitor in parallel
with the load. The capacitor exhibits high reactance at low frequencies, and hence forcing lo the load
instead. At higher frequencies the reactance drops, and the capacitor effectively functions as a short
circuit. The combination of resistance and capacitance gives the time constant of the filter
𝝉 = 𝑹𝑪
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

This circuit may be understood by considering the time the capacitor needs to charge or discharge
through the resistor:

o At low frequencies, there is plenty of time for the capacitor to charge up to practically the same
voltage as the input voltage.
o At high frequencies, the capacitor only has time to charge up a small amount before the input
switches direction. The output goes up and down only a small fraction of the amount the input
goes up and down. At double the frequency, there's only time for it to charge up half the amount.

CUT OFF FREQUENCY:

A cutoff frequency, corner frequency, or break frequency of a low-pass filter is a boundary in a


system's frequency response at the gain of the system starts to decrease.

It is determined by the time constant:


𝟏
𝒇=
𝟐𝝅𝝉
GAIN
Gain is the ration of output voltage to input voltage

𝑽𝒐𝒖𝒕
𝑮𝒂𝒊𝒏 =
𝑽𝒊𝒏
Activity 1:

You are given a Cut off frequency. Choose your components accordingly such that when you make
observations, the gain starts to drops when frequency of sinusoidal input (from function generator)
increases the cut off frequency. The cut off frequency is your roll number if it’s one digit, roll number / 2
if it’s 2 digit and below 40, if two digit and between 40 and 60, it is roll number /3. The frequencies
should be from 5 hertz to 20 hertz. Choose your own formula if you have bigger roll numbers. You may
also choose cut off frequencies higher that 20 Hz if supported by function generator and you can get the
components accordingly. Plot the graph, Frequency Vs Gain.

Frequency Gain(Vout/Vin) Remarks


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

Graph Frequency Vs Gain


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

Outcome Based Education System


Department of Electrical Engineering
NED University of Engineering and Technology
Title of
Evaluation# Evaluator’s Name
Lab:

Name of Student Roll No.


Laboratory Rubrics

Criteria 25% (Poor) 70% (Good) 100% (Excellent) Total


Set-up of • Set-up of equipment is not • Set-up of equipment is • All equipment accurately
Equipment accurate, help is required generally workable with placed
and Safety with several major details several details that need • Very neat and organized
• Lacks the appropriate refinement • Demonstrates very good
(20%)
knowledge of the lab • Demonstrates general knowledge of the lab
procedures knowledge of lab procedures
• Often requires help from the procedures • Gladly helps other students
teacher to even complete • Requires help from teacher to follow procedures
basic procedures with some steps in • Thoroughly and carefully
• Proper safety precautions procedures follows each step before
Or are consistently missed • Proper safety precautions moving on to next step
are generally used • Proper safety precautions
Development are consistently used
Of • Unable to develop correct • Require some help in • Independently develops and
Algorithm/ code/Simulation developing code/Simulation implements correct
• Often takes help from • Follows most of the steps code/simulation
Simulation
instructor or other students told by the instructor • Gladly helps other students
(20%) • Thoroughly and carefully
follows procedures told by
the instructor
Data • Measurements are • Measurements are mostly • Measurements are both
Collection, incomplete/inaccurate accurate accurate and precise
Analysis and • Observations are incomplete • Observations are generally • Observations are very
or not included complete thorough and may recognize
Observations
• Symbols, units and • Work is organized possible errors in data
(30%) significant figures are not • Only 2 or 3 minor errors collection
included using symbols, units and • Work is neat and organized
• Unable to relate lab’s scope significant digits • Includes appropriate
with the theoretical • Knows fundamental ideas symbols, units and
concepts related to theory significant digits
• Able to relate results clearly
with the theory
Lab Report • Many observations are not • Few observations are missed • Well written and organized
reported however report covers • All relevant observations
(50%) • Contents are not organized overall objective of the lab are reported and results are
• Results are not discussed session thoroughly assessed.
• Submitted late • Minor mistake in • Results are discussed
organization of the contents • Submitted before the
• Results are briefly discussed deadline
• Submitted by the deadline
Penalties 1) Submitted copied lab report (50%)
2) Not wearing proper attire in the lab (20%)
3) Not obeying technician/demonstrator’s instructions (20%)
4) Eating/drinking in the lab (20%)
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

Laboratory Session No. 12

Objective:

Design and Observe the working of High Pass Filter

Theory:

HIGH PASS FILTER:

A ligh-pass filter (HPF) is a filter that passes signals with the frequencies higher than a
selected cutoff frequency and attenuates signals with frequencies lower than the cutoff
frequency. The exact frequency response of the filter depends on the filter design. The filter
is sometimes called a Low-Cut Filter in audio applications.

RC FILTER:

A simple RC high-pass filter circuit consists of a resistor in series with a capacitor and
the load. The capacitor exhibits low reactance for high frequencies reactance in series and
blocks them. It exhibits low reactance for high frequency signals, forcing them through the
load instead. At higher frequencies the reactance drops, and the capacitor effectively
functions as a short circuit. The combination of resistance and capacitance gives the time
constant of the filter
𝝉 = 𝑹𝑪
Laboratory Session Signals &Systems (EE-231)
Department of Electrical Engineering NED University of Engineering and Technology

CUT OFF FREQUENCY:


A cutoff frequency, corner frequency, or break frequency of a high pass filter is the
frequency after which the gain of the system starts to increase.

𝟏
𝒇=
𝟐𝝅𝝉

GAIN
Gain is the ration of output voltage to input voltage

𝑽𝒐𝒖𝒕
𝑮𝒂𝒊𝒏 =
𝑽𝒊𝒏

Activity 1:

You are given a Cut off frequency. Choose your components accordingly such that when
you make observations, the gain starts to drops when frequency of sinusoidal input (from
function generator) is less than cut off frequency.
The cut off frequency is your roll number if it’s one digit, roll number / 2 if it’s 2 digit and
below 40, if two digit and between 40 and 60, it is roll number /3. The frequencies should
be from 5 hertz to 20 hertz. Choose your own formula if you have bigger roll numbers. You
may also choose cut off frequencies higher that 20 Hz if supported by function generator
and you can get the components accordingly.

Frequency Gain(Vout/Vin) Remarks


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

Graph Frequency Vs Gain

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy