0% found this document useful (0 votes)
75 views49 pages

Ss Lab Manual With Scilab Programs

Uploaded by

Mannered Zone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views49 pages

Ss Lab Manual With Scilab Programs

Uploaded by

Mannered Zone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

SIGNALS AND SYSTEMS

(Course Code: 19EC305)


B.Tech (Electronics and Communication Engineering)
3rd Semester

Name of the Student: _______________________________

Roll No.

Batch : _________

Department of Electronics and Communication Engineering

GMR INSTITUTE OF TECHNOLOGY


(An Autonomous Institute Affiliated to JNTUK, Kakinada)
(Accredited by NBA, NAAC with grade ‘A’ & ISO 9001:2008 Certified Institution)
Approved by AICTE, New Delhi
GMR NAGAR, RAJAM-532 127

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. Interpret various types of signals and systems and their operations


2. Explain signal approximation using Fourier series
3. Execute Fourier transform and Laplace transform of continuous signals
4. Summarize the characteristics of the LTI system and its properties
5. Compute LTI system response using convolution, correlation
6. Interpret sampling process and it’s effects

COs PO1 PO2 PO4 PO5 PO12 PO14

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

3–Strongly linked | 2–Moderately linked| 1–Weakly linked

List of programs (Eleven programs to be done)

Implement the following using SCILAB /MATLAB

1. Familiarization with SCILAB/MATLAB: Matrix operations, plotting, relational


operators, loops and functions
2. Generation of basic signals: Exponential, step, impulse, ramp, sinusoidal signals
3. Operations on signals: Signal addition, folding, shifting and multiplication
4. Find the trigonometric Fourier series coefficients of a rectangular periodic signal and
reconstruct the Signal by combining the Fourier series coefficients with appropriate
weights
5. Verification of Parseval’s theorem
6. Find the Fourier transform of a square pulse. Plot its amplitude and phase spectrum
7. Design the first order low pass passive filter for given specifications and Plot the
magnitude and phase response
8. Design the first order high pass passive filter for given specifications and Plot the
magnitude and phase response
9. Generate the response of an LTI system for the given input and impulse response
10. Generate a discrete time sequence by sampling a continuous time signal.
11. Reconstruction of a signal from the discrete samples with and without aliasing effect.

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.

Apparatus:- MATLAB/SCI LAB

Theory:-

(i) Unit step signal


The second basic sequence is the unit step sequence; u (n) is defined as
u(n) =1 n  0
=0 n 0
The unit step sequence shifted by k samples is given by
u(n-k) = 1 n k
=0 n 0
The unit impulse and unit step sequences are related by
 (n)= u(n) – u(n-1).
(ii) Unit impulse signal
The simplest and one of the most useful sequences is the unit sample sequence often called as the
discrete time impulse or the unit impulse  (n) defined as
 (n) =1 n=0
=0 n0
The unit impulse sequence shifted by k samples is thus given by
 (n-k) =1 n=k
=0 nk
Any arbitrary sequence can be represented as a sum of weighted time – shifted unit impulse
sequences.
(iii) Unit ramp signal
The unit ramp signal ur(n) is defined as
r(n) = n; n≥0
= 0; n<0
(iv) Sinusoidal

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:

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.

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…

Apparatus:- MATLAB/SCI LAB

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

Then right Shifted signal by an amount of 2 is 𝑥(𝑡 − 2)

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

1.Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.

Result:-

Viva-Voce Questions:

1. For the given signal x(t), find the following


i. x(2t+5) ii. x(-t-2) iii. Even part of x(t)

2. Explain different operations on signal

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.

Apparatus:- MATLAB/SCI LAB

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 𝑡 +…

𝑥(𝑡) = 𝑎0 + ∑(𝑎𝑛 𝑐𝑜𝑠 𝑛𝜔0 𝑡 + 𝑏𝑛 𝑠𝑖𝑛 𝑛𝜔0 𝑡), 𝑡0 ≤ 𝑡 ≥ 𝑡0 + 𝑇


𝑛=1
Where ‘an’ and ‘bn’ are Fourier coefficients; b0=0 since 𝑠𝑖𝑛 𝑛𝜔0 𝑡 = 0 𝑓𝑜𝑟 𝑛 = 0
The other Fourier coefficients are given by
1 𝑡 +𝑇
𝑎0 = 𝑇 ∫𝑡 0 𝑥(𝑡)𝑑𝑡 ; This is called DC coefficients or average value of x(t)
0
2 𝑡0 +𝑇
𝑎𝑛 = ∫ 𝑥(𝑡)𝑐𝑜𝑠 𝑛𝜔0 𝑡𝑑𝑡
𝑇 𝑡0
2 𝑡0 +𝑇
𝑏𝑛 = ∫ 𝑥(𝑡)𝑠𝑖𝑛 𝑛𝜔0 𝑡𝑑𝑡
𝑇 𝑡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;
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:

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab
in-charge.

Result:-

20
Viva-Voce Questions:

1. What is Gibbs phenomena?


2. When the two complex signals x(t) and g(t) are said to be orthogonal?
3. Write the expression for an even signal of trigonometric Fourier series
4. Justify the statement “ signals with half wave symmetry have only odd hormonics”
5. Approximation of a signal x(t) by g(t) is x(t) = c g(t). Denote the value of constant c for
good approximation.
6. How to represent a periodic signal by the Fourier series

21
4. Parseval’s Theorem
Aim:- Verify Parseval’s theorem for triangular periodic signal using Fourier series coefficients.

Apparatus:- MATLAB/SCI LAB

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

The energy of a signal 𝑥(𝑡) in one time period is


1 𝑇
∫ |𝑥(𝑡)|2 𝑑𝑡=
𝑇 0
0.33 joules
Exponential Fourier series coefficient

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

//parsevals theorem verification for triangular periodic function


//Triangular function is defined in the interval(-1,1) with amplitude 1
//the above said signal has power 1/3.
clc;
clf;
clear;
t=-1:0.1:1;
j=sqrt(-1);
A=2;
T=1

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

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
23
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.
Result:-

Viva-Voce Questions:

1. Define Parsevals theorem?


2. How to represent a periodic signal by the Fourier series?
3. What is the application of Parsevals theorem?

24
5. Fourier Transform of a Square pulse
Aim:- Find the Fourier transform of a square pulse. Plot its amplitude spectrum.

Apparatus:- MATLAB/SCI LAB

Theory:-
Fourier transform is given by

𝐹(𝜔) = ∫ 𝐹(𝑡)𝑒 −𝑗𝜔𝑡 𝑑𝑡
−∞

For a given square pulse

𝑇/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:

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab
in-charge.

Result:-

Viva-Voce Questions:

1. Find the Fourier Transform of an anti causal signal


2. x(t)=2e3tu(-t)
3. Find the Fourier Transform of a causal signal x(t)=3e-2tu(t)
4. Find the Fourier Transform of x(t)=ej3t

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.

Apparatus:- MATLAB/SCI LAB

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:

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.

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.

Apparatus:- MATLAB/SCI LAB

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:

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab
in-charge.
Result:-

35
Viva-Voce Questions:

1. Why stable systems are called BIBO systems?


2. When the system is said to be time invariant?
3. How to test the causality of a system?
4. How to examine the stability of a continuous time system?
5. Draw a simple RC high pass filter circuit and obtain its system function
6. Find the bandwidth of a RC high pass Filter Circuit
7. Band width of a distortion less transmission system is
8. For which type of system, the magnitude response is constant and phase response is
linear?
9. What type of system is described by a difference equation?
10. Which of the following system is Time Invariant ?
(i) y(t)=T[x(t)]=tx(t) (ii) y(t)=T[x(t)]=t+x(t)

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

Impulse response h(t)


X(t) Y(t)


𝒚(𝒕) = ∫ 𝒙(𝝉)𝒉(𝒕 − 𝝉)𝒅𝝉
−∞

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:

1. Check out source file is with ‘.m’ /'.sce' extension or not.


2. The file name should begin with character and should not contain any punctuation
marks.
File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.

Result:-

Viva-Voce Questions:

1. Formulate convolution of x(t) and h(t)


2. Define LTI system
3. Illustrate impulse response of LTI system

40
9. Sampling
Aim:- Generate a discrete time sequence by sampling a continuous time signal.

Apparatus:- MATLAB/SCI LAB

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

x [n]= xc (t) ∣t=nT =x (nT) −∞ ≤n ≥∞

T is the sampling period. fs=1/T is sampling frequency.

Nyquist Sampling Theorem


Let xc(t) be a bandlimited signal with

Then xc(t) is uniquely determined by its samples x[n] = xc(nT), n = 0,±1,±2, ... ,

if

Aliasing is a phenomenon in which a high frequency component in the frequency


spectrum of signal takes identity of a lower frequency component in the spectrum of the sampled
signal. Hence, the signal is under sampled when fs<2fm and some amount of aliasing is produced.
When a continuous time band limited signal is sampled at a rate lower than the Nyquist rate,
fs<2fm, then successive cycles of the spectrum X(ω) of the sampled signal x(t) overlap with each
other.

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:

1.Check out source file is with ‘.m’ /'.sce' extension or not.


2.The file name should begin with character and should not contain any punctuation marks.
3. File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.

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 fs2w 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

Apparatus:- MATLAB/SCI LAB

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

x [n]= xc (t) ∣t=nT =x (nT) −∞ ≤n ≥∞

T is the sampling period. fs=1/T is sampling frequency.

Nyquist Sampling Theorem


Let xc(t) be a bandlimited signal with

Then xc(t) is uniquely determined by its samples x[n] = xc(nT), n = 0,±1,±2, ... ,

if

Aliasing is a phenomenon in which a high frequency component in the frequency


spectrum of signal takes identity of a lower frequency component in the spectrum of the sampled
signal. Hence, the signal is under sampled when fs<2fm and some amount of aliasing is produced.
When a continuous time band limited signal is sampled at a rate lower than the Nyquist rate,
fs<2fm, then successive cycles of the spectrum X(ω) of the sampled signal x(t) overlap with each
other.

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

Fig. Reconstructed signal without aliasing effect

48
Precautions:

1.Check out source file is with ‘.m’ /'.sce' extension or not.


2.The file name should begin with character and should not contain any punctuation marks.
3.File name should not be any in built in function name or any keyword
4. Save the .m files preferably in work folder of MATLAB/SCI LAB .
5. Don’t delete any file or folder without informing the system administrator or lab in-
charge.

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 fs2w 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

You might also like