Professional Documents
Culture Documents
LABORATORY MANUAL
Regulations : AR20
Course code : 201EC3L02
Semester : III
Academic Year : 2022-2023
Department of
Electronics and Communication Engineering
Prepared by:
Mr. S Jagadeesh, Associate Professor
LIST OF EXPERIMENTS
Regulation: AR20
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.
Experiment No : 1 Date:_______________
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.
1 𝑎𝑡 𝑡 = 0
1 Unit Impulse Signal 𝛿(𝑡) = {
0 𝑒𝑙𝑠𝑒
1 𝑓𝑜𝑟 𝑡 ≥ 0
2 Unit Step Signal 𝑢(𝑡) = {
0 𝑒𝑙𝑠𝑒
S. Name of
Description Plot
No the Signal
Unit Ramp 1 𝑎𝑡 𝑡 = 0
3 𝛿(𝑡) = {
Signal 0 𝑒𝑙𝑠𝑒
𝑥(𝑡) = 𝐴𝑒 𝑏𝑡
Plot
𝑦(𝑡) = 𝐴 sin(2𝜋𝑓𝑡
+ ∅)
Where
Sinusoidal
5 A = Amplitude
Signal
f = frequency
∅ = Phase angle in
radians
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');
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');
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');
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');
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');
Precautions:
Procedure:
Conclusion:
Experiment No : 2 Date:_______________
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:
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).
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 ∶ 𝐴𝑡𝑡𝑒𝑛𝑢𝑎𝑡𝑒𝑑 𝑠𝑖𝑔𝑛𝑎𝑙
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.
𝒚(𝒕) = 𝒙𝟏 (𝒕). 𝒙𝟐 (𝒕)
Plot:
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)');
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')
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')
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');
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');
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');
Precautions
Conclusion:
Experiment No : 3 Date:_______________
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.
1 𝑓𝑜𝑟 𝑡 ≥ 0
𝑢(𝑡) = {
0 𝑒𝑙𝑠𝑒
Process for finding the even and odd parts of the signal
-3 0 1 0.5 -0.5
-2 0 1 0.5 -0.5
-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
For the above complex signal the real and imaginary parts can be represented as
and
𝐼𝑚𝑎𝑔(𝑤(𝑡)) = sin(𝜔𝑡)
Precautions
Conclusion:
Experiment No : 4 Date:_______________
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.
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
∞
➢ 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
title('first signal');
subplot(312);stem(x2);
title('second signal');
subplot(313);stem(y);
title('convoluted signal');
Precautions
Procedure
Conclusion:
Experiment No : 5 Date:_______________
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
∞
Note: if two sequences x(n) and y(n) are equal then, the kind of correlation between the signals is know as
“auto correlation”.
Or
∞
➢ 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.
Example
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
Procedure
Conclusion:
Experiment No : 6 Date:_______________
To verify the linearity and time invariance properties of a given LTI system.
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
Let two input signals 𝒙𝟏 (𝒕) 𝑎𝑛𝑑 𝒙𝟐 (𝒕) 𝑤𝑖𝑡ℎ 𝑎𝑟𝑏𝑖𝑡𝑟𝑎𝑟𝑦 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑠 𝜶𝟏 𝑎𝑛𝑑 𝜶𝟐
and
̂ = 𝜶𝟏 𝑦1 (𝑡) + 𝜶𝟐 𝑦2 (𝑡) … … … 5
𝑦(𝑡)
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 𝛿(𝑡).
Similarly for a delayed impulse function 𝛿(𝑡 − 𝜏 ) the corresponding impulse response is ℎ(𝑡 − 𝜏 )
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 1] 𝑎𝑛𝑑 𝐴 = [3]
MATLAB code
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
Conclusion:
Experiment No : 7 Date:_______________
1. To verify the Fourier Transform and Inverse Fourier Transform of an aperiodic signal.
2. To plot the spectrum of a given Sinusoidal signal.
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𝜋
−∞
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)
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
5. While publishing the program please ensure that, name, roll number and date are edited properly.
Procedure
Conclusion:
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
Plot:
Experiment No : 9 Date:_____________
Z – Transform
Theory:
𝑋[𝑍] = ∑ 𝑥[𝑛]𝑧 −𝑛
𝑛= −∞
Where, 𝑛: 𝑎𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟
𝑍 ∶ 𝐶𝑜𝑚𝑝𝑙𝑒𝑥 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 = 𝒓𝑒 𝑗𝝎
the solution for the above equation will be the summation of infinity terms is given by
1 1 𝑧
𝑋[𝑍] = = −𝟏
=
1 − 𝑐𝑜𝑚𝑚𝑜𝑛 𝑓𝑎𝑐𝑡𝑜𝑟 1 − 𝒂𝒛 𝑧−𝑎
𝒂
{|𝒄𝒐𝒎𝒎𝒐𝒏 𝒇𝒂𝒄𝒕𝒐𝒓| < 1} ⇒ {|𝒂𝒛−𝟏 | < 1} ⇒ {| | < 1} ⇒ {|𝒛| > 𝑎}
𝒛
𝑧 𝑃(𝑍) 𝑍𝑒𝑟𝑜𝑠
𝑋[𝑍] = = =
𝑧−𝑎 𝑄(𝑍) 𝑃𝑜𝑙𝑒𝑠
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');
Precautions
Procedure
Experiment No : 10 Date:_______________
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.
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