Question

b b had a) Corle (atoul itpeuts

Solve using matlab
And solve by hand

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q2)

Hand calculation:

dd post

MATLAB

Function script

function y=xplt(t)
y=((sin(2*pi*100*t))+(cos(2*pi*100*t)))
end

Main script
clc;close all;clear all;
T=0.01
t=-T:T/500:T
x=xplt(t)

figure(1)
subplot(321)
plot(t,x,'linewidth',3)
xlabel('t');ylabel('x(t)')
title('x(t)')

subplot(322)
plot(t,xplt(-t),'g','linewidth',3)
xlabel('t');ylabel('x(-t)')
title('x(-t)')


xe=(xplt(t)+xplt(-t))/2
subplot(323)
plot(t,xe,'r','linewidth',3)
xlabel('t');ylabel('xe(t)')
title('Even part of x(t)')

xo=(xplt(t)-xplt(-t))/2
subplot(324)
plot(t,xo,'m','linewidth',3)
xlabel('t');ylabel('xo(t)')
title('Odd part of x(t)')

%from hand calculation
xe=cos(2*pi*100*t)
subplot(325)
plot(t,xe,'r','linewidth',3)
xlabel('t');ylabel('xe(t)')
title('Even part of x(t) from hand calculation')


xo=sin(2*pi*100*t)
subplot(326)
plot(t,xo,'m','linewidth',3)
xlabel('t');ylabel('xo(t)')
title('Odd part of x(t) from hand calculation')

x(t) x(-t) VV.VVI 0.5 0.5 -0.5 1.5 -0.01 0.005 0.005 0.01 0.0 0.005 0.005 0.01 Even part of x(t) Odd part of x(t) 0.5 0.5 0.5

Observation:

The results of hand calculations and the results provided by matlab both are same.

___________________________________________________________________________________

Q3)

MATLAB:


clc;close all; clear all;
t=0:0.1:3
h=ones(1,length(t))
x=(exp(-t)).*(t>=0)
subplot(231)
plot(t,x)
xlabel('t');ylabel('x(t)');title('x(t)')

subplot(232)
stem(t,h)
xlabel('t');ylabel('h(t)');title('h(t)')

m=0:0.1:6
y=conv(x,h)
subplot(233)
plot(m,y/10)
xlabel('t');ylabel('y(t)');title('y(t)')

k=0
for w=0:pi/500:pi
k=k+1
Xw(k)=trapz(t,x.*exp(-j*w*t))
end
w=0:pi/500:pi
subplot(234)
plot(w/pi,Xw)
xlabel('w');ylabel('|X(jw)|');title('X(jw)')

k=0
for w=0:pi/500:pi
k=k+1
Hw(k)=trapz(t,h.*exp(-j*w*t))
end
w=0:pi/500:pi
subplot(235)
plot(w/pi,Hw)
xlabel('w');ylabel('|H(jw)|');title('H(jw)')

Yw=Xw.*Hw
k=0
for m=0:0.1:6
k=k+1
yy(k)=trapz(w,Yw.*exp(j*w*m))
end
yy=yy/(2*pi)
m=0:0.1:6
subplot(236)
plot(m,yy)
xlabel('t');ylabel('y(t)');title('y(t) from inverse FT')

x(t) y(t) h(t) 0.8 0.8 0.6 0.6 0.8 0.6 0.4 0.4 0.4 0.2 0.2 0.2 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 1 2 3 4 5 6 H(jw) y(

Add a comment
Know the answer?
Add Answer to:
Solve using matlab And solve by hand b b had a) Corle (atoul itpeuts b b had a) Corle (atoul itpeuts
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT