Signals and System 


Write a Matlab code for sampling following signal.
x (t) =sin (2πF1t) + sin (2πF2t)
Take the time range t= [0:0.1:20]
F1=0.1 and F2=0.2
Code:
Xlabel (‘n’);
Ylabel (‘x_samples’);
Title (‘Sample’);
x_recon=0;
subplot (3,1,3);
for k=0:length(x_samples)1
stem (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:

Find DTFT for given specifications
Num= [1 0.6]
Den= [2 1]
Plot magnitude spectrum and phase spectrum.
Code:
Num = [1 .6];
Den = [2 1];
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:

Write a Matlab code for finding CTFT of following signal.
 x(t)=2cos(10πt)

x(t)=ce^{5t}
Plot magnitude spectrum and phase spectrum.
b. Code:
 x(t)=2cos(10πt)
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)’);
 Figure:
 Code:
t=0:0.01:2;
x=2*cos(10*pi*t);
N=100;
y=fft(x,N);
subplot (3,1,1);
plot (t,x,’kp’);
grid;
title (‘Given Signal x(t)=2cos(10*pi*t)’);
subplot (3,1,2);
plot (abs(y),’k’);
grid;
title (‘Plot of abs(y)’);
subplot (3,1,3);
plot (angle(y),’k:’);
grid;
title (‘Plot of angle(y)’);

Figure:
Dear readers feel free to download the WORD version @ http://www.scribd.com/doc/44305943/LabSheet4 VISIT SITE
OR
download the WORD 2003 version from the MY SHARED box at the topleft of this page
OR visit Box.net for alternate download link:
VISIT SITE
dammi yaar abo auta assignment ko bhinnai section banauna paryo …ani ta daro hits auccha timro blog ma pani …