SS Lab Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 61

Signals and Systems Lab Manual

DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT AND


RESEARCH, AKURDI, PUNE-44

Electronics & Telecommunication Department


2020-2021

LAB MANUAL
Subject – Signals and Systems Lab
Subject code: 204195
Class – SE

Name Ruchita Shinde


Roll Number SEETC2361

1
Signals and Systems Lab Manual

Program Outcomes

Engineering Graduates will be able to:

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:

To impart quality education to produce competent E&TC Engineers

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

1) Apply principles of Electronics and communication , digital systems, signal


processing, software programming in the field of Embedded,
Telecommunication & Software services for real world applications
2) Comprehend the technological advancements, demonstrate the proficiency in
the usage of engineering tools to analyze and design systems for variety of
applications.
3) Demonstrate professional ethics , apply communication skills for successful
career and higher studies

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.1 Simulate Signals and Systems using MATLAB..

Analyze real time Signals through Spectral Analysis using Fourier


C405.2
Systems.
204195
C405.3 Perform time domain and frequency domain analysis of control system
required for stability analysis.

C405.4 Apply Root locus, Nyquist plot and Bode Plot technique to analyze
control system.

CO and PO Mapping for Data Analytics Lab:


University
Course SAR COs (1/2/3 indicates strength of correlation) 3-Strong, 2-Medium, 1-Weak
Code course PO PO PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
Code 1 2
C405.1 CO1 2 1 - 1 2 - - - 1 1 - 1

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:

Course Name: Signals and Lab(204195)


A. Y. 2020-21 Sem 2
CO PSO1 PSO2 PSO3

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.

Guidelines for Laboratory Conduction

• 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

Guidelines for Student's Lab Journal

• The laboratory assignments/experiments are to be submitted by student in the form of journal.

• 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.

Guidelines for Lab Assessment:

• Continuous assessment of laboratory work is done based on overall performance.

• 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.

✓ Punctuality and neatness.

• 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

Sampling & Aliasing


3 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.

Real time speech signal and Spectral analysis


The speech signal has frequency components in the audio frequency range 300 Hz to 3400
4 Hz of the electromagnetic spectrum. Record the male and female voice speech Signal. Write a
program to record the speech signals and sketch it in time domain, its amplitude spectrum and phase
spectrum.

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.

8 Virtual LAB Link:


http://ssl-iitg.vlabs.ac.in/

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:

● To understand and demonstrate the elementary signals.


● To visualize the signals in Continuous and Discrete domain.

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.

Fig.1 (a) Continuous-time signal Fig.1 (b) Discrete-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.

MATLAB Code:(for various Signals)

Impulse:

% Continuous Impulse signal


% Parthiv (03)

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');

% Discrete Impulse signal


% Parthiv (03)

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

Unit Step signal:

% Continuous Unit Step signal


% Parthiv (03)

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

% Discrete Unit Step signal


% Parthiv (03)

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

% Discrete Exponential signal


% Parthiv (03)

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

Unit Ramp signal:


% Continuous Ramp signal
% Parthiv (03)

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

% Discrete Ramp signal


% Parthiv (03)

subplot(2,1,2);
stem(t,t)
title("Discrete time ramp signal")
xlabel("time,n")
ylabel("Amplitude")
axis tight

Sinc signal:

% Continuous Sinc signal


% Parthiv (03)

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

% Discrete Sinc signal


% Parthiv (03)

subplot(2,1,2 )
stem(t,abs(y));
title("Discrete sinc signal")
xlabel("time n")
ylabel("Amplitude")

Rectangular signal:

% Continuous Rectangular signal


% Parthiv (03)

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

% Discrete Rectangular signal


% Parthiv (03)

subplot(2,1,2);
stem(t,a);
xlabel('time n')
ylabel('Amplitude')
title('Discrete Rectangular signal')

Conclusion:

15
Signals and Systems Lab Manual

Experiment No. 2(a)


Title: Write the codes to plot the following signals also simulate the signal

Objectives:

● To explore the effect of transformation of signal parameters (time-shifting).

● To compare sine and cosine wrt phase

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:

% Original sine signal


% Parthiv (03)

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

% Sine and (sine with -pi/6) on the same plot


% Parthiv (03)

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

% Sine and (sine with +pi/6) on the same plot


% Parthiv (03)

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

% Original cosine signal


% Parthiv (03)

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

% Cosine and (cosine with -pi/6) on the same plot


% Parthiv (03)

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

% Cosine and (cosine with +pi/6) on the same plot


% Parthiv (03)

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

Experiment No. 2(b)


Title: 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

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

Where "s" is a complex variable and it is defined as

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

Complex exponential signal , out of phase complex exponential signal and


the addition and subtraction of complex exponentials to form the real cosine and real sine are shown
in Figure 11(a), 11(b), 11(c) and 11(d) respectively.

Fig.11(a) Complex exponential signal Fig.11(b) Out of phase complex


exponential signal

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

% Exponentially growing signal


% Parthiv (03)

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:

● To demonstrate the time domain sampling of bandlimited signals (Nyquist theorem).


● To demonstrate the time domain sampling of non-bandlimited signals and antialiasing filter.
● To demonstrate the signal reconstruction using zero-order hold and first-order hold filters.
● To demonstrate the sampling in frequency domain (Discrete Fourier Transform).
● To demonstrate the spectral analysis using Discrete Fourier Transform.

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.

Nyquist Sampling Theorem:


If a signal is band limited and its samples are taken at sufficient rate then those samples uniquely
specify the signal and the signal can be reconstructed from those samples. The condition in which
this is possible is known as Nyquist sampling theorem and is derived below.
A real signal whose spectrum is bandlimited to D Hz [X(f) = 0 for | f |>D] can be reconstructed
from its samples taken uniformly at a rate fs > 2D samples/sec. We can say the minimum sampling
frequency is fs=2D Hz.
Consider a signal x(t) as shown in Fig.1 and its spectrum is shown in Fig.2 which is noted to
be bandlimited to D=1 Hz . Sampling x(t) at a rate of fs Hz, (means fs samples/sec) can be

mathematically represented as multiplying x(t) by an impulse train consisting of unit


impulses repeating periodically every T seconds, where T= 1/ fs. The resulting sampled
signal x'(t) is shown in Fig. 3. The spectrum of the sampled signal is shown in Fig. 4.

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.

Fig.5 Aliased signal

Sampling of Non-bandlimited Signal: Anti-aliasing Filter


Anti aliasing filter is a filter which is used before a signal sampler, to restrict the bandwidth of a
signal to approximately satisfy the sampling theorem. The potential defectors are all the frequency
components beyond fs/2 Hz. We should have to eliminate these components from x(t) before
sampling x(t). As a result of this we lose only the components beyond the folding
frequency fs/2 Hz. These frequency components cannot reappear to corrupt the components with
frequencies below the folding frequency. This suppression of higher frequencies can be
accomplished by an ideal filter of bandwidth fs/2 Hz. This filter is called the anti-aliasing filter.
The anti aliasing operation must be performed before the signal is sampled. The anti aliasing filter,
being an ideal filter is unrealizable. In practice, we use a steep cutoff filter, which leaves a sharply
attenuated residual spectrum beyond the folding frequency fs/2.

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

% Sampling theorem (200 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/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:

Continuous-time Fourier Transform (CTFT):


The continuous-time Fourier transform (CTFT) is defined as

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.

Discrete-time Fourier transform (DTFT):


The discrete-time Fourier transform is defined by

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

% ploting of Fourier Transform


xf1 =fft(x2);
xf2 =abs(xf1/L);
xf2 =xf2(1:L/2+1);
f=70*(0:(L/2))/L;
subplot(212);
plot(f,xf2);
xlabel("Frequency Index, f");
ylabel("Magnitude, |x(f)|");
title("Magnitude of FFT of signal");

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:

● To demonstrate the time domain Signals


● To explain the need of Fourier Transform.
● To obtain Fourier Transform and demonstrate the spectral analysis using Fourier Transform.

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

The convolution of two continuous time signals is shown in the Figure 1.

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.

Commutativity f(t) * g(t) = g(t) * f(t)


Associativity [f(t) * g(t)] * h(t) = f(t) * [g(t) * h(t)]
Distributivity f(t) * [g(t) + h(t)] = f(t) * g(t) + f(t) * h(t)

35
Signals and Systems Lab Manual

36
Signals and Systems Lab Manual

Convolution of Unit Step Signal and Exponential Signal

MATLAB Code:
% Convolution of Unit Step signal and Exponential signal
% Parthiv (03)

t=-1:0.01:10;

% Plotting Unit Step Signal

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

% Plotting Exponential 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

Verification of the commutative property of convolution Sum

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:

● To plot continuous-time Fourier series for any periodic signal


● To visualize the relationship between the continuous-time Fourier series and Fourier
transform of a signal.
● To visualize the relationship among Fourier analysis methods.

Theory:

Introduction to Fourier analysis methods


♦ Continuous-time Fourier series (CTFS)
♦ Discrete-time Fourier series (DTFS)
♦ Continuous-time Fourier transform (CTFT)
♦ Discrete-time Fourier transform (DTFT)
♦ Salient properties of Fourier analysis method

Relationship among Fourier analysis methods


♦ Relationship between CTFS and CTFT
♦ Relationship between DTFS and DTFT)
♦ Relationship between CTFT and DTFT

Introduction to Fourier analysis methods


In the following we first describe different Fourier methods available for analysing continuous-time and discrete-
time signals. It would be followed by listing of salient properties of these Fourier analysis methods.
Continuous-time Fourier series (CTFS):
For a continuous-time signal x(t), the Fourier series representation of a signal over a representation time

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

where 'NF' is the representation time and the notation

means summation over any range of consecutive 'k' exactly NF in length.


Continuous-time Fourier series (CTFS):
The continuous-time Fourier transform(CTFT) is defined as

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.

Discrete-time Fourier transform (DTFT):


The discrete-time Fourier transform is defined by

and

The signal and its harmonic function form a pair which is indicated by the notation below

Salient properties of Fourier analysis methods:


Some of the salient properties exhibited by the continuous-time as well as discrete-time Fourier transform /
Fourier series are given below.
Linearity property:

41
Signals and Systems Lab Manual

Time shifting property:

Frequency shifting property:

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 &quot;t&quot;point to cover & cover &quot;from 0
to 4ms interval&quot;
s1(n,m)=(4/pi)*(1/(2*n-1))*sin((2*n-1)*2*pi*f*dt*(m-1));
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

Signals and their properties:

Objectives

1. To demonstrate some simple signal.


2. To explore the commutation of even and odd symmetries in a signal with algebraic operations.
3. To explore the effect of transformation of signal parameters (amplitude-scaling, time-scaling and time-
shifting).
4. To explore the various properties of the impulse signals.
5. To visualize the complex exponential signal and real sinusoids.

Theory

Introduction to some simple signal

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

Fig.1 (a) Continuous-time signal Fig.1


(b) Discrete-time signal

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.

Periodic and Aperiodic Signal:

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

Fig.2(a) Periodic signal Fig.2(b) Aperiodic signal

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.

Random and Deterministic Signal:

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.

Fig.3(a) Random signal

49
Signals and Systems Lab Manual

Fig.3(b) Deterministic signal

Causal, Non-causal and Anti-causal Signal:

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.

Fig.4(a) Causal signal Fig.4(b) Non-caual signal Fig.4(c) Anti-causal signal

Even and Odd Signal:

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

Fig.5(a) Odd signal Fig.5(b) Even signal

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.

Fig.7(a) Signal x(t) Fig.7(b) Compression of signal Fig.7(c) Dilation of signal

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.

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

The impulse function is often written as

Fig.9(a) Dirac delta functoin Fig.9(b) Unit impulse

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.

• The sampling property.

• Another important property is the scaling property.

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.

, where u(t) is the unit step.


This scaling property can not be applied for discrete-time impulse.

54
Signals and Systems Lab Manual

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

Complex exponential Signal:

The complex exponential signal is given by

Where "s" is a complex variable and it is defined as

Therefore

........................(1)
55
Signals and Systems Lab Manual

Using Eulers identity

...............................(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

Complex exponential signal , out of phase complex exponential signal and


the addition and substraction of complex exponentials to form the real cosine and real
sine are shown in Figure 11(a), 11(b), 11(c) and 11(d) respectively.

Fig.11(a) Complex exponential signal Fig.11(b) Out of phase complex


exponential signal

56
Signals and Systems Lab Manual

Fig.11(c)Real cosine after addition of Fig.11(d) Real sine after substraction of


complex sinusoids complex sinusoids

Snapshot of experiment windows:

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|.

2) The product of an even function and an odd function will be

1 is correct!
Odd
Even
Neither odd nor even

3) If we shift a discrete-time impulse function by a shifting value of 0.6 then

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.

4) What will happen if we do time inversion of an odd signal?

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

You might also like