You are on page 1of 53

Signals And Systems Lab B.

Tech III semester

ADITYA ENGINEERING COLLEGE(A)


Approved by AICTE , Affiliated to JNTUK & Accredited by NAAC with 'A' Grade
Recognized by UGC under the sections 2(f) and 12(B) of the UGC act 1956
Aditya Nagar, ADB Road, Surampalem – 533 437

LABORATORY MANUAL

SIGNALS AND SYSTEMS LAB

Regulations : AR20
Course code : 201EC3L02
Semester : III
Academic Year : 2022-2023

Department of
Electronics and Communication Engineering

Prepared by:
Mr. S Jagadeesh, Associate Professor

Mr. A Konda Babu, Sr. Asst. Professor

Mr. A Lakshmana Siridhara, Associate Professor

Mr. Babu Linclon, Asst Professor

Dept. of ECE, Aditya Engineering College(A) 1


Signals And Systems Lab B.Tech III semester

Dept. of ECE, Aditya Engineering College(A) 2


Signals And Systems Lab B.Tech III semester

ADITYA ENGINEERING COLLEGE(A)


Approved by AICTE , Affiliated to JNTUK & Accredited by NAAC with 'A' Grade
Recognized by UGC under the sections 2(f) and 12(B) of the UGC act 1956
Aditya Nagar, ADB Road, Surampalem – 533 437

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

SIGNALS AND SYSTEMS LAB

LIST OF EXPERIMENTS

B.Tech – III SEMESTER Academic Year: 2021-22

Regulation: AR20

1. Generation of Various Signals such as Unit Impulse, Unit Step,


Sinusoidal, Ramp.
2. Operations on Signals such as Addition, Multiplication, Scaling,
Shifting, Folding.
3. Finding the Even and Odd parts, Real and Imaginary parts of Signal.
4. Convolution of signals.
5. Autocorrelation and cross correlation of signals.
6. Verification of linearity and time invariance properties of a given
continuous/discrete signal.
7. Fourier Transform and Inverse Fourier Transform.
8. Laplace Transform of standard signals.
9. Z-transform and pole-zero map plotting.
10.Sampling theorem verification

AUGMENTED EXPERIMENTS
1. Gibbs Phenomenon.
2. Computation of unit samples, unit step and sinusoidal response of the
given LTI system and verifying its physical realiazability and stability
properties.

Dept. of ECE, Aditya Engineering College(A) 3


Signals And Systems Lab B.Tech III semester

Dept. of ECE, Aditya Engineering College(A) 4


Signals And Systems Lab B.Tech III semester

Experiment No : 1 Date:_______________

Aim of the Experiment: Simulation of elementary signals.

Apparatus required: PC with Matlab Software

Theory:

There are several elementary signals which play vital role in the study of signals and systems. These
elementary signals serve as basic building blocks for the construction of more complex signals. Infact, these
elementary signals may be used to model a large number of physical signals which occur in nature. These
elementary signals are also called as standard signals.

The standard signals are:

1. Unit impulse signal


2. Unit Step signal
3. Unit Ramp signal
4. Exponential signal
5. Sinusoidal signal
S. No Name of the Signal Description Plot

1 𝑎𝑡 𝑡 = 0
1 Unit Impulse Signal 𝛿(𝑡) = {
0 𝑒𝑙𝑠𝑒

1 𝑓𝑜𝑟 𝑡 ≥ 0
2 Unit Step Signal 𝑢(𝑡) = {
0 𝑒𝑙𝑠𝑒

Dept. of ECE, Aditya Engineering College(A) 5


Signals And Systems Lab B.Tech III semester

S. Name of
Description Plot
No the Signal

Unit Ramp 1 𝑎𝑡 𝑡 = 0
3 𝛿(𝑡) = {
Signal 0 𝑒𝑙𝑠𝑒

𝑥(𝑡) = 𝐴𝑒 𝑏𝑡

Exponential Where A and b are real


Signal
• If b = 0 :a constant amplitude for all times.
• If b>0 :it is an exponentially increasing signal.
• If b<0 :it is an exponentially decreasing signal.
4

Plot

𝑦(𝑡) = 𝐴 sin(2𝜋𝑓𝑡
+ ∅)

Where
Sinusoidal
5 A = Amplitude
Signal
f = frequency

∅ = Phase angle in
radians

Dept. of ECE, Aditya Engineering College(A) 6


Signals And Systems Lab B.Tech III semester

MATLAB Programs and Output

clc;
clear all;
close all;
% defining a time
t = -5:0.2:10;
[m,n] = size(t);
% Unit impulse Signal
% creating an empty array equal to the size of time
d = zeros(m,n);
fori = 1:n
if t(i) == 0
d(i) = 1;
else
d(i) = 0;
end
end
stem(t,d);title('unit impulse signal');

Dept. of ECE, Aditya Engineering College(A) 7


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% defining a time
t = -5:0.2:10;
[m,n] = size(t);
% Unit Step signal
% creating an empty array equal to the size of time
u = zeros(m,n);
fori = 1:n
if t(i) >= 0
u(i) = 1;
else
u(i) = 0;
end
end
stem(t,u);title('unit step signal');

Dept. of ECE, Aditya Engineering College(A) 8


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% defining a time
t = -5:0.2:10;
[m,n] = size(t);
% Unit ramp signal
% creating an empty array equal to the size of time
r = zeros(m,n);
fori = 1:n
if t(i) >= 0
r(i) = t(i);
else
r(i) = 0;
end
end
stem(t,r);title('unit ramp signal');

Dept. of ECE, Aditya Engineering College(A) 9


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% defining a time
t = -5:0.2:10;
[m,n] = size(t);
% exponential signal
% creating an empty array equal to the size of time
e = zeros(m,n);
% defining the real constants
A = 2;
b = 1;
% Note: try this signal with various real values of A and b
fori = 1:n
e(i) = A*exp(b*t(i));
end
stem(t,e);title('Exponential signal');

Dept. of ECE, Aditya Engineering College(A) 10


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% Sinusoidal Signal
% define time with proper sampling interval
t1 = 0:0.01:1;
% Amplitude (peak to peak)
A1 = 5 ;
% frequenncy (Cycles per unit time);
f = 2;
x = A1*sin(2*pi*f*t1);
plot(t1,x);title('sinusoidal signal');

Dept. of ECE, Aditya Engineering College(A) 11


Signals And Systems Lab B.Tech III semester

Precautions:

1. file name should not contain any blank spaces


2. file name should not contain any command names such as ‘sin”, “cos”, “exp”
3. Always publish the program with .pdf extension only
4. While publishing the program pleas ensure that, roll number and date are edited properly.

Procedure:

1. Open Matlab software


2. Create a folder with roll number and locate the folder in the current directory of Matlab
3. Edit and save the program in the current directory
4. Execute the program and generate the pdf file of the program using Matlab Publish

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 12


Signals And Systems Lab B.Tech III semester

Experiment No : 2 Date:_______________

Aim of the Experiment: To perform the following basic operations on signals

1. Time shifting
2. Time reversal (signal folding)
3. Time scaling
4. Amplitude scaling
5. Signal addition
6. Signal multiplication
Apparatus required: PC with Matlab Software

Theory:

The basic operations on signals can be classified into operations correspond to transformation in
independent variable t or n of a signal with Time shifting, Time reversal and time scaling operations. And the
operations such as Amplitude scaling, signal addition, signal multiplication are corresponded to transformation
on amplitude of a signal. These are summarized in the following table:

Signal operations correspond to


• Time shifting
transformation on independent variable t or
• Time reversal
n • Time scaling
Signal operations correspond to • Amplitude scaling
transformation on amplitude • Signal addition
• Signal multiplication

1. Time shifting
Mathematically time shifting of a continuous – time signal x(t) can be represented by
𝑥(𝑡 − 𝑇) ∶ 𝑟𝑖𝑔ℎ𝑡 𝑠ℎ𝑖𝑓𝑡𝑒𝑑 𝑜𝑟 𝑑𝑒𝑙𝑎𝑦𝑒𝑑 𝑏𝑦 𝑇 𝑢𝑛𝑖𝑡𝑠 𝑖𝑛 𝑇𝑖𝑚𝑒
𝑦(𝑡) = {
𝑥(𝑡 + 𝑇): 𝑙𝑒𝑓𝑡 𝑠ℎ𝑖𝑓𝑡𝑒𝑑 𝑜𝑟 𝑎𝑑𝑣𝑎𝑛𝑐𝑒𝑑 𝑏𝑦 𝑇 𝑢𝑛𝑖𝑡𝑠 𝑖𝑛 𝑇𝑖𝑚𝑒
Plot:

2. Time reversal
The time reversal of a signal x(t) can be obtained by folding the sequence about
t = 0. And it is denoted by x(-t).

Dept. of ECE, Aditya Engineering College(A) 13


Signals And Systems Lab B.Tech III semester

Plot:

3. Time Scaling
The time scaling operation will be either time expansion or time compression.
𝒚(𝒕) = 𝒙(𝑲𝒕)
𝑖𝑓 𝐾 > 1 ∶ 𝑡𝑖𝑚𝑒 𝑐𝑜𝑚𝑝𝑟𝑒𝑠𝑠𝑒𝑑 𝑠𝑖𝑔𝑛𝑎𝑙
𝑖𝑓 𝐾 < 1 ∶ 𝑡𝑖𝑚𝑒 𝑒𝑥𝑝𝑎𝑛𝑑𝑒𝑑 𝑠𝑖𝑔𝑛𝑎𝑙

Plot:

4. AmplitudeScaling
An amplitude scaled signal will be either amplified signal or attenuated signal
Mathematically represented as:
𝒚(𝒕) = 𝑨. 𝒙(𝒕)
𝑖𝑓 𝐴 > 1: 𝐴𝑚𝑝𝑙𝑖𝑓𝑖𝑒𝑑 𝑠𝑖𝑔𝑛𝑎𝑙
𝑖𝑓 𝐴 < 1 ∶ 𝐴𝑡𝑡𝑒𝑛𝑢𝑎𝑡𝑒𝑑 𝑠𝑖𝑔𝑛𝑎𝑙

Dept. of ECE, Aditya Engineering College(A) 14


Signals And Systems Lab B.Tech III semester

Plot:

5. Signal Addition
the sum of two continuous-time signals x1(t) and x2(t) can be obtained by adding their values at every
instant of time where as for discrete time signals, it will be result of sum of corresponding samples at each
sample time. consider two signals x1(t) and x2(t) sum of these signals as well as subtraction is also
illustrated in the plot. Incase x1(t) is a signal and x2(t) is a random noise, a noisy signal can be simulated
using Matlab.
𝒚(𝒕) = 𝒙𝟏 (𝒕) + 𝒙𝟐 (𝒕) ⟹ 𝒔𝒖𝒎 𝒐𝒇 𝒕𝒘𝒐 𝒔𝒊𝒈𝒏𝒂𝒍𝒔
𝒚(𝒕) = 𝒙𝟏 (𝒕) + 𝒙𝟐 (𝒕) ⟹ 𝒔𝒖𝒃𝒕𝒓𝒂𝒄𝒕𝒊𝒐𝒏 𝒐𝒇 𝒕𝒘𝒐 𝒔𝒊𝒈𝒏𝒂𝒍𝒔

Plot:

6. Signal Multiplication
The multiplication of two continuous-time signals or discrete-time signals can be performed by multiplying
the corresponding amplitudes at every instant or at every sample time.
𝒚(𝒕) = 𝒙𝟏 (𝒕). 𝒙𝟐 (𝒕)

Dept. of ECE, Aditya Engineering College(A) 15


Signals And Systems Lab B.Tech III semester

Plot:

Dept. of ECE, Aditya Engineering College(A) 16


Signals And Systems Lab B.Tech III semester

MATLAB Programs and Output

clc;
clear all;
close all;
% Signal Operation # 1: Time Shifting
% defining time
t = -2:4;
[m,n] = size(t);
% defining a discrete signal
x = [0 0 4 3 2 0 0];
% defining two emtry arrays for delayed and advanced signals
y1 = zeros(m,n);
y2 = zeros(m,n);
% generating a delayed signal in time with 1 unit
% Note: observe the for loop initiation
fori = 2:n
y1(i) = x(i-1);
end
% generating an advanced signal in time with 1 unit
% Note: observe the for loop initiation
fori = 1:n-1
y2(i) = x(i+1);
end
subplot(311);
stem(t,x);grid;title('original signal x(t)');
subplot(312);
stem(t,y1);grid;title('delayed signal x(t-1)');
subplot(313);
stem(t,y2);grid;title('advanced signal x(t+1)');

Dept. of ECE, Aditya Engineering College(A) 17


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% Signal Operation # 2: Time Reversal
t = -4:4;
x = [0 0 0 0 4 3 2 0 0];
[m,n] = size(t);
t1 = sort(-t);
y = zeros(m,n);
fori = 1:n
y(i) = x(n);
n = n-1;
end
figure;
subplot(211);
stem(t,x);title('original signal')
subplot(212);
stem(t1,y);title('signal with time reversal')

Dept. of ECE, Aditya Engineering College(A) 18


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% Signal Operation # 3: Time Scaling
t = -5:0.001:5; % time vector of 5 seconds
x = tripuls (t ,2) ;% triangular pulse of width 2
figure;
subplot (311)
plot(t,x,'r') , grid
title ('Triangular pulse with width of 2')
t1 = 2*t ;% new time vector scaled by 2
x1 = tripuls (t1,2) ;% scaled triangular pulse
subplot (3,1,2)
plot(t,x1,'b') , grid
title ('Triangular pulse with width of 1')
t3 = 1/2* t; % new time vector scaled by 0.5
x3 = tripuls (t3 ,2) ;% scaled triangular pulse
subplot (313)
plot(t,x3,'g') , grid
title ('Triangular pulse with width of 4')

Dept. of ECE, Aditya Engineering College(A) 19


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% Signal Operation # 4: Amplitude Scaling
% consider a sinusoidal signal for amplitude scaling
t = 0:0.01:1;
f = 4;
x = sin(2*pi*f*t);
y1 = 2*x;
y2 = 1/2*x;
figure;
subplot(311);plot(t,x);title('original signal');
subplot(312);plot(t,y1);title('amplitude scaled signal by 2
units');
subplot(313);plot(t,y2);title('amplitude scaled signal by 1/2
units');

Dept. of ECE, Aditya Engineering College(A) 20


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% Signal Operation # 5: Signal addition
% case 1: consider two sinusoidal signals with different
frequencies
% case 2: consider a sinusoidal signal and a noisy signal
% Case # 1
t = 0:0.01:1;
f1 = 6;
f2 = 3;
x1 = sin(2*pi*f1*t);
x2 = sin(2*pi*f2*t);
% add the two signals x1 and x2 and observe the oputput
y = x1 + x2;
figure;
subplot(311);plot(t,x1,'b');grid;title('sine signal with 6Hz
frequency');
subplot(312);plot(t,x2,'k');grid;title('sine signal with 3Hz
frequency');
subplot(313);plot(t,y,'r');grid;title('addition of two
signals');
% Case # 2
t = 0:0.01:1;
Dept. of ECE, Aditya Engineering College(A) 21
Signals And Systems Lab B.Tech III semester

[m,n] = size(t);
f = 4;
% sine signal
x = sin(2*pi*f*t);
% generate a random noise with equal size of time
r = 0.5*rand(m,n);
% now add the signal and nosise use a function 'rand' or 'randn'
y = x + r;
figure;
subplot(311);plot(t,x);title('orisingl signal');
subplot(312);plot(t,r);title('random noise');
subplot(313);plot(t,y);title('noisy signal');

Dept. of ECE, Aditya Engineering College(A) 22


Signals And Systems Lab B.Tech III semester

clc;
clear all;
close all;
% Signal Operation # 6: Signal Multiplication
t = 0:0.001:1;
f1 = 20;
f2 = 2;
% generate a square wave
x1 = square(2*pi*f1*t);
% generate a sine wave
x2 = sin(2*pi*f2*t);
y = x1.*x2;
figure;
subplot(311);plot(t,x1);title('square signal');
subplot(312);plot(t,x2);title('sine signal');
subplot(313);plot(t,y);title('multiplication of two signals');

Dept. of ECE, Aditya Engineering College(A) 23


Signals And Systems Lab B.Tech III semester

Precautions

5. file name should not contain any blank spaces


6. file name should not contain any command names such as ‘sin”, “cos”, “exp”
7. file name should not contain any numbers
8. Always publish the program with .pdf extension only
9. While publishing the program please ensure that, name, roll number and date are edited properly.
Procedure

5. Open Matlab software using run command.


6. Create a folder with roll number and locate the folder in the current directory of Matlab.
7. Edit and save the program in the current directory.
8. Use subplot command to generate all graphs in a single figure window.
9. Execute the program and generate the pdf file of the program using Matlab Publish

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 24


Signals And Systems Lab B.Tech III semester

Experiment No : 3 Date:_______________

Aim of the Experiment:

1. Finding the even and odd part of a signal


2. Finding the real and imaginary part of a signal
Apparatus required: PC with Matlab Software

Finding the even and odd part of a signal


Theory:

Let a signal 𝑥(𝑡) is real valued signal. Then, the even and odd parts of the signal can be calculated as follows:

𝒙(𝒕) + 𝒙(−𝒕)
𝑬𝒗𝒆𝒏 𝒑𝒂𝒓𝒕 𝒐𝒇 𝒕𝒉𝒆 𝒔𝒊𝒈𝒏𝒂𝒍 𝒙𝒆𝒗𝒆𝒏 (𝒕) =
𝟐
Similarly,

𝒙(𝒕) − 𝒙(−𝒕)
𝑶𝒅𝒅 𝒑𝒂𝒓𝒕 𝒐𝒇 𝒕𝒉𝒆 𝒔𝒊𝒈𝒏𝒂𝒍 𝒙𝒐𝒅𝒅 (𝒕) =
𝟐
Consider a unit step signal for calculating the even and odd parts.

We know that, a unit step signal is defined as

1 𝑓𝑜𝑟 𝑡 ≥ 0
𝑢(𝑡) = {
0 𝑒𝑙𝑠𝑒
Process for finding the even and odd parts of the signal

➢ Step 1: define the time in the range -4 to 4


➢ Step 2: define a unit step signal in the given time range
➢ Step 3: find the folded unit step signal from Step 2
➢ Step 4: calculate the even and odd parts of the signal as per the formulas.
➢ Step 5: Plot the unit step signal, folded signal, even part of the signal and odd part of the signal w.r.t.
time.
Unit step Folded Even part of the Odd part of the
time
signal signal Unit step signal Unit step signal

𝒖(𝒕) + 𝒖(−𝒕) 𝒖(𝒕) − 𝒖(−𝒕)


𝒕 𝒖(𝒕) 𝒖(−𝒕) 𝒖𝒆𝒗𝒆𝒏 (𝒕) = 𝒖𝒐𝒅𝒅 (𝒕) =
𝟐 𝟐
-4 0 1 0.5 -0.5

-3 0 1 0.5 -0.5

-2 0 1 0.5 -0.5

Dept. of ECE, Aditya Engineering College(A) 25


Signals And Systems Lab B.Tech III semester

-1 0 1 0.5 -0.5

0 1 1 1 0

1 1 0 0.5 0.5

2 1 0 0.5 0.5

3 1 0 0.5 0.5

4 1 0 0.5 0.5

Matlab Program and Output plot

% 1. Even and Odd parts of a signal


% define time
t = -4:0.5:4;
[m,n] = size(t);
%defining a unit step signal u(t)
u = zeros(m,n);
fori = 1:n
if t(i) >= 0
u(i) = 1;
else
u(i) = 0;
end
end
% generating a time reversal of unit step signal u(-t)
u1 = zeros(m,n);
fori = 1:n
u1(i) = u(n);
n = n-1;
end
% finding the even part of the unit step signal
u_evn = (u + u1)/2;
% finding the odd part of the unit step signal
u_odd = (u - u1)/2;
subplot(411);stem(t,u);title('unit step signal u(t)');
subplot(412);stem(t,u1);title('folded unit step signal u(-t)');
subplot(413);stem(t,u_evn);title('even part of the unit step
signal');
subplot(414);stem(t,u_odd);title('odd part of the unit step
signal');
%Note: try the above program for a sine and coise signals

Dept. of ECE, Aditya Engineering College(A) 26


Signals And Systems Lab B.Tech III semester

Finding the real and imaginary part of a signal


Let a signal w(t) is a complex signal represented as

𝑤(𝑡) = 𝑒 𝑗𝜔𝑡 = 𝒄𝒐𝒔(𝝎𝒕) + 𝑗𝒔𝒊𝒏(𝝎𝒕)

For the above complex signal the real and imaginary parts can be represented as

𝑅𝑒𝑎𝑙(𝑤(𝑡)) = cos (𝜔𝑡)

and

𝐼𝑚𝑎𝑔(𝑤(𝑡)) = sin(𝜔𝑡)

% 2. Real and Imaginary parts of a signal


% define time and frequency
t = 0:0.01:1;
f = 4;
% define a complex signal
y = exp(1i*2*pi*f*t);
% seperate the real part of the signal using 'real' command
y_real = real(y);
% seperate the imaginary part of the signal using 'imag' command
y_imag = imag(y);
figure;

Dept. of ECE, Aditya Engineering College(A) 27


Signals And Systems Lab B.Tech III semester

subplot(211);plot(t,y_real);title('real component of the complex


signal');
subplot(212);plot(t,y_imag);title('imaginary component of the
complex signal');
%Note: try with different frequency and amplitude of a complex
signal

Dept. of ECE, Aditya Engineering College(A) 28


Signals And Systems Lab B.Tech III semester

Precautions

1. file name should not contain any blank spaces


2. file name should not contain any command names such as ‘sin”, “cos”, “exp”
3. file name should not contain any numbers
4. Always publish the program with .pdf extension only
5. While publishing the program please ensure that, name, roll number and date are edited properly.
Procedure

1. Open Matlab software using run command.


2. Create a folder with roll number and locate the folder in the current directory of Matlab.
3. Edit and save the program in the current directory.
4. Use subplot command to generate all graphs in a single figure window.
5. Execute the program and generate the pdf file of the program using Matlab Publish

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 29


Signals And Systems Lab B.Tech III semester

Experiment No : 4 Date:_______________

Aim of the Experiment:

1. To verify linear convolution of two sequences


pparatus required: PC with Matlab Software

Impulse Response and Convolution Sum


Theory:

A discrete-time system performs an operation on an input signal based on predefined criteria to produce a
modified output signal. The input signal x(n)is the system excitation, and y(t) is the system response. This
transform operation is shown in the following figure.

X(n) Y(n) = T[x(n)]

if the input to the system is a unit impulse i.e., x(n) = δ(n) then the output of the system is known as impulse
response denoted by h(n) where h(n) = T[δ(n)]

we know that any arbitrary sequence x(n) can be represented as a weighted sum of discrete impulses. Now the
system response is given by

𝑦(𝑛) = 𝑥(𝑛) ∗ ℎ(𝑛) = 𝑇[𝑥(𝑛)] = ∑ 𝑥(𝑘)ℎ(𝑛 − 𝑘)


𝑘= − ∞

Process for finding the convolution sum of two sequences

➢ Step 1:Choose an initial value of n, the starting time for evaluating the output sequence y(n). where, n =
(n1 + n2) – 1, and n1 = length of sequence x(n) and n2 = length of sequence h(n).
➢ Step 2: Express both sequences x(n) and h(n) in terms of index ‘k’
➢ Step 3: Fold h(k) about k = 0 to obtain h(-k) and shift by n to the right if n is positive and left if n is
negative to obtain h(n-k)
➢ Step 4: Multiply the two sequences x(k) and h(n-k) element by element and sum up the products to get
y(n)
➢ Step 5: Increment the index n shift the sequence h(n-k) to right by one sample and do step – 4.
➢ Step 6: Repeat Step 5 until sum of products is zero for all the remaining values of n
Example

Write a matlab code to determine the convolution sum of two sequences

x(n) = {1,2,3,4} and h(n) = {4,3,2,1}

From the given sequences,

Dept. of ECE, Aditya Engineering College(A) 30


Signals And Systems Lab B.Tech III semester

Length of sequence x(n), n1 = 4,

Length of sequence h(n), n1 = 4,

Hence the length of output sequence y(n) will be n =( n1 + n2) – 1 = 7.

Follow the below procedure to find each value of Y

Matlab Program and Output plot

% Matlab program for finding convolution sum


clc;
close all;
clear;
x1=[1 2 3 4];
x2=[4 3 2 1];
k=1; sum1=0;
m=numel(x1); n=numel(x2);
s=(m+n-1);
fori=1:s
for j=1:m
h=i-j+1;
if h>0 && h<=n
sum1=sum1+(x1(j)*x2(h));
end
end
y(k)=sum1;
sum1=0;
k=k+1;
end
subplot(311);stem(x1);
Dept. of ECE, Aditya Engineering College(A) 31
Signals And Systems Lab B.Tech III semester

title('first signal');
subplot(312);stem(x2);
title('second signal');
subplot(313);stem(y);
title('convoluted signal');

Note: verify the output with MATLAB command “conv”

Precautions

1. file name should not contain any blank spaces


2. file name should not contain any command names such as ‘sin”, “cos”, “exp”
3. file name should not contain any numbers
4. Always publish the program with .pdf extension only
5. While publishing the program please ensure that, name, roll number and date are edited properly.

Procedure

1. Open Matlab software using run command.


2. Create a folder with roll number and locate the folder in the current directory of Matlab.
3. Edit and save the program in the current directory.
4. Use subplot command to generate all graphs in a single figure window.
5. Execute the program and generate the pdf file of the program using Matlab Publish

Dept. of ECE, Aditya Engineering College(A) 32


Signals And Systems Lab B.Tech III semester

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 33


Signals And Systems Lab B.Tech III semester

Experiment No : 5 Date:_______________

Aim of the Experiment:

1. To verify correlation of two sequences


pparatus required: PC with Matlab Software

Correlation of two sequences


Theory:

A mathematical operation known as correlation that closely resembles convolution. Correlation is basically used
to compare two sequences or signals. It has applications in radar and sonar system where the location of the target
is measured by comparing the transmitted and reflected signals. Other applications of correlation include image
processing etc.

The cross correlation between a pair of sequences or signals x(n) and y(n) is given by

𝑅𝑋𝑌 (𝑙) = ∑ 𝑥(𝑛)𝑦(𝑛 − 𝑙) , 𝑙 = 0, ±1, ±2 … … … ….


𝑛=−∞

Which is also given as:


𝑅𝑋𝑌 (−𝑙) = ∑ 𝑥(𝑛)𝑦(𝑛 + 𝑙) , 𝑙 = 0, ±1, ±2 … … … ….


𝑛=−∞

Note: if two sequences x(n) and y(n) are equal then, the kind of correlation between the signals is know as
“auto correlation”.

Which is given by:

𝑅𝑋𝑋 (𝑙) = ∑ 𝑥(𝑛)𝑥(𝑛 − 𝑙) , 𝑙 = 0, ±1, ±2 … … … ….


𝑛=−∞

Or

𝑅𝑋𝑋 (−𝑙 ) = ∑ 𝑥 (𝑛 )𝑥(𝑛 + 𝑙) , 𝑙 = 0, ±1, ±2 … … … ….


𝑛=−∞

Process for finding the correlation between two signals or sequences:

➢ Step 1obtain the sequence y(n-l) by shifting the sequence right by a time lag l
➢ Step 2 Multiply the shifted sequence y(n-1) by x(n) and sum all the values to obtain Rxx(l)
➢ Step 3 Repeat the steps 1 and 2 for all values of the time lag l.

Dept. of ECE, Aditya Engineering College(A) 34


Signals And Systems Lab B.Tech III semester

Example

Write a MATLAB code to determine the correlation of two sequences

x1(n) = {1,2,3,4} and x2(n) = {4,3,2,1}

From the given sequences,

Length of sequence x1(n), n1 = 4,

Length of sequence x2(n), n1 = 4,

Hence the length of output sequence y(n) will be n =( n1 + n2) – 1 = 7.

Follow the below procedure to find each value of Y

Matlab Program and Output plot

% Matlab program for finding the correlation as well as


convolution.
clc;
close all;
clear all;
x1=[1 2 3 4];
x2=[4 3 2 1];
x3=fliplr(x2); % time reversal of x2
k=1; sum1=0;sum2=0;
m=numel(x1); n=numel(x2);
s=(m+n-1);
fori=1:s
for j=1:m
h=i-j+1;

Dept. of ECE, Aditya Engineering College(A) 35


Signals And Systems Lab B.Tech III semester

if h>0 && h<=n


sum1=sum1+(x1(j)*x2(h));
sum2=sum2+(x1(j)*x3(h));
end
end
y(k)=sum1;
z(k)=sum2;
sum1=0;sum2=0;
k=k+1;
end
subplot(221);stem(x1);
title('first signal');
subplot(222);stem(x2);
title('second signal');
subplot(223);stem(y);
title('convoluted signal');
subplot(224);stem(z);
title('correlated signal');

Dept. of ECE, Aditya Engineering College(A) 36


Signals And Systems Lab B.Tech III semester

Note1: Verify the output with MATLAB commands “conv” as well as “xcorr” for the convolution and
correlation outputs respectively

Note2: If the two sequences x1 and x2 are equal, observe that, the correlation output pattern.

Precautions

1. file name should not contain any blank spaces


2. file name should not contain any command names such as ‘sin”, “cos”, “exp”
3. file name should not contain any numbers
4. Always publish the program with .pdf extension only
5. While publishing the program please ensure that, name, roll number and date are edited properly.

Procedure

1. Open Matlab software using run command.


2. Create a folder with roll number and locate the folder in the current directory of Matlab.
3. Edit and save the program in the current directory.
4. Use subplot command to generate all graphs in a single figure window.
5. Execute the program and generate the pdf file of the program using Matlab Publish

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 37


Signals And Systems Lab B.Tech III semester

Experiment No : 6 Date:_______________

Aim of the Experiment:

To verify the linearity and time invariance properties of a given LTI system.

pparatus required: PC with MATLAB Software

LTI System
Theory:

A system which shows the properties of Linearity and Time invariance is well known as an LTI system or Linear
Time Invariant System.

Linear System

x(t) h(t) y(t) = x(t)*h(t)

Let two input signals 𝒙𝟏 (𝒕) 𝑎𝑛𝑑 𝒙𝟐 (𝒕) 𝑤𝑖𝑡ℎ 𝑎𝑟𝑏𝑖𝑡𝑟𝑎𝑟𝑦 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑠 𝜶𝟏 𝑎𝑛𝑑 𝜶𝟐

and

𝑦1 (𝑡) = 𝑥1 (𝑡) ∗ ℎ(𝑡) … … … 1

𝑦2 (𝑡) = 𝑥2 (𝑡) ∗ ℎ(𝑡) … … … 2

𝑥(𝑡) = 𝜶𝟏 𝑥1 (𝑡) + 𝜶𝟐 𝑥2 (𝑡) … … … 3

𝑦(𝑡) = 𝑥(𝑡) ∗ ℎ(𝑡) = [𝜶𝟏 𝑥1 (𝑡) + 𝜶𝟐 𝑥2 (𝑡)] ∗ ℎ(𝑡) … … … 4

̂ = 𝜶𝟏 𝑦1 (𝑡) + 𝜶𝟐 𝑦2 (𝑡) … … … 5
𝑦(𝑡)

̂ 𝑡ℎ𝑒𝑛, 𝑡ℎ𝑒 𝑔𝑖𝑣𝑒𝑛 𝑠𝑦𝑠𝑡𝑒𝑚 𝑖𝑠 𝑐𝑎𝑙𝑙𝑒𝑑 𝑎𝑠 𝐿𝑖𝑛𝑒𝑎𝑟 𝑆𝑦𝑠𝑡𝑒𝑚


𝑖𝑓 𝒚(𝒕) = 𝒚(𝒕)

Time Invariant System


Impulse
Impulse System Response
function h(t)

For a given system by applying the impulse at the input side, one can find the impulse response of the system is
ℎ(𝑡) for a an impulse function 𝛿(𝑡).

𝛿(𝑡) h(t) = h1(t)

Dept. of ECE, Aditya Engineering College(A) 38


Signals And Systems Lab B.Tech III semester

Similarly for a delayed impulse function 𝛿(𝑡 − 𝜏 ) the corresponding impulse response is ℎ(𝑡 − 𝜏 )

𝛿(𝑡 − 𝜏) ℎ(𝑡 − 𝜏) = h2(t)

If the delayed impulse response due to an impulse function 𝛿(𝑡) will be equal to the impulse response obtained
due to delayed impulse function 𝛿(𝑡 − 𝜏). Then the given system is said as Time Invariant System.

𝑖. 𝑒. , ℎ1(𝑡 − 𝜏) = ℎ2(𝑡)

For the purpose of MATLAB simulation a moving average filter is considered with the following system
response:

𝑥(𝑛 − 1) + 𝑥(𝑛) + 𝑥(𝑛 + 1)


𝑦(𝑛) =
3
And the above system can be represented by a difference equation

𝑎1 𝑦(𝑛) = 𝑏1 𝑥(𝑛 − 1) + 𝑏2 𝑥(𝑛) + 𝑏3 𝑥(𝑛 + 1)

Then, the system coefficients are represented by

𝐵 = [1 1 1] 𝑎𝑛𝑑 𝐴 = [3]

MATLAB code

% matlab program for LTI system


clc;
clear all;
close all;
% time
t = -2:4;
% impulse function
d = (t==0);
% moving average filter coefficients
B = [1 1 1];
A = [3];
% impulse response of the moving average filter
h = filter(B,A,d);
% impulse function with one unit delay
d_delay = (t==1);
% impulse response due to delayed impulse
h_delay = filter(B,A,d_delay);
fori = 2:numel(t)
if h(i-1) == h_delay(i)
disp('the given system is a time invariant system')
Dept. of ECE, Aditya Engineering College(A) 39
Signals And Systems Lab B.Tech III semester

else
disp('the given system is not a time invariant system');
end
end
x1 = [1 2 3];
a1 = 2;
x2 = [2 1 2];
a2 = 4;
y1 = filter(B,A,x1);
y2 = filter(B,A,x2);
x = a1*x1 + a2*x2;
y = filter(B,A,x);
y1 = a1*y1 + a2*y2;
if (y==y1)
disp('the given system is a linear system')
else
disp('the given system is not a linear system')
end
Command window output:

Precautions

1. file name should not contain any blank spaces


2. file name should not contain any command names such as ‘sin”, “cos”, “exp”
3. file name should not contain any numbers
4. Always publish the program with .pdf extension only
5. While publishing the program please ensure that, name, roll number and date are edited properly.
Procedure

1. Open Matlab software using run command.


2. Create a folder with roll number and locate the folder in the current directory of Matlab.
3. Edit and save the program in the current directory.
4. Use subplot command to generate all graphs in a single figure window.
5. Execute the program and generate the pdf file of the program using Matlab Publish

Dept. of ECE, Aditya Engineering College(A) 40


Signals And Systems Lab B.Tech III semester

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 41


Signals And Systems Lab B.Tech III semester

Experiment No : 7 Date:_______________

Aim of the Experiment:

1. To verify the Fourier Transform and Inverse Fourier Transform of an aperiodic signal.
2. To plot the spectrum of a given Sinusoidal signal.

Apparatus required: PC with MATLAB Software

Fourier Transform
Theory:

A mathematical tool for converting a signal from time to frequency domain and vice-versa is commonly known
as Fourier Transform. The time domain signal extends from negative infinity to positive infinity, while each of
the frequency domain signals extends from zero to positive infinity. This frequency spectrum is shown in
rectangular form (real and imaginary parts); however, the polar form (magnitude and phase) is also used with
continuous signals. Just as in the discrete case, the synthesis equation describes a recipe for constructing the time
domain signal using the data in the frequency domain.

𝑥(𝑡) ⟷ 𝑋(𝜔)

𝑋(𝜔) = ∫ 𝑥(𝑡) 𝑒 −𝑗𝜔𝑡 𝑑𝑡


−∞


1
𝑥(𝑡) = ∫ 𝑋(𝜔) 𝑒 𝑗𝜔𝑡 𝑑𝜔
2𝜋
−∞

MATLAB code to determine Fourier Transform and Inverse Transform of a signal

Matlab Program and Output plot

clc;
clear all;
close all;
symsxt% by using matlab symbolic math tool box
x=exp(-5*t)*heaviside(t); % heavyside is known as unit step
function
y=fourier(x); % fourier is for finding fouriertrasnform
display(y)
%magnitude spectrum
mag=abs(y);
subplot(211);
ezplot(x);title('input signal')
subplot(212)
Dept. of ECE, Aditya Engineering College(A) 42
Signals And Systems Lab B.Tech III semester

ezplot(mag,[-10 10]);
title('Magnitude spectrum');
% Finding inversiefourier transform
x1 = ifourier(y);
display(x1)

Command window outputs


y = 1/(5 + w*1i) x1 = (exp(-5*x)*(sign(x) + 1))/2

Spectrum of a sinusoidal signal:

clc;
clear all;
close all;
%matlab program for spectrum of a signal
%time
t = 0:0.001:6;
%amplitude
A = 4;
%frequency of the signal
Dept. of ECE, Aditya Engineering College(A) 43
Signals And Systems Lab B.Tech III semester

f1 = 2;
% scanning frequency (variable)
f = -4:0.1:4;
% input sinusoidal signal
x = A*sin(2*pi*f1*t);
% Fourier Transform
fori = 1:numel(f)
X(i) = 0;
for j = 1:numel(t)
X(i) = X(i) + x(j)*exp(-1i*2*pi*f(i)*t(j));
end
end
plot(f,abs(X));grid
xlabel('frequency');ylabel('power');

Precautions

1. file name should not contain any blank spaces


2. file name should not contain any command names such as ‘sin”, “cos”, “exp”
3. file name should not contain any numbers
4. Always publish the program with .pdf extension only
Dept. of ECE, Aditya Engineering College(A) 44
Signals And Systems Lab B.Tech III semester

5. While publishing the program please ensure that, name, roll number and date are edited properly.

Procedure

1. Open Matlab software using run command.


2. Create a folder with roll number and locate the folder in the current directory of Matlab.
3. Edit and save the program in the current directory.
4. Use subplot command to generate all graphs in a single figure window.
5. Execute the program and generate the pdf file of the program using Matlab Publish

Conclusion:

Dept. of ECE, Aditya Engineering College(A) 45


Signals And Systems Lab B.Tech III semester

ExperimentNo: 8 Date:_________

Aim oftheExperiment:
ToverifytheLaplace Transformand InverseLaplaceTransformofan aperiodicsignal
Apparatusrequired:PCwithMATLABSoftware

LaplaceTransform
Theory:

The Laplace transform of a function is represented by L{f(t)} or F(s). Laplacetransformhelps to solve the
differential equations, where it reduces thedifferential equation into analgebraicproblem.
Laplacetransformistheintegraltransformofthegivenderivativefunctionwithrealvariablettoconvert
intoacomplexfunctionwith variables.
The Laplace transform of f(t), that is denoted by L{f(t)} or F(s) is defined by the Laplacetransformformula:
𝑓(𝑡) ⟷ 𝐹(𝑆)

𝐹(𝑆) = ∫ 𝑓(𝑡)𝑒 −𝑠𝑡
0

Matlab Program and Output


clc;
clear all;
close all;
symsxft% by using matlab symbolic math tool box
x=exp(-5*t)*heaviside(t);
y=laplace(x); % fourier is for finding fouriertrasnform
display(y)
%magnitude spectrum
mag=abs(y);
subplot(211);
ezplot(x);title('input signal')
subplot(212)
ezplot(mag,[-10 10]);
title('Magnitude spectrum');
% Finding inversiefourier transform
x1 = ilaplace(y);
display(x1)

Dept. of ECE, Aditya Engineering College(A) 46


Signals And Systems Lab B.Tech III semester

Command Window Output:

Plot:

Dept. of ECE, Aditya Engineering College(A) 47


Signals And Systems Lab B.Tech III semester

Experiment No : 9 Date:_____________

Aim of the Experiment:

To find the z-transform and pole-zero map in z-plane of a given signal.

Apparatus required: PC with MATLAB Software

Z – Transform

Theory:

For a discrete time signal 𝑥[𝑛] the Z-transform is defined as


𝑋[𝑍] = ∑ 𝑥[𝑛]𝑧 −𝑛
𝑛= −∞

Where, 𝑛: 𝑎𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟

𝑍 ∶ 𝐶𝑜𝑚𝑝𝑙𝑒𝑥 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 = 𝒓𝑒 𝑗𝝎

|𝑍| = 𝒓 𝑎𝑛𝑑 𝜔 = 𝑝ℎ𝑎𝑠𝑒 𝑎𝑛𝑔𝑙𝑒

For MATLAB simulation, consider a signal 𝑥[𝑛] = 𝑎𝑛 𝑢(𝑛)

For the given signal the transform will be


∞ ∞
2 3
𝑋[𝑍] = ∑ 𝑎 𝑛 𝑧 −𝑛 = ∑ (𝑎𝑧 −1 )𝑛 = 1 + 𝒂𝒛−𝟏 + (𝒂𝒛−𝟏 ) + (𝒂𝒛−𝟏 ) + … … … + ∞
𝑛= 0 𝑛= 0

the solution for the above equation will be the summation of infinity terms is given by

1 1 𝑧
𝑋[𝑍] = = −𝟏
=
1 − 𝑐𝑜𝑚𝑚𝑜𝑛 𝑓𝑎𝑐𝑡𝑜𝑟 1 − 𝒂𝒛 𝑧−𝑎

The condition for the solution will be

𝒂
{|𝒄𝒐𝒎𝒎𝒐𝒏 𝒇𝒂𝒄𝒕𝒐𝒓| < 1} ⇒ {|𝒂𝒛−𝟏 | < 1} ⇒ {| | < 1} ⇒ {|𝒛| > 𝑎}
𝒛

Dept. of ECE, Aditya Engineering College(A) 48


Signals And Systems Lab B.Tech III semester

Therefore, the region of convergence (ROC) is given by:

Pole – zero plot in Z-plane

𝑧 𝑃(𝑍) 𝑍𝑒𝑟𝑜𝑠
𝑋[𝑍] = = =
𝑧−𝑎 𝑄(𝑍) 𝑃𝑜𝑙𝑒𝑠

Zeros:are the locations in z-plane at which 𝑋[𝑍] will be zero

Hence, the zeros are at [z=0]

Poles:are the locations in z-plane at which 𝑋[𝑍] will be infinity

Hence, the pole are at [z = a]

Therefore, the pole-zero map in z-plane will be:

Dept. of ECE, Aditya Engineering College(A) 49


Signals And Systems Lab B.Tech III semester

Matlab Program and Output plot

clc;
clear all;
close all;
symsxanP
% an aperiodic input signal
x = a^n;
% Z-Transform
X = ztrans(x)
% Zeros
Z = [0];
% poles
P = [2];
% pole-zero plot in Z-plane
zplane(Z,P);
legend('zero','pole','z-plane');

Command window outputs

Dept. of ECE, Aditya Engineering College(A) 50


Signals And Systems Lab B.Tech III semester

Precautions

10. file name should not contain any blank spaces


11. file name should not contain any command names such as ‘sin”, “cos”, “exp”
12. file name should not contain any numbers
13. Always publish the program with .pdf extension only
14. While publishing the program please ensure that, name, roll number and date are edited properly.

Procedure

10. Open Matlab software using run command.


11. Create a folder with roll number and locate the folder in the current directory of Matlab.
12. Edit and save the program in the current directory.
13. Use subplot command to generate all graphs in a single figure window.
14. Execute the program and generate the pdf file of the program using Matlab Publish
Conclusion:

Dept. of ECE, Aditya Engineering College(A) 51


Signals And Systems Lab B.Tech III semester

Experiment No : 10 Date:_______________

Aim of the Experiment:

To verify sampling theorem using natural sampling method.

pparatus required: PC with MATLAB Software

Sampling Throrem
Theory:

A continuous time signal can be represented in its samples and can be recovered back when sampling frequency
fs is greater than or equal to the twice the highest frequency component of message signal. i. e.

𝑓𝑠 ≥ 2𝑓𝑚

Sampling of input signal x(t) can be obtained by multiplying x(t) with an impulse train δ(t) of period Ts. The
output of multiplier is a discrete signal called sampled signal which is represented with y(t)

you can observe that the sampled signal takes the period of impulse.

Matlab Program and Output plot

%matlab program for natural sampling


clc;
clear all;
close all;
t = 0:0.001:1;
f1 = 2;
x = sin(2*pi*f1*t);
f2 = 24;
c = (1 + square(2*pi*f2*t,20))*1/2;
x1 = x.*c;
subplot(311);
plot(t,x);title('original signal');
grid

Dept. of ECE, Aditya Engineering College(A) 52


Signals And Systems Lab B.Tech III semester

subplot(312);
plot(t,c);title('square wave with 20% duty cycle signal')
grid
axis([0 1 -0.2 1.2])
subplot(313)
plot(t,x1,t,x,'--');title('natural sampled signal');
grid
legend('natural sampled signal','original signal');

Precautions

15. file name should not contain any blank spaces


16. file name should not contain any command names such as ‘sin”, “cos”, “exp”
17. file name should not contain any numbers
18. Always publish the program with .pdf extension only
19. While publishing the program please ensure that, name, roll number and date are edited properly.
Procedure

15. Open Matlab software using run command.


16. Create a folder with roll number and locate the folder in the current directory of Matlab.
17. Edit and save the program in the current directory.
18. Use subplot command to generate all graphs in a single figure window.
19. Execute the program and generate the pdf file of the program using Matlab Publish
Conclusion:

Dept. of ECE, Aditya Engineering College(A) 53

You might also like