• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
 
SignalsandSystem
November 25
2010 
Submitted By: Shravan Kumar LuitelGroup: Electrical and Electronics (Communication )Roll no: 31015
 
Lab sheet -4
 
2
1.
 
Write a Matlab code for sampling following signal.
 
x
(t) =sin (2F 
1
t) + sin (2F2t)
T
ake the time range t= [0:0.1:20]F1=0.1 and F2=0.2
 Code:
X
label ('n');Ylabel ('x_samples');Title ('Sample');x_recon=0;subplot (3,1,3);for k=0:length(x_samples)-1stem (0:length(x_samples)-1,x_samples);l=k:-.1:-20+k;x_recon=x_recon+x_samples(k+1)*sinc(l);axis ([0 20 -2 2]);hold ;plot (t,x_recon,'ko');end;xlabel('t');ylabel ('x_recon');title ('Reconstructed Signal');
Figure:
 
2.
 
Find D
T
F
T
for given specificationsNum= [1 -0.6]Den= [2 1]Plot magnitude spectrum and phase spectrum.
Code:
Num = [1 -.6];
 
Den = [2 1];
 
0 2 4 6 8 10 12 14 16 18 20-202t
    x      (      t      )
Given Signal0 5 10 15 20 25-202n
    x
    s
    a    m    p      l    e    s
Sample0 2 4 6 8 10 12 14 16 18 20-202t
    x
    r
    e    c    o    n
Reconstructed SignalLabsheet-4::Question-1
 
3
w
= -4*pi:8*pi/512:4*pi;
 
h=freqz (num,den,
w)
;
 
subplot (2,2,1
)
;
 
plot (real(h
)
,'k.'
)
;
 
title ('Plot of real(h
)
'
)
;
 
SUBPLOT (2,2,2
)
;
 
Plot (imag(h
)
,'ko'
)
;
 
Title ('Plot of Imag(h
)
'
)
;
 
Subplot (2,2,3
)
;
 
Plot (angle(h
)
,'kx'
)
;
 
Title ('Plot of phase spectrum'
)
;
 
Subplot (2,2,4
)
;
 
Plot (abs(h
)
,'k-'
)
;
 
Title ('Plot of magnitude spectrum'
)
;
Figure:
3
.
 
Write a Matlab code for finding C
T
F
T
of following signal.a.
 
x(
t)=2cos
(
10t)b.
 
x(
t)=ce
5t
 Plot magnitude spectrum and phase spectrum.b.
Code:
 
t=0:0.01:2;
 
c=2;
 
x=c* exp (5*t
)
;
 
N=100;
 
y=fft(x,N
)
;
 
subplot (3,1,1
)
;
 
plot (t,x,'k*'
)
;
 
title ('Given Signal x(t
)
=2cos(10*pi*t
)
'
)
;
 
subplot (3,1,2
)
;
 
plot (abs(y
)
,'ks'
)
;
 
title ('Plot of abs(y
)
'
)
;
 
subplot (3,1,3
)
;
 
plot (angle(y
)
,'kd'
)
;
 
title ('Plot of angle(y
)
'
)
;
0 100 200 300 400 500 60000.511.52Plot of real(h)0 100 200 300 400 500 600-1-0.500.51Plot of Imag(h)0 100 200 300 400 500 600-1.5-1-0.500.511.5Plot of phase spectrum0 100 200 300 400 500 60000.511.52Plot of magnitude spectrumLabsheet-4::Question-3
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...