You are on page 1of 14

IMPULSERESPONSEANDLAPLACETRANSFORM

AIM:TowriteamatlabprogramtofindtheimpulseresponseofH(s)=s1/s^2+3s+2.
clc;
clearall;
closeall;
symsscomplex;
H=(s1)/(s^2+3*s+2);
disp('Impulseresponseofthesystemh(t)is');
h=ilaplace(H);
simplify(h);
disp(h);
t=0:0.1:20;
h1=subs(h,t);
plot(t,h1);
xlabel('time');
ylabel('h(t)');
title('Impulseresponseofthesystem');

RESULT:
ThustheGenerationofimpulseresponseoftheLTIsystemiscompleted.

OUTPUT:

Impulseresponseofthesystemh(t)is3*exp(2*t)2*exp(t)

OUTPUT:

FOURIERTRANSFORMSANDINVERSEFOURIERTRANSFORMS

AIM:TofindFouriertransformandinverseFouriertransformsofgivenfunctions.

PROGRAM:
TofindFouriertransform

clc;clearall;closeall;
symsts;symswreal;
symsAreal;symsoreal;symsbfloat;
f=dirac(t);
F=fourier(f);
disp('theFouriertransformofdirac(t)=');
disp(F);
f1=A*heaviside(t);
F1=fourier(f1);
disp('theFouriertransformofA=');
disp(F1);
f2=A*exp(t)*heaviside(t);
F2=fourier(f2);
disp('theFouriertransformofexp(t)u(t)=');
disp(F2);
f3=A*t*exp(b*t)*heaviside(t);
F3=fourier(f3);
disp('theFouriertransformofA*t*exp(b*t)*u(t)=');
disp(F3);
f4=sin(o*t);
F4=fourier(f4);
disp('theFouriertransformofsin(o*t)=');
disp(F4);

TofindinverseFouriertransformsofGivenfunctions.

F1=A*pi*(dirac(wo)+dirac(w+o));
f1=ifourier(F1,t);
disp('theinverseFouriertransformofA*pi*(dirac(wo)+dirac(w+o)=');
disp(f1);
F2=A*pi*(dirac(wo)dirac(w+o))/i;
f2=ifourier(F2,t);
disp('theinverseFouriertransformofA*pi*(dirac(wo)+dirac(w+o)/i=');
disp(f2);
F3=A/(1+i*w);
f3=ifourier(F3,t);
disp('theinverseFouriertransformofA/(1+jw)=');
disp(f3);

F4=(3*i*w+14)/((i*w)^2+7*i*w+12);
f4=ifourier(F4,t);
disp('theinverseFouriertransformof(3*i*w+14)/((i*w)^2+7*i*w+12)=');
disp(f4);

RESULT:ThustheMATLABprogramtofindFouriertransformandinverseFouriertransformofgiven
functionsissuccessfullycompleted.

OUTPUT:
theFouriertransformofdirac(t)=1

theFouriertransformofA=A*(pi*dirac(w)i/w)

theFouriertransformofexp(t)u(t)=
A/(1+i*w)

theFouriertransformofA*t*exp(b*t)*u(t)=
A/(b+i*w)^2

theFouriertransformofsin(o*t)=
i*pi*(dirac(w+o)dirac(wo))

theinverseFouriertransformofA*pi*(dirac(wo)+dirac(w+o)=
A*cos(o*t)

theinverseFouriertransformofA*pi*(dirac(wo)+dirac(w+o)/i=
A*sin(o*t)

theinverseFouriertransformofA/(1+jw)=
A*exp(t)*heaviside(t)

theinverseFouriertransformof(3*i*w+14)/((i*w)^2+7*i*w+12)=
heaviside(t)*(2*exp(4*t)+5*exp(3*t))

MAGNITUDEANDPHASESPECTRUMOFFOURIERTRANSFORMS

AIM:.TofindFouriertransformofthegivensignalandtoplotitsmagnitudeandphasespectrum.

PROGRAM:
clc;clearall;closeall;
symsts;
symswfloat;
f=3*exp(t)*heaviside(t);%givenfunction
F=fourier(f);%tofindFourierTransform
disp('thefouriertransformof3*exp(t)*u(t)=');
disp(F);%todisplaytheresultinthecommandwindow
w=2*pi:pi/50:2*pi;
F1=subs(F,w);%substitutewinFfunction
Fmag=abs(F1);%tofindmagnitude
Fphas=angle(F1);%tofindphase
subplot(2,1,1);
plot(w,Fmag);
xlabel('w>');
ylabel('Magnitude>');
title('Magnitudespectrum');
grid;
subplot(2,1,2);
plot(w,Fphas);
xlabel('w>');
ylabel('Phaseinradians>');
title('Phasespectrum');
grid;

RESULT:ThustheMATLABprogramtofindFouriertransformandplottingofmagnitudeand
Phasespectrumsissuccessfullycompleted.

OUTPUT:

Thefouriertransformof3*exp(t)*u(t)=
3/(1+i*w)

LAPLACETRANSFORM

AIM:.MATLABprogramtocalculatetheLaplacetransform.

PROGRAM:
clc;
closeall;
clearall;
symssb;
F=3*exp(2*b)2*exp(b);
f=laplace(F)

RESULT:ThustheMATLABprogramthegivenwaveformisplottedbyusingwaveformsynthesisis
successfullycompleted

OUTPUT:
f=

3/(s+2)2/(s+1)

ZEROSANDPOLESINSPLANE

AIM:.ToWriteaMATLABprogramtodrawPoleZeromapinSPlane

PROGRAM:
clc;clearall;closeall;
num=input('enterthenumeratorpolynomialvector\n');%[121]
den=input('enterthedenominatorpolynomialvector\n');%[16116]
H=tf(num,den)
[pz]=pzmap(H);
disp('zerosareat');
disp(z);
disp('polesareat');
disp(p);
pzmap(H);
ifmax(real(p))>=0
disp('AllthepolesdonotlieinthelefthalfofSplanethusthegivenLTIsystemisnotastable
system.');
else
disp('AllthepoleslieinthelefthalfofSplanethusthegivenLTIsystemisastablesystem.');
end;

RESULTS:ThustheMATLABprogramtodrawpolezeromapinSplaneissuccessfullycompleted.

OUTPUT:

Enterthenumeratorpolynomialvector
[121]
Enterthedenominatorpolynomialvector
[16116]

Transferfunction:
s^22s+1

s^3+6s^2+11s+6

Zerosareat
1
1

Polesareat
3.0000
2.0000
1.0000
AllthepoleslieinthelefthalfofSplanethusthegivenLTIsystemisastablesystem.

ZEROSANDPOLESINZPLANE

AIM:.ToWriteaMATLABprogramtodrawPoleZeromapinZPlane

PROGRAM:

clc;clearall;closeall;
num=input('enterthenumeratorpolynomialvector\n');%[100]
den=input('enterthedenominatorpolynomialvector\n');%[110.16]
H=filt(num,den)
z=zero(H);
disp('thezerosareat');
disp(z);
[rpk]=residuez(num,den);
disp('thepolesareat');
disp(p);
zplane(num,den);
title('PoleZeromapintheZplane');
ifmax(abs(p))>=1
disp('allthepolesdonotliewithintheunitcircle');
disp('hencethesystemisnotstable');
else
disp('allthepolesliewithintheunitcircle');
disp('hencethesystemisstable');
end;

RESULTS:ThustheMATLABprogramtodrawpolezeromapinSplaneissuccessfullycompleted.

OUTPUT:

Enterthenumeratorpolynomialvector
[100]
Enterthedenominatorpolynomialvector
[110.16]

Transferfunction:
1

1+z^1+0.16z^2

Thezerosareat
0
0

Thepolesareat
0.8000
0.2000
Allthepolesliewithintheunitcircle,hencethesystemisstable.

SAMPLINGTHEOREM

AIM:.TogenerateaMATLABProgramtoverifysamplingtheorem.

PROGRAM:
clc;
closeall;
clearall;
f1=3;
f2=23;
t=0.4:0.0001:0.4;
x=cos(2*pi*f1*t)+cos(2*pi*f2*t);
figure(1);
plot(t,x,'.r');
xlabel('time');
ylabel('amp');
title('Theoriginalsignal');
%case1:(fs<2fm)
fs1=1.4*f2;
ts1=1/fs1;
n1=0.4:ts1:0.4;
xs1=cos(2*pi*f1*n1)+cos(2*pi*f2*n1);

figure(2);
stem(n1,xs1);
holdon;
plot(t,x,'.r');
holdoff;
legend('fs<2fm');
%case2:(fs=2fm)
fs2=2*f2;
ts2=1/fs2;
n2=0.4:ts2:0.4;
xs2=cos(2*pi*f1*n2)+cos(2*pi*f2*n2);
figure(3);
stem(n2,xs2);
holdon;
plot(t,x,'.r');
holdoff;

legend('fs=2fm');
%case3:(fs>2fm)
fs3=7*f2;
ts3=1/fs3;
n3=0.4:ts3:0.4;
xs3=cos(2*pi*f1*n3)+cos(2*pi*f2*n3);
figure(4);

stem(n3,xs3);
holdon;
plot(t,x,'.r');
holdoff;
legend('fs>2fm');

RESULTS:
ThustheMATLABprogramtoverifySamplingtheoremisperformed.

OUTPUT

You might also like