SS Lab Manual
SS Lab Manual
SS Lab Manual
LAB MANUAL
Subject – Signals and Systems Lab
Subject code: 204195
Class – SE
1
Signals and Systems Lab Manual
Program Outcomes
1. Engineering Knowledge: Apply the knowledge of mathematics, science, engineering fundamentals and E&TC engineering specialization
to the solution of complex E&TC engineering problems
PO1.a – Apply the knowledge of mathematics
PO1.b – Apply the knowledge of science
PO1.c – Apply the knowledge of engineering fundamentals
2. Problem Analysis: Identify and analyze complex engineering problems using first principles of mathematics, natural sciences, and E&TC
engineering science
PO2.a – Identify the engineering problem
PO2.b – analyze the engineering problem
PO3.c – reaching the conclusion for the problem
3. Design /development of Solution: Design solutions for E&TC engineering problems and design system components for real life
PO3.a – Design solution for engineering problems
PO3.b – Design system components for real life solution
4. Conduct investigations of complex problems: Use Engineering knowledge for analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO4.a – analysis of data
PO4.b – Interpretation of data
PO4.c – synthesis of data for valid conclusion
5. Modern tool Usage: select and apply appropriate techniques, using IT tools to model E&TC engineering problems with an understanding
of the limitations.
PO5.a – Select and apply appropriate technique
PO5.b – knowledge of various IT tools
PO5.b – Use IT tools to model E&TC engineering problems
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural
issues and the consequent responsibilities relevant to the professional E&TC engineering practice.
PO6.a – ability to identify the problem
PO6.b – assess the problem
PO6.c – apply the engineering solution
7. Environment and sustainability: Understand the impact of the E&TC engineering solutions in societal and environmental contexts, and
demonstrate the knowledge of, and need for sustainable development.
PO7.a – understand the impact of E&TC engineering solutions
PO7.b – demonstrate the knowledge for sustainable development
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the E&TC engineering practice.
PO8.a – have awareness of ethical principles
PO8.b - be committed to professional ethics
9. Individual and team work: Function effectively as an individual , and as a member or leader in a team
PO9.a – ability to function effectively as an individual
PO9.b – ability to function as a leader in a team
10. Communication: Communicate effectively ,comprehend and write effective reports and make effective presentations
PO10.a – ability to communicate effectively
PO10.b – ability to comprehend and write effective reports
PO10.c – ability to make effective presentations
11. Project management and finance: Have knowledge and understanding of the E&TC engineering and management principles and apply
these to one’s own work, as a member and leader in a team, to manage projects
PO11.a – Ability to have the knowledge and understanding of Engineering and Management principles
PO11.b – apply managerial skills effectively as a leader
PO11.c – Apply the E&TC engineering skills as a team member
12. Life-long learning: Ability of self-education and understand the technological changes PO12.a – Inculcate the habit of self-learning and
understanding
PO12.b – ability to adapt to technological changes
2
Signals and Systems Lab Manual
Vision:
Mission:
1. To equip students with strong basics through excellent blend of theory and
practical knowledge
2. To inculcate creativity and innovation through curricular and co-curricular
activities
3. To give the knowledge about all possible areas of E&TC by interacting with
professional world
4. To develop the students with communication skills and ethical standards to
meet the professional needs
PSOs:
The E&TC engineering graduates should be able to
PEOs:
1) The graduate shall utilize the basic knowledge to address the Engineering
problems
2) The graduate shall attain the qualities of professional leadership with ethical
and moral standards
3) The graduate shall develop their capabilities for lifelong learning throughout
their professional career and higher education
4) The graduate shall explore engineering capabilities through creativity and
innovation.
3
Signals and Systems Lab Manual
Course Outcomes:
University SAR
course course COURSE OUTCOMES
Code code
C405.4 Apply Root locus, Nyquist plot and Bode Plot technique to analyze
control system.
C405.2 CO2 2 1 - 1 2 - - - 1 1 - 1
204195
C405.3 CO3 2 1 - 1 2 - - - 1 1 - 1
C405.4 CO4 2 1 - 1 2 - - - 1 1 - 1
2 1 - 1 2 - - - 1 2 - 1
CO PSO Mapping:
C405.1 2 1 1
C405.2 2 1 1
C405.3 2 1 1
C405.4 2 1 1
4
Signals and Systems Lab Manual
Practical / Oral:
Practical / Oral is to be conducted and assessed jointly by internal and external examiners. The
performance in the Practical / Oral examination shall be assessed by at least one pair of examiners
appointed as examiners by the Savitribai Phule Pune University. The examiners will prepare the
mark / grade sheet in the format as specified by the Savitribai Phule Pune University and
authenticate it.
• Students are not allowed to touch any equipment or other materials in the laboratory until they are
instructed by Teacher or Technician.
• All the experiments mentioned in the syllabus are compulsory.
• Use of open source software and recent version is to be encouraged.
5
Signals and Systems Lab Manual
• Journal consists of Certificate, table of contents, and handwritten write-up for each experiment.
• Each experiment should consist of:
✔ Assignment No
✔ Title of Assignment
✔ Date of Performance
✔ Date of Submission
✔ Aims & Objectives
✔ Theory
✔ Description of data used
✔ Results
✔ Conclusion.
• Each lab assignment/ experiment assessment will assign grade / marks based on parameters with
appropriate weightage.
• Suggested parameters for overall assessment as well as each lab assignment / experiment
assessment include:
✓ Timely completion.
✓ Performance.
• The parameters for assessment are to be known to the students at the beginning of the course
6
Signals and Systems Lab Manual
INDEX
EXP.
List of Laboratory Experiments / Assignments
NO.
Generate and plot the following signals in time domain and also sketch its amplitude and phase
spectrum. Verify the result:
∙ Impulse
∙ Unit Step
1 ∙ Exponential
∙ Unit ramp
∙ Sinc
∙ Rectangular
∙ Sinc
∙ Rectangular
Write the codes to plot the following signals also simulate the signal
2(a)
2(b)
Develop codes to simulate, and plot the results for an exponential signal: x(t) = k e−at u(t)
for the cases: (a) k = 1, and a = 0.35 (b) k = 1.2 and a = −0.45
The music signal has frequency components in the audio frequency range 20 Hz to 20000 Hz of the
5 electromagnetic spectrum. Record or use the recorded music samples of different instruments (at
least four) and Write a program to record the music signal and sketch it in time domain, its
amplitude spectrum and phase spectrum. Also comment on the result.
6 Find the convolution integral of Unit step and exponential signals and write a program to
sketch the out response of the system. Also verify the commutative property of convolution Sum.
7
Signals and Systems Lab Manual
Take any one periodic signal and find its Fourier series coefficients using exponential or
7 Trigonometric FS method. Write a program to find its Fourier series coefficients. Also using
FS coefficients, reconstruct the signal. Observe the effect of Gibb‟s phenomenon.
Experiment No. 1
Title: Generate and plot the following signals in time domain and also sketch its amplitude and
phase spectrum. Verify the result:
∙ Impulse
∙ Unit Step
∙ Exponential
∙ Unit ramp
∙ Sinc
∙ Rectangular
Objectives:
Theory:
Definition of Signal:
Any time varying physical phenomenon that can convey information is called signal. Some
examples of signals are human voice, electrocardiogram, sign language, videos etc. There are
several classification of signals such as Continuous time signal, discrete time signal and digital
signal, random signals and non-random signals.
Continuous-time Signal:
A continuous-time signal is a signal that can be defined at every instant of time. A continuous-time
signal contains values for all real numbers along the X-axis. It is denoted by x(t). Figure 1(a) shows
continuous-time signal.
8
Signals and Systems Lab Manual
Discrete-time Signal:
Signals that can be defined at discrete instant of time is called discrete time signal. Basically
discrete time signals can be obtained by sampling a continuous-time signal. It is denoted
as x(n).Figure 1(b) shows discrete-time signal.
Digital Signal:
The signals that are discrete in time and quantized in amplitude are called digital signal. The term
"digital signal" applies to the transmission of a sequence of values of a discrete-time signal in the
form of some digits in the encoded form.
Impulse:
t=-10:1:10;
y=[zeros(1,10),ones(1,1),zeros(1,10)];
subplot(2,1,1);
plot(t,y)
xlabel("time t");
ylabel("Amplitude");
title('continuous impulse signal');
t=-10:1:10;
y=[zeros(1,10),ones(1,1),zeros(1,10)];
subplot(2,1,2);
stem(t,y)
xlabel("time n");
ylabel("Amplitude");
title('discrete impulse signal');
9
Signals and Systems Lab Manual
close all;
clc;
N=20;
t=0:1:N-1;
y=ones(1,N);
subplot(2,1,1);
plot(t,y);
title("Continuous Unit step signal")
xlabel("time,t")
ylabel("Amplitude")
disp(y);
10
Signals and Systems Lab Manual
t=0:1:N-1;
y=ones(1,N);
subplot(2,1,2);
stem(t,y);
title("Discrete Unit step signal")
xlabel("time,n")
ylabel("Amplitude")
disp(y);
Exponential signal:
% Continuous Exponential signal
% Parthiv (03)
t=-2:0.5:10;
y=exp(-t/2);
subplot(2,1,1);
plot(t,y);
title("Continuous time exponential signal")
xlabel("time,t")
ylabel("Amplitude")
11
Signals and Systems Lab Manual
t=-2:0.5:10;
y=exp(-t/2);
subplot(2,1,2);
stem(t,y);
title("Discrete time exponential signal")
xlabel("time,n")
ylabel("Amplitude")
t=0:2:50;
subplot(2,1,1);
plot(t,t)
title("continuous time ramp signal")
xlabel("time,t")
ylabel("Amplitude")
axis tight
12
Signals and Systems Lab Manual
subplot(2,1,2);
stem(t,t)
title("Discrete time ramp signal")
xlabel("time,n")
ylabel("Amplitude")
axis tight
Sinc signal:
t=-100:1:100;
y=4*sin(50*t)./(50*t);
subplot(2,1,1)
plot(t, abs(y));
title("continuous sinc signal")
xlabel("time t")
ylabel("Amplitude")
13
Signals and Systems Lab Manual
subplot(2,1,2 )
stem(t,abs(y));
title("Discrete sinc signal")
xlabel("time n")
ylabel("Amplitude")
Rectangular signal:
clc;
fs=1000;
t=-1:1/fs:1;
a=rectpuls(t);
subplot(2,1,1);
plot(t,a)
xlabel('time t')
ylabel('Amplitude')
title('Continuous Rectangular signal')
14
Signals and Systems Lab Manual
subplot(2,1,2);
stem(t,a);
xlabel('time n')
ylabel('Amplitude')
title('Discrete Rectangular signal')
Conclusion:
15
Signals and Systems Lab Manual
Objectives:
Theory:
Time-Shifting of Signal:
In signals and system amplitude scaling, time shifting and time scaling are some important
properties. If a continuous time signal is defined as x(t) = s(t - t1). Then we can say that x(t) is the
time shifted version of s(t).
Consider a simple signal s(t) for 0 < t < 1
Fig.(a) Signal within 0< t < 1 Fig.(b) Signal shifted by 2 sec. Fig.(c) Signal shifted by -1 sec.
Now shifting the function by time t1 = 2 sec.
x(t) = s (t-2) = t-2 for 0 < (t - 2) < 1;
= t-2 for 2 < (t - 2 ) < 3
Which is simply signal s(t) with its origin delayed by 2 sec.
Now if we shift the signal by t1 = -1 sec.
then x(t) = s (t+1) = t+1 for 0 < (t+1)
= t+1 for -1 < t < 0.
Which is simply s(t) with its origin shifted to the left or advance in time by 1 seconds. This time-
shifting property of signal is shown in the Figure (a), (b) and (c) given above.
16
Signals and Systems Lab Manual
MATLAB Code:
close all;
clear;
t=0:0.00005:0.05;
f=200;
xt=sin(2*pi*f*t);
subplot(2,1,1)
plot(t,xt)
xlabel('Time Index')
ylabel('Amplitude')
title('Original Sine Signal')
t=0:0.00005:0.05;
f=200;
z=sin(2*pi*f*t);
subplot(211)
z1=sin(2*pi*f*t-pi/6);
plot(t,z,t,z1)
xlabel('Time index')
ylabel('Amplitude')
title('sine and (sine with -pi/6) on the same plot')
t=0:0.00005:0.05;
f=200;
a=sin(2*pi*f*t);
subplot(211)
a1=sin(2*pi*f*t+pi/6);
plot(t,a,t,a1)
xlabel('Time index')
ylabel('Amplitude')
title('sine and (sine with +pi/6) on the same plot')
17
Signals and Systems Lab Manual
18
Signals and Systems Lab Manual
close all;
clear;
t=0:0.00005:0.05;
f=200;
xt=cos(2*pi*f*t);
subplot(2,1,1)
plot(t,xt)
xlabel('Time Index')
ylabel('Amplitude')
title('Original Cosine Signal')
t=0:0.00005:0.05;
f=200;
z=cos(2*pi*f*t);
subplot(211)
z1=cos(2*pi*f*t-pi/6);
plot(t,z,t,z1)
xlabel('Time index')
ylabel('Amplitude')
title('cosine and (cosine with -pi/6) on the same plot')
t=0:0.00005:0.05;
f=200;
a=cos(2*pi*f*t);
subplot(211)
a1=cos(2*pi*f*t+pi/6);
plot(t,a,t,a1)
xlabel('Time index')
ylabel('Amplitude')
title('cosine and (cosine with +pi/6) on the same plot')
19
Signals and Systems Lab Manual
Conclusion:
20
Signals and Systems Lab Manual
Objectives:
● To understand different types of exponential signals
● To plot various forms of exponential signals
Theory:
Real and Complex Exponential Signal:
Exponential signal is of two types. These two type of signals are real exponential signal and
complex exponential signal which are given below.
Real Exponential Signal:
A real exponential signal is defined as
Where both "A" and "σ" are real. Depending on the value of "σ" the signals will be different.
If "σ" is positive the signal x(t) is a growing exponential and if "σ" is negative then the signal x(t) is
a decaying exponential. For σ=0, signal x(t) will be constant. Figure 1(a), 1(b) and 1(c) shows a dc
signal, exponentially growing signal and exponentially decaying signal respectively.
Fig.1(a) A dc signal Fig.1(b) Exponentially growing signal Fig.1(c) Exponentially decaying signal
Complex exponential Signal:
The complex exponential signal is given by
Therefore
........................(1)
Using Eulers identity
...............................(2)
Substituting eqn.(2) in eqn.(1) we have
A complex exponential signal can not be plot in a two dimensional (2D) graph, it should be plot in
a three dimensional graph. Figure given below shows the three dimensional view of a complex
exponential signal.
21
Signals and Systems Lab Manual
Real sines and real cosines can be expressed by the combinations of complex sinusoids through the
trigonometric identities
and
Fig.11(c)Real cosine after addition of complex sinusoids Fig.11(d) Real sine after subtraction of
complex sinusoids
22
Signals and Systems Lab Manual
MATLAB Code:
% Exponentially decaying signal
% Parthiv (03)
close all;
a=0.35;
k=1;
t=0:0.05:50;
x=k*exp(-a*t);
subplot(2,1,1)
plot(t,x)
xlabel('Time Index')
ylabel('Amplitude')
title('Exponentially Decaying Signal')
a=0.45;
k=1.2;
t=0:0.05:50;
x=k*exp(a*t);
subplot(2,1,2)
plot(t,x)
xlabel('Time Index')
ylabel('Amplitude')
title('Exponentially Growing Signal')
23
Signals and Systems Lab Manual
Conclusion:
24
Signals and Systems Lab Manual
Experiment No. 3
Title: Sampling & Aliasing
Consider various human voice / speech (probably your voice both male and female) or music
signals. Try different sampling rates and observe the effect of aliasing.
Objectives:
Theory:
Sampling:
A continuous time signal can be processed by processing its samples through a discrete time
system. For reconstructing the continuous time signal from its discrete time samples without any
error, the signal should be sampled at a sufficient rate that is determined by the sampling theorem.
25
Signals and Systems Lab Manual
Aliasing:
In reconstructing a signal from its samples, there is another practical difficulty. The sampling
theorem was proved on the assumption that the signal x(t) is bandlimited. All practical signals are
time limited, i.e., they are of finite duration. As a signal cannot be timelimited and bandlimited
simultaneously. Thus, if a signal is timelimited, it cannot be bandlimited and vice versa (but it can
be simultaneously non timelimited and non bandlimited). Clearly it can be said that all practical
signals which are necessaily timelimited, are non bandlimited, they have infinite bandwidth and the
spectrum X'(f) consists of overlapping cycles of X(f) repeating every fs Hz (sampling frequency).
Because of infinite bandwidth, the spectral overlap will always be present regardless of what ever
may be the sampling rate chosen. Because of the overlapping tails, X'(f) has not complete
information about X(f) and it is not possible, even theoretically to recover x(t) from the sampled
26
Signals and Systems Lab Manual
signal x'(t). If the sampled signal is passed through an ideal lowpass filter, the output is not X(f) but
a version of X(f) distorted as a result of some causes:
The loss of the tail of X(f) beyond |f | > fs/2 Hz.
The reappearance of this tail inverted or folded onto the spectrum. The spectra cross at
frequency fs/2 = 1/2T Hz. This frequency is called the folding frequency. The spectrum folds onto
itself at the folding frequency. For instance, a component of frequency (fs/2)+ fx shows up as or act
like a component of lower frequency (fs/2)- fx in the reconstructed signal. Thus the components of
frequencies above fs/2 reappear as components of frequencies below fs/2. This tail inversion is
known as spectral folding or aliasing which is shown in Fig. 5. In this process of aliasing not only
we are losing all the components of frequencies above fs/2 Hz, but these very components reappear
as lower frequency components. This reappearance destroys the integrity of the lower frequency
components.
27
Signals and Systems Lab Manual
MATLAB Code:
% Sampling theorem (80 Hz)
% Parthiv (03)
close all;
t=0:0.00005:0.5;
points=length(t);
x2=sin(2*pi*50*t);
subplot(3,1,1)
plot(t,x2,'r')
xlabel('Time Index')
ylabel('Amplitude')
title('Time Domain Wave')
n=0:1/80:0.5;
xn=sin(2*pi*50*n);
subplot(3,1,2)
stem(n,xn,'b*-')
xlabel('Time Index')
ylabel('Amplitude')
title('Time Domain Wave with 80 Hz')
subplot(3,1,3)
plot(t,x2,'r',n,xn,'b*-')
xlabel('Time Index')
ylabel('Amplitude')
title('CT and DT Signal on same graph')
28
Signals and Systems Lab Manual
close all;
t=0:0.00005:0.5;
points=length(t);
x2=sin(2*pi*50*t);
subplot(3,1,1)
plot(t,x2,'r')
xlabel('Time Index')
ylabel('Amplitude')
title('Time Domain Wave')
n=0:1/200:0.5;
xn=sin(2*pi*50*n);
subplot(3,1,2)
stem(n,xn,'b*-')
xlabel('Time Index')
ylabel('Amplitude')
title('Time Domain Wave with 200 Hz')
subplot(3,1,3)
plot(t,x2,'r',n,xn,'b*-')
xlabel('Time Index')
ylabel('Amplitude')
title('CT and DT Signal on same graph')
29
Signals and Systems Lab Manual
Conclusion:
30
Signals and Systems Lab Manual
Experiment No. 4
Title: Write a program to find Fourier transform of various signals and sketch it in time domain, its
amplitude spectrum and phase spectrum.
Objectives:
●
To demonstrate the time domain Signals
●
To obtain Fourier Transform and demonstrate the spectral analysis using Fourier Transform.
Theory:
The forward and inverse transforms are almost same, only the sign of the exponent and the variable of integration
change. The continuous-time signal x(t) and its Fourier transform X(f) pairs are indicated by the notation below.
and
The signal and its harmonic function form a pair which is indicated by the notation below
MATLAB Code:
% single sided spectrum
% Parthiv(03)
x2=sin(2*pi*50*t);
L = length(x2)-1;
T = 1/70; % define the sampling frequency
t =(0:L-1)*T;
x2=sin(2*pi*50*t);
subplot(211)
plot(t,x2)
xlabel("Time Index, t")
ylabel("Amplitude")
xlim([1 5])
title("TIme Domain Signal");
31
Signals and Systems Lab Manual
Output:
Conclusion:
32
Signals and Systems Lab Manual
Experiment No. 5
Title: Obtain Fourier Transform of the signal shown in figure. Also plot Magnitude and Phase
Spectrum.
Objectives:
Solution:
% Fourier Transform
% Parthiv(03)
f=0.5;
n=-2:0.0001:2;
x=square(2*pi*f*n);
subplot(211)
plot(n,x,'r-')
xlabel('Time')
ylabel('Amplitude')
title('Square wave')
x1=abs(fft(x));
subplot(212)
plot(x1,'r-x')
title('Fourier Transform')
33
Signals and Systems Lab Manual
Conclusion:
34
Signals and Systems Lab Manual
Experiment No. 6
Title: Find the convolution integral of Unit step and exponential signals and write a program to sketch
the out response of the system. Also verify the commutative property of convolution sum.
Objectives:
● To demonstrate the convolution of two continuous-time signals.
● To prove commutative property of convolution sum.
Theory:
Convolution:
Convolution is a mathematical operation which can be perform on two signals 'f' and 'g' to produce
a third signal which is typically viewed as the modified version of one of the original signals. A
convolution is an integral that express the overlap of one signal 'g' as it is shifted over another
signal 'f'.
Convolution of two signals 'f' and 'g' over a finite range [0 → t] can be defined as
Here the symbol [f*g](t) denotes the convolution of 'f' and 'g'. Convolution is more often taken over
an infinite range like,
The convolution of two discrete time signals f(n) and g(n) over an infinite range can be defined as
Convolution properties:
There are some important properties of convolution that perform on continuous time signal which
we have listed below. The commutativity, associativity, distributivity properties are given below.
35
Signals and Systems Lab Manual
36
Signals and Systems Lab Manual
MATLAB Code:
% Convolution of Unit Step signal and Exponential signal
% Parthiv (03)
t=-1:0.01:10;
u=heaviside(t);
u(u==0.5)=1;
subplot(3,1,1)
plot(t,u)
axis([-1 10 -.5 1.5]);
xlabel('Time index')
ylabel('Amplitude')
title('Unit Step Signal')
h=exp(-t).*u;
subplot(3,1,2)
plot(t,h)
axis([-1 10 -5 1.5]);
xlabel('Time index')
ylabel('Amplitude')
title('Exponential Signal')
% Plotting Convolution/Response
C=conv(h,u)/100;
tc=(-200:length(C)-1-200)/100;
subplot(3,1,3)
plot(tc,C)
axis([-1 10 -5 1.5]);
xlabel('Time index')
ylabel('Amplitude')
title('Convolution/Response')
37
Signals and Systems Lab Manual
MATLAB Code:
% Commutative property of convolution sum
% Parthiv (03)
clc;
clear;
close all;
a1=input("enter the a1 sequence, a1 = ");
b1=input("enter the b1 sequence, b1 = ");
N1=max(length(a1),length(b1));
N=max(N1,length(b1));
a=[a1,zeros(1,N-length(a1))];
b=[b1,zeros(1,N-length(b1))];
x=cconv(a,b,N1);
y=cconv(b,a,N1);
%commutative property a*b=b*a
if x==y
disp('commutative property is proved')
else
disp('commutative property is not proved')
end
38
Signals and Systems Lab Manual
Output:
Conclusion:
39
Signals and Systems Lab Manual
Experiment No. 7
Title: Take any one periodic signal and find its Fourier series coefficients Trigonometric FS method.
Objectives:
Theory:
is defined as
where X[k] is the harmonic function, k is the harmonic number and f F = 1/ TF. The harmonic function is
computed as
The signal and its harmonic function form a pair which is indicated by the notation
The left hand side of the above relation represents the signal in time domain while the right hand side represents
the transformation of the signal to a "harmonic-number" domain.
Discrete-time Fourier series (DTFS):
For a discrete-time signal x(n), the Fourier series representation over a representation time
40
Signals and Systems Lab Manual
is defined as
where X[k] is the harmonic function and the harmonic function can be found as
The discrete-time signal and its harmonic function form a pair which is indicated by the notation below
The forward and inverse transforms are almost same, only the sign of the exponent and the variable of integration
change. The continuous-time signal x(t) and its Fourier transform X(f) pairs are indicated by the notation below.
and
The signal and its harmonic function form a pair which is indicated by the notation below
41
Signals and Systems Lab Manual
Multiplication-convolution property:
Multiplication:
42
Signals and Systems Lab Manual
Convolution:
Parseval's theorem::
43
Signals and Systems Lab Manual
44
Signals and Systems Lab Manual
MATLAB Code:
% Fourier series expansion for square wave
% Parthiv (03)
f=500; % Frequency
C=4/pi; % Constant value
dt=5.0e-05; % Interval between tp time steps
tpts=(4.0e-3/5.0e-5)+1;
for n=1:12 % Value we are considering to approximate Fourier Series intead of infinity
as given in original function x(t)
for m=1:tpts % Here,we'll consider all "t"point to cover & cover "from 0
to 4ms interval"
s1(n,m)=(4/pi)*(1/(2*n-1))*sin((2*n-1)*2*pi*f*dt*(m-1));
end
end
for m=1:tpts
a1=s1(:,m);
a2(m)=sum(a1);
end
f1=a2;
t=0.0:5.0e-5:4.0e-3;
plot(t,f1)
xlabel('Time,s')
ylabel('Amplitude,V')
title('Fourier Series Expansion')
Output:
45
Signals and Systems Lab Manual
Conclusion:
46
Signals and Systems Lab Manual
Virtual Lab
Objectives
Theory
Definition of Signal:
Any time varying physical phenomenon that can convey information is called signal. Some
examples of signals are human voice, electrocardiogram, sign language, videos etc. There are
several classification of signals such as Continuous time signal, discrete time signal and digital
signal, random signals and non-random signals.
Continuous-time Signal:
A continuous-time signal is a signal that can be defined at every instant of time. A continuous-time
signal contains values for all real numbers along the X-axis. It is denoted by x(t). Figure 1(a) shows
continuous-time signal.
47
Signals and Systems Lab Manual
Discrete-time Signal:
Signals that can be defined at discrete instant of time is called discrete time signal. Basically
discrete time signals can be obtained by sampling a continuous-time signal. It is denoted
as x(n).Figure 1(b) shows discrete-time signal.
Digital Signal:
The signals that are discrete in time and quantized in amplitude are called digital signal. The term
"digital signal" applies to the transmission of a sequence of values of a discrete-time signal in the
form of some digits in the encoded form.
A signal is said to be periodic if it repeats itself after some amount of time x(t+T)=x(t), for some
value of T. The period of the signal is the minimum value of time for which it exactly repeats itself.
48
Signals and Systems Lab Manual
Signal which does not repeat itself after a certain period of time is called aperiodic signal. The
periodic and aperiodic signals are shown in Figure 2(a) and 2(b) respectively.
A random signal cannot be described by any mathematical function, where as a deterministic signal
is one that can be described mathematically. A common example of random signal is noise.
Random signal and deterministic signal are shown in the Figure 3(a) and 3(b) respectively.
49
Signals and Systems Lab Manual
Signal that are zero for all negative time, that type of signals are called causal signals, while the
signals that are zero for all positive value of time are called anti-causal signal.
A non-causal signal is one that has non zero values in both positive and negative time. Causal, non-
causal and anti-causal signals are shown below in the Figure 4(a), 4(b) and 4(c) respectively.
An even signal is any signal 'x' such that x(t) = x(-t). On the other hand, an odd signal is a
signal 'x' for which x(t) = -x(-t). Even signals are symmetric around the vertical axis, so that they
can easily spotted.
50
Signals and Systems Lab Manual
An even signal is one that is invariant under the time scaling t→ - t and an odd signal is one that is
invariant under the amplitude and time scaling x(t) → - x(-t).
A simple way of visualizing even and odd signal is to imazine that the ordinate [x(t)] axis is a
mirror. For even signals, the part of x(t) for t > 0 and the part of x(t) for t < 0 are mirror images of
each other. In case of an odd signal, the same two parts of the signals are negative mirror images of
each other. Some signals are odd, some signals are even and some signals are neither odd nor even.
But any signal x(t) can be expressed as a sum of its even and odd parts such as x(t) = xe(t) + xo(t) or
we can say that every signal is composed of the addition of an even part and odd part. The even and
odd parts of a signal x(t) are
Here xe(t) denotes the even part of signal x(t) and xo(t) denotes the odd part of signal x(t). Figure
5(a) and 5(b) shows the odd signal and even signal respectively.
Amplitude-Scaling of Signal:
There are some important properties of signal such as amplitude-scaling, time-scaling and time-
shifting. Among these properties now we are discussing about amplitude scaling. Consider a
signal x(t) which is multiplying by a constant 'A' and this can be indicated by a notation x(t) →
Ax(t). For any arbitrary 't' this multiplies the signal value x(t) by a constant 'A'. Thus, x(t) →
Ax(t) multiplies x(t) at every value of 't' by a constant 'A'. This is called amplitude-scaling. If the
amplitude-scaling factor is negative then it flips the signal with the t-axis as the rotation axis of the
flip. If the scaling factor is -1 then only the signal will be flip. This is shown in the Figure 6(a),
6(b), 6(c) which is given below.
51
Signals and Systems Lab Manual
Fig.6(a) A signal x(t) Fig.6(b) A signal x(t) scaled by -1 Fig.6(c) A signal x(t)
scaled by 1/2
Time-Scaling of Signal:
Time scaling compresses or dilates a signal by multiplying the time variable by some quantity. If
that quantity is greater than one, the signal becomes narrower and the operation is called
compression. If that quantity is less than one, the signal becomes wider and the operation is called
dilation. Figure 7(a), 7(b), 7(c) shows the signal x(t), compression of signal and dilation of signal
respectively.
Time-Shifting of Signal:
In signals and system amplitude scaling, time shifting and time scaling are some important
properties. If a continuous time signal is defined as x(t) = s(t - t1). Then we can say that x(t) is the
time shifted version of s(t).
Consider a simple signal s(t) for 0 < t < 1
52
Signals and Systems Lab Manual
Fig.8(a) Signal within 0< t < 1 Fig.8(b) Signal shifted by 2 sec. Fig.8(c) Signal shifted by -1 sec.
Which is simply s(t) with its origin shifted to the left or advance in time by 1 seconds. This time-
shifting property of signal is shown in the Figure 8(a), 8(b) and 8(c) given above.
Impulse Signal:
The Dirac delta function or unit impulse or often referred to as the delta function, is the function
that defines the idea of a unit impulse in continuous-time. Informally, this function is one that is
infinitesimally narrow, infinitely tall, yet integrates to one. Perhaps the simplest way to visualize
this as a rectangular pulse from a -D/2 to a +D/2 with a height of 1/D. As we take the limit of this
setup as D approaches 0, we see that the width tends to zero and the height tends to infinity as the
total area remains constant at one.
53
Signals and Systems Lab Manual
Since it is quite difficult to draw something that is infinitely tall, we represent the Dirac with an
arrow centered at the point it is applied. The dirac delta function and unit impulse are shown in
Figure 9(a) and 9(b) respectively.
The impulse function has some special properties.
Since the derivative of the unit step u(t) is zero everywhere except at t=0, the unit impulse is zero
everywhere except at t=0. Since the unit step is the integral of the unit impulse, a definite integral
of the unit impulse whose integration range includes t=0 must have the value one.
54
Signals and Systems Lab Manual
Exponential signal is of two types. These two type of signals are real exponential signal and
complex exponential signal which are given below.
Where both "A" and "σ" are real. Depending on the value of "σ" the signals will be different.
If "σ" is positive the signal x(t) is a growing exponential and if "σ" is negative then the signal x(t) is
a decaying exponential. For σ=0, signal x(t) will be constant. Figure 10(a), 10(b) and 10(c) shows a
dc signal, exponentially growing signal and exponentially decaying signal respectively.
Fig.10(a) A dc signal Fig.10(b) Exponentially growing signal Fig.10(c) Exponentially decaying signal
Therefore
........................(1)
55
Signals and Systems Lab Manual
...............................(2)
Substituting eqn.(2) in eqn.(1) we have
A complex exponential signal can not be plot in a two dimentional (2D) graph, it should be plot in
a three dimentional graph. Figure given below shows the three dimentional view of a complex
exponential signal.
Real sines and real cosines can be expressed by the combinations of complex sinusoids through the
trigonometric identities
and
56
Signals and Systems Lab Manual
57
Signals and Systems Lab Manual
58
Signals and Systems Lab Manual
59
Signals and Systems Lab Manual
Quiz:
1) If b>1 which of the following statement is true for y(t)= x(t/b).
2 is correct!
y(t) is a time-compressed version of x(t), compressed by a factor b.
y(t) is a time-expanded version of x(t), expanded by a factor b.
y(t) is a time inverted version of x(t) scaled by |b|.
1 is correct!
Odd
Even
Neither odd nor even
2 is correct!
Discrete-time impulse function will be scaled by 0.6 value.
Discrete-time impulse function will not shift for any float value.
Discrete-time impulse function will shift with 0.6 value in the time axis.
3 is correct!
The signal becomes even.
The signal remains odd and unaltered.
The signal remains odd and the waveform flips about the t=0 axis, where 't' is the time.
None of these.
5) Real exponential signal is defined as x(t) =A.exp(at). If the value of 'a' is negative, then the
signal will be?
3 is correct!
A DC signal.
Exponentially growing signal.
Exponentially decaying signal.
A sinusoidal signal.
6) Real exponential signal is defined as x(t) = A.exp(at). If the value of 'a' is zero, then the signal
will be
60
Signals and Systems Lab Manual
3 is correct!
Exponentially growing signal.
Exponentially decaying signal.
A DC signal with amplitude 'A'.
A sinusoidal signal with amplitude 'A'.
7) What will happen if we take the difference of an odd function and an even function ?
3 is correct!
It will be an even function.
It will be an odd function.
Neither even nor odd.
8)What will happen if we time-scale a discrete-time impulse function by a factor 'A' (A may be of
any numerical value) ?
2 is correct!
The discrete-time impulse function will be compressed/expanded by the value of factor 'A'.
There will be no change in the amplitude of the discrete-time impulse function.
Conclusion:
61