Question
Hello, I'm taking signal systems course. please solve this question in matlab as soon as possbile please.
Question 1 a) Write a function that calculates the Continuous Time Fourier Transform of a periodic signal x() Syntax: [w, X]
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

function [w,X]=CTFT(t,x)
w=-50:.1:50; %create the w axis
for i=1:length(w)
X(i)=0;
for j=1:length(t)-1
X(i)=X(i)+x(j)*exp(-1i*w(i)*t(j))*(t(j+1)-t(j));
end
end

==========================================================

b)

function x=ICTFT(t,w,X)
for i=1:length(t)
x(i)=0;
for j=1:length(w)-1
x(i)=x(i)+X(j)*exp(1i*w(j)*t(i))*(w(j+1)-w(j));
end
end
x=x/(2*pi);

==========================================================

c) Run the following code in the MATLAB command window after saving the above two functions

t=-50:0.1:50;
x=sin(t);
[w,X]=CTFT(t,x);
figure;
subplot(3,1,1);plot(w,abs(X),'k');xlabel('\omega');ylabel('Magnitude');title('Magnitude of CTFT');
x1=ICTFT(t,w,X);
subplot(3,1,2);plot(t,x,'k');xlabel('time');ylabel('value');title('Time Domain Signal');
subplot(3,1,3);plot(t,x1,'k');xlabel('time');ylabel('value');title('Time Domain Signal after using ICTFT');

Magnitude of CTFT a 100 E 50 50 40 30 -20 -10 0 10 2030 40 50 Time Domain Signal 50 40 30 -20 -10 0 10 2030 40 50 time Time D

The mismatch is because after applying ICTFT the signal x1 is not same as x as we cannot perform continuous integration. So, it will be a complex number.

Add a comment
Know the answer?
Add Answer to:
Hello, I'm taking signal systems course. please solve this question in matlab as soon as possbile please. Question 1 a) Write a function that calculates the Continuous Time Fourier Transform o...
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