clear all
close all
clc
%fs = 500;
T = 1;
t = -2.5 : 0.001 : 2.5;
x = rectpuls(t,T);
subplot(2,1,1)
plot(t,x,'r','Linewidth',3);
axis([-2.5 2.5 0 1.2])
title({'Rectangular Pulse'})
xlabel({'Time(s)'});
ylabel('Ampltude');
grid
How can I get Fourier Transform of this Rectangular Pulse. Thank you.
It should look like this

 채택된 답변

Star Strider
Star Strider 2021년 6월 1일

2 개 추천

A symbolic approach —
syms t omega
F(omega) = int(1*exp(1j*omega*t), t, -0.25, 0.25)
F(omega) = 
figure
fplot(F, [-1 1]*16*pi)
grid
.
For a numeric calculation use the fft function.

댓글 수: 4

Kutlu Yigitturk
Kutlu Yigitturk 2021년 6월 1일
If I changing the T value, this output is not changing.
In my code ‘T’ corresponds to the integration limits in the posted image. The pulse you coded goes from (-0.5,0.5), not the same as the posted image. To create the posted image, ‘T’ would be 0.5 instead. My code follows the posted image.
Your code —
T = 1;
t = -2.5 : 0.001 : 2.5;
x = rectpuls(t,T);
% subplot(2,1,1)
plot(t,x,'r','Linewidth',3);
axis([-2.5 2.5 0 1.2])
title({'Rectangular Pulse'})
xlabel({'Time(s)'});
ylabel('Ampltude');
grid
My code for any ‘T’
syms t omega
T = 0.5;
F(omega) = int(1*exp(1j*omega*t), t, -T/2, T/2)
F(omega) = 
figure
fplot(F, [-1 1]*16*pi)
grid
Change ‘T’ to be whatever you want (obviously within computational limits), and my code will produce the coreect result.
.
Kutlu Yigitturk
Kutlu Yigitturk 2021년 6월 1일
I am an engineering student studying in Turkey. Throughout my university life, I have never received as much help from anyone as you did. Really thank you so much. God bless you.
Star Strider
Star Strider 2021년 6월 1일
I very much appreciate your compliment!
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

릴리스

R2021a

질문:

2021년 6월 1일

댓글:

2021년 6월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by