Ss Lab Manual With Scilab Programs
Ss Lab Manual With Scilab Programs
Roll No.
Batch : _________
1
SIGNALS AND SYSTEMS
(Course Code: 19EC305)
List of experiments
*Minimum eleven experiments to be conducted
Page
S. No. Name of the Experiment Marks Remarks
Number
2
Page
S.No. Name of the Experiment Marks Remarks
Number
Marks Avg :
3
19EC305 Signals and Systems
Course Outcomes
1 3 2 2 2 1 3
2 3 2 2 2 1 3
3 3 3 3 3 1 3
4 3 2 2 2 1 3
5 3 3 3 3 1 3
6 3 2 2 2 1 3
4
Text Book (s)
1. A.V. Oppenheim, A.S. Willsky and S.H. Nawab, Signals and Systems, PHI, 2nd Edition,
2015
2. B.P. Lathi, Signals, Systems & Communications, BS Publications, 2008
3. Won Y Yang, Signals and Systems with MATLAB, Springer publications, 2014
Reference Book(s)
1. Simon Haykin and Van Veen,Wiley, Signals & Systems, PHI, 2nd Edition, 2007
2. Michel J. Robert, Fundamentals of Signals and Systems, MGH International Edition, 2nd
Edition 2017
3. C. L. Philips, J.M.Parr and Eve A.Riskin, Signals, Systems and Transforms, Pearson
education, 3rd Edition, 2004
5
1. Generation of Discrete Sequences
Aim:- Write a program to generate the basic signals such as (i) unit step (ii) unit impulse (iii)
ramp (iv) periodic Sinusoidal sequences. Plot all the sequences.
Theory:-
x(t ) A sin ( t )
A amplitude
frequency in radians per sec ond
phase angle
A typical sinusoidal signal with arbitrary frequency is shown in figure.
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the file by using file menu
3. Write the program in new file
4. Click on save and run the icon
6
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
clc;
clear;
clf;
n=-5:5
// unit step
for i=1:11
if n(i)>=0 then
s(i)=1
else
s(i)=0;
end
end
subplot(411)
plot2d3(n,s);
xlabel('---> n');
ylabel('u(n)');
title('unit step sequence');
// unit impulse
for i=1:11
if n(i)==0 then
s(i)=1;
else
s(i)=0;
end
7
end
subplot(412)
plot2d3(n,s);
xlabel('---> n');
ylabel('unit impulse');
title('unit impulse sequence');
//Unit Ramp
for i=1:11
if n(i)>=0 then
s(i)=n(i);
else
s(i)=0;
end
end
subplot(413)
plot2d3(n,s);
xlabel('---> n');
ylabel('r(n)');
title('unit ramp sequence');
//sinusoidal signal
t=0:0.001:1;
T=1/4;
fm=1/T;
x=sin(2*%pi*fm*t);
subplot(414)
plot(t,x);
xlabel('---> t');
ylabel('sin');
title('sinusoidal signal');
t1=0:0.001:15;
e=exp(-t1)
8
//subplot(515)
figure;
plot(t1,e);
xlabel('---> t');
ylabel('exp(t)');
title('exponential signal');
Model Graphs:
Precautions:
Result:-
9
Viva-Voce Questions:
1. Draw the graphical form of sinc signal Sinc(t)
2. Draw the graphical form of exponential signal x(t)=3e2t u(-t)
3. Sketch the step signal x(t)=u(t-1)-u(t-2) and state whether it is causal or non-causal
4. Calculate the period of a signal x(t)=sin(2πt/5)cos(8 πt/5)
5. How u(t) and sgn(t) are related?
6. Sketch the signal 0.5 δ(t+3)-1.2 δ(t-1)+0.8 δ(t-4)-2.4 δ(t+5)
7. Draw the ramp signal r(-t+2)
8. Calculate sin t (t 2)dt
9. Is x(t)=e2tu(t) bounded or unbounded signal?
10. Find the energy of a signal u(t)-u(t-3).
10
2. Operations on signals
Aim:- Write a program to perform operations on signals such as time shifting, time reversal,
signal addition etc…
Theory:-
Time Shifting:
For the signal 𝑥(𝑡), signal 𝑥(𝑡 ± 𝑘) is called as time shifting of signal 𝑥(𝑡).
Types of time shifting:
• Right shifting (Time delay)
𝑥(𝑡 − 𝑘) is called as right shifted signal of 𝑥(𝑡) by an amount k
• Left Shifting (Advance in Time)
𝑥(𝑡 + 𝑘) is called as left shifted signal of 𝑥(𝑡) by an amount k
If signal 𝑥(𝑡) is defined as shown below
11
Then Left Shifted signal by an amount of 2 is 𝑥(𝑡 + 2)
Time Reversal:
• 𝑥(−𝑡) is called as time reversal of the signal 𝑥(𝑡)
If signal 𝑥(𝑡) is defined as shown below
• 𝑥(−𝑡) will be
12
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program:-
clc;
clear;
clf;
n=-7:7;
// first signal
for i=1:length(n)
if n(i)>=-2 then
s1(i)=1;
else
s1(i)=0;
end
end
s1=s1';
subplot(421);
plot2d3(n,s1);
xlabel('-------->t');
ylabel('-------->s1');
title('first signal')
s4=s1;
//unit step function
//disp(s1);
13
n1=-5:5;
for i=1:length(n1)
if n1(i)>=0 then
s2(i)=1;
else
s2(i)=0;
end
end
subplot(422);
plot2d3(n1,s2);
xlabel('-------->t');
ylabel('-------->s2');
title('second signal')
s2=s2';
//signal addition, subtraction, multiplication
if (min(n)<min(n1))
s2=[zeros(1,min(n1)-min(n)),s2];
n2start=min(n);
else
s1=[zeros(1,min(n)-min(n1)),s1];
n2start=min(n1);
end
if (max(n)<max(n1))
s1=[s1,zeros(1,max(n1)-max(n))];
n2end=max(n1);
else
s2=[s2,zeros(1,max(n)-max(n1))];
n2end=max(n);
end
n3=n2start:n2end
//signal addition
14
s3=s1+s2;
subplot(423);
plot2d3(n3,s3);
xlabel('-------->t');
ylabel('-------->s3');
title('addition of s1 and s2')
//signal subtraction
s5=s1-s2;
subplot(424);
plot2d3(n3,s5);
xlabel('-------->t');
ylabel('-------->s5');
title('subtraction of s1 and s2')
//signal multiplication
s6=s1.*s2;
subplot(425);
plot2d3(n3,s6);
xlabel('-------->t');
ylabel('-------->s6');
title('multiplication of s1 and s2')
//time reversal( signal folding)
g=-max(n):-min(n);
L=length(s4);
for i=1:length(g);
tr(i)=s4(L);
L=L-1;
end
subplot(426)
plot2d3(g,tr);
xlabel('-------->t');
ylabel('-------->tr');
title('time reversal of s1')
15
//time shifting
sa=5;
if(sa>0)
n=min(n):max(n)+sa;
s7=[zeros(1,sa),s4];
else
n=(min(n)+sa):max(n);
s7=[s4, zeros(1,-sa)];
end
subplot(427)
plot2d3(n,s7);
xlabel('-------->t');
ylabel('-------->s7');
title('time shifting of s1')
Model Graphs:
16
Precautions:
Precautions:
Result:-
Viva-Voce Questions:
17
3. Trigonometric Fourier Series
Aim:- Write a program to find the trigonometric Fourier series coefficients of a rectangular
periodic signal. Reconstruct the signal by combining the Fourier series coefficients with
appropriate weightings.
Theory:-
A function x(t) can be represented by a Fourier series comprising the following sine and
cosine functions
𝑥(𝑡) = 𝑎0 + 𝑎1 𝑐𝑜𝑠 𝜔0 𝑡 + 𝑎2 𝑐𝑜𝑠 2𝜔0 𝑡 + ⋯ + 𝑎𝑛 𝑐𝑜𝑠 𝑛𝜔0 𝑡 + 𝑏1 𝑠𝑖𝑛 𝜔0 𝑡 + 𝑏2 𝑠𝑖𝑛 2𝜔0 𝑡 + ⋯ +
𝑏𝑛 𝑠𝑖𝑛 𝑛𝜔0 𝑡 +…
∞
Program :-
clc;
clf;
clear;
t=-1:0.01:6;
18
fexact=4*(t>=-1)-6*(t>=3)+2*(t>=6);
subplot(221)
plot2d(t,fexact);
title('fexact');
n=1:8;
a0=10/7;
an=(2 ./(%pi*n)).*(3*sin(6*%pi*n/7)+2*sin(2*%pi*n/7)-sin(12*%pi*n/7));
bn=(2 ./(%pi*n)).*(-3*cos(6*%pi*n/7)+2*cos(2*%pi*n/7)+cos(12*%pi*n/7));
a=[a0,an];
b=[0,bn];
n1=[0,n];
subplot(222)
plot2d3(n1,a);
xlabel('n----->'),ylabel('an----->');
title('fourier coefficients');
subplot(223)
plot2d3(n1,b);
xlabel('n---->'),ylabel('bn---->');
title('(432)fourier co efficients');
a=[an];
b=[bn];
fapprox=zeros(1,length(t));
for k=1:length(n)
fapprox=fapprox+((an(k)*cos(2*%pi*n(k)*t/7))+(bn(k)*sin(2*%pi*n(k)*t/7)));
end
fapprox=a0+fapprox;
subplot(224);
//figure(1);
plot(t,fexact,t,fapprox);
legend('fexact','fapprox');
19
Model graphs:-
Precautions:
Result:-
20
Viva-Voce Questions:
21
4. Parseval’s Theorem
Aim:- Verify Parseval’s theorem for triangular periodic signal using Fourier series coefficients.
Theory:-
It is a property of Fourier series; it verifies the signal energy in time domain with frequency
domain. Consider a periodic signal 𝑥(𝑡)with period T sec, and assume Fourier series coefficients
as 𝐹𝑛 , Parseval’s theorem states that
∞
1 𝑇
∫ |𝑥(𝑡)|2 𝑑𝑡 = ∑ |𝐹𝑛 |2
𝑇 0
𝑛=−∞
Consider a signal as shown in the figure
2
; 𝑓𝑜𝑟 𝑜𝑑𝑑 𝑣𝑎𝑙𝑢𝑒𝑠 𝑜𝑓 𝑛
𝐹𝑛 = {𝜋 2 𝑛2
0; 𝑓𝑜𝑟 𝑒𝑣𝑒𝑛 𝑣𝑎𝑙𝑢𝑒𝑠 𝑜𝑓 𝑛
Therefore
∞
∑ |𝐹𝑛 |2 = 0.333
𝑛=−∞
Hence Parseval’s theorem is proved.
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
22
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
n=-5:2:5;
f0=1/2;
fn=2 ./(%pi^2*n^2) // for odd values of n only
power1=0;
for i=1:length(n)
power1=power1+(abs(fn(i))^2);
end
power1=power1+f0^2;
disp(power1);
Viva-Voce Questions:
24
5. Fourier Transform of a Square pulse
Aim:- Find the Fourier transform of a square pulse. Plot its amplitude spectrum.
Theory:-
Fourier transform is given by
∞
𝐹(𝜔) = ∫ 𝐹(𝑡)𝑒 −𝑗𝜔𝑡 𝑑𝑡
−∞
𝑇/2
𝐹(𝜔) = ∫ 𝐴𝑒 −𝑗𝜔𝑡 𝑑𝑡
−𝑇/2
𝜔𝑇
𝐹(𝜔) = 𝐴𝑇𝑠𝑖𝑛𝑐( )
2
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
25
Program :-
clc;
clf
clear;
t=-1:0.1:1;
j=sqrt(-1);
A=1;
T=1
f=A*(t>=-T/2)-A*(t>=T/2);
subplot(311);
plot2d2(t,f);
xlabel('t----->');
ylabel('f(t)----->');
title('square signal f(t)');
w=-100:0.01:100;
F=A*T.*(sinc(w*T/2))
subplot(312);
plot2d(w,F);
xlabel('f----->');
ylabel('F(w)----->');
title(' Fourier transform of square signal f(t)');
subplot(313);
plot2d(w,abs(F));
xlabel('f----->');
ylabel('mod F(w)----->');
title(' magnitude spectrum of f(t)');
26
Model graphs:-
Precautions:
Result:-
Viva-Voce Questions:
27
1
5. Find the Fourier Transform of using properties.
2 jt
2
1
6. Find the value of using parsevalls theorem
2 jw
7. Find the Fourier Transform of (t-1)e-tu(t)
d
8. Find the Fourier Transform of x (t ) , if x(t)=e-5tu(t)
dt
9. Draw both time and frequency domains of a signal x(t)=1
x(t )
10. If the Fourier Transform of x(t) is X(w), then the Fourier Transform of is
t
11. Determine the Fourier Transform of x(t)= Cos(2t)
28
6. Low Pass Filter
Aim:- Design the first order low pass passive filter for given specifications and Plot the
magnitude and phase responses.
Theory:-
Low-pass filter - Passes frequencies below a critical frequency, called the cutoff frequency, and
attenuates those above.
1, |𝜔| < 𝜔𝑐
|𝐻(𝜔)| = {
0, |𝜔| > 𝜔𝑐
𝜔𝑐 𝑖𝑠 𝑐𝑎𝑙𝑙𝑒𝑑 𝑐𝑢𝑡 − 𝑜𝑓𝑓 𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
clc;
clf;
29
clear;
r=1592;
c=0.1*(10^-6);
w=0.01:0.1:5000;
j=sqrt(-1);
wl=1/(2*%pi*r*c);
disp(wl);
H=1 ./(1+j*(w./wl));
A=abs(H);
P=-atand((2*%pi*r*c*w));
AD=20*log10(A);
subplot(211);
plot2d("ln",w,AD);
xlabel('frequency in Hzs');
ylabel('amplitude');
title('amplitude response');
subplot(212);
plot2d("ln",w,P);
xlabel('frequency in Hzs');
ylabel('phase in degrees');
title('phase response');
30
Model graphs :-
Precautions:
Result:-
31
Viva-Voce Questions:
1. Find the bandwidth of a RC Low Pass Filter Circuit
2. Draw the ideal characteristics of Band Elimination filter
3. Obtain the transfer function of a system having impulse response h(t)= e-2tu(t)
4. Find the response of a linear system having input x(t)=(t-1) and impulse response
h(t)=u(t)
5. Draw a simple RC low pass filter circuit and obtain its system function
6. Determine the transfer function of a system having input x(t)=(t-1) and output
y(t)= )=(t+1)
1
7. Find the Fourier Transform of using properties.
2 jt
4
8. Obtain the frequency domain of time domain
4 t2
2
1
9. Find the value of using parsevalls theorem
2 jw
10. Find the Fourier Transform of te-tu(t)
32
7. High Pass Filter
Aim:- Design the first order high pass passive filter for given specifications and Plot the
magnitude phase responses.
Theory:-
High-pass filter - Passes frequencies above the critical frequency but rejects those below.
0, |𝜔| < 𝜔𝑐
|𝐻(𝜔)| = {
1, |𝜔| > 𝜔𝑐
𝜔𝑐 𝑖𝑠 𝑐𝑎𝑙𝑙𝑒𝑑 𝑐𝑢𝑡 − 𝑜𝑓𝑓 𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦
𝐻(𝜔)
𝜔𝑐 𝜔
Stop-band Passband
Vo
Vs
“ideal”
0 dB
–3 dB
fc (Hz)
actual
cutoff frequency
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
33
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
clc;
clf;
clear;
r=1594;
c=0.1*(10^-6);
w=1:10:10000;
j=sqrt(-1);
w1=1/(2*%pi*(r*c));
H=w./ (w-j+w1)
A=abs(H);
P=atand(w1./w)
AD=20*log10(A);
subplot(211);
plot2d("ln",w,AD);
xlabel('frequency');
ylabel('amplitude in dB');
title('amplitude response ');
subplot(212);
plot("ln",w,P);
xlabel('frequency');
ylabel('phase in degrees');
title('phase response');
ylabel('phase');
34
title('phase response');
Model graphs:-
Precautions:
35
Viva-Voce Questions:
36
8. Response of LTI System
Aim:- Generate response of LTI system, whose impulse response ℎ(𝑡) = 𝑢(𝑡) and input
𝑥(𝑡) = 𝑒 −𝑎𝑡 𝑢(𝑡)
Apparatus:- MATLAB/SCI LAB
Theory:-
Linear time-invariant systems (LTI systems) are a class of systems used in signals and
systems that are both linear and time-invariant. Linear systems are systems whose outputs for a
linear combination of inputs are the same as a linear combination of individual responses to
those inputs. Time-invariant systems are systems where the output does not depend on when an
input was applied. These properties make LTI systems easy to represent and understand
graphically.
If x(t) input to the LTI system, whose impulse response is h(t), then output of system y(t) is
LTI
∞
𝒚(𝒕) = ∫ 𝒙(𝝉)𝒉(𝒕 − 𝝉)𝒅𝝉
−∞
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
clear;
close;
37
clc;
Max_Limit = 10;
h = ones(1,Max_Limit);
N2 =0:length(h)-1;
a = 0.5; // constant a>0
for t = 1:Max_Limit
x(t)= exp(-a*(t-1));
end
N1 =0:length(x)-1;
y = convol(x,h)-1;
N = 0:length(x)+length(h)-2;
figure
a=gca();
plot2d(N2,h)
xtitle('Impulse Response','t','h(t)');
a.thickness = 2;
figure
a=gca();
plot2d(N1,x)
xtitle('Input Response', 't', 'x( t )');
a.thickness = 2;
figure
a=gca();
plot2d(N(1:Max_Limit),y(1:Max_Limit))
xtitle( 'Output Response', 't', 'y( t )');
a.thickness = 2;
38
Model graphs:
39
Precautions:
Result:-
Viva-Voce Questions:
40
9. Sampling
Aim:- Generate a discrete time sequence by sampling a continuous time signal.
Theory:-
The method of obtaining a discrete-time representation of a continuous-time signal is
through periodic sampling, wherein a sequence x[n] is obtained from a continuous-time signal
xc(t) :
Then xc(t) is uniquely determined by its samples x[n] = xc(nT), n = 0,±1,±2, ... ,
if
41
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
clear ;
clf;
tmin=-1;
tmax=1;
t=tmin:0.001:tmax;
xa=sin(2*%pi*25*t)+sin(2*%pi*15*t);
//xa=exp(-10*abs(t));
Fs=30;
Ts=1/Fs;
n=tmin/Ts:tmax/Ts;
//x=exp(-10*abs(n*Ts));
x=sin(2*%pi*25*n*Ts)+sin(2*%pi*15*n*Ts);
figure(1);
subplot(211);
plot(t,xa);
title('analog signal');
42
subplot(212);
plot2d3(n,x);
title('discrete time signal for FS=30Hz');
Model graphs:
Precautions:
Result:-
43
Viva-Voce Questions:
d
1. If the Nyquist rate of a signal x(t) is w0, then the Nyquist rate of a signalx (t )
dt
2. A band limited signal x(t) of finite energy can be completely reconstructed from its
samples when the samples taken at the rate of fs2w samples per second or it can be
completely reconstructed when the sampling interval is
3. What is the phenomenon of high frequency component taken on the identity of low
frequency component
4. What is the condition to avoid aliasing?
5. Define Sampling
6. State sampling theorem
7. What is aliasing effect?
8. How to covert a continuous time signal into discrete time signal
9. How to reconstruct a signal from its sampled version
10. List out the different types of sampling techniques
44
10. Reconstruction of the signal
Aim:- Reconstruct the signal from the discrete samples with and without aliasing effect
Theory:-
The method of obtaining a discrete-time representation of a continuous-time signal is
through periodic sampling, wherein a sequence x[n] is obtained from a continuous-time signal
xc(t) :
Then xc(t) is uniquely determined by its samples x[n] = xc(nT), n = 0,±1,±2, ... ,
if
45
Procedure:
1. Open the MATLAB/SCI LAB software by double clicking the icon on desktop.
2. Open the new File by using file menu
3. Write the program in new file
4. Click on save and run the icon
5. Perform error check which displayed on command window
6. Plot the waveforms which displays on figure window.
7. Note down the values, which displays on the work space.
Program :-
clc;
clear ;
clf;
tmin=-1;
tmax=1;
t=tmin:0.001:tmax;
xa=sin(2*%pi*25*t)+sin(2*%pi*15*t);
//xa=exp(-10*abs(t));
Fs=30;
Ts=1/Fs;
n=tmin/Ts:tmax/Ts;
//x=exp(-10*abs(n*Ts));
x=sin(2*%pi*25*n*Ts)+sin(2*%pi*15*n*Ts);
figure(1);
subplot(211);
plot(t,xa);
46
title('analog signal');
subplot(212);
plot2d3(n,x);
title('discrete time signal for FS=30Hz');
figure(2);
subplot(211);
//hold on;
plot2d3(n*Ts,x);
for i=1:size(x,2)
xsinc(i,:)=x(i)*sinc(Fs*(t-(i+min(n)-1)*Ts));
plot(t, xsinc(i,:));
end
title('signal reconstruction');
sum1=zeros(1,size(xsinc,1));
for i=1:size(xsinc,1)
for j=1:size(xsinc,2)
sum1(i)=sum1(i)+xsinc(i,j);
end
end
//hold off;
//xar=sum(xsinc);
subplot(212);
plot(n*Ts,sum1);
title('Reconstructed signal when Fs<2fm i.e Fs=30');
//legend('reconstructed signal xa(t)');
Model graphs:
47
Fig. Reconstructed signal with aliasing effect
48
Precautions:
Result:-
Viva-Voce Questions:
d
1.If the Nyquist rate of a signal x(t) is w0, then the Nyquist rate of a signalx (t )
dt
2.A band limited signal x(t) of finite energy can be completely reconstructed from its
samples when the samples taken at the rate of fs2w samples per second or it can be
completely reconstructed when the sampling interval is ------
3.What is the phenomenon of high frequency component taken on the identity of low
frequency component?
4. What is the condition to avoid aliasing?
5. Define Sampling
6. State sampling theorem
7. What is aliasing effect?
49