Symbolically Calculating Fourier Transforms with int()
10 views (last 30 days)
Show older comments
Shawn Cooper
on 26 Oct 2019
Commented: Star Strider
on 27 Oct 2019
For the following function:
x_1 = heaviside(t + 0.5) - heaviside(t - 0.5);
I would like to symbolically compute the Fourier Transform using MATLAB's int() function.
Using as my guide, my attempt was as follows:
FX_1 = int(x_1*exp(-1i*omega*t),t,-inf,inf);
The return was unusable. There are obviously other ways to go about getting the Fourier Transform of a function, but in this instance I am specifically looking to do so using the int() function.
Bonus question: how would you plot the magnitude line spectrum of the function? Would the following work?
omega = -100:0:100;
plot(abs(FX_1),omega)
0 Comments
Accepted Answer
Star Strider
on 26 Oct 2019
The heaviside step function is simply 1 on the interval you are interested in.
Try this:
syms omega t
FX_1 = int(1*exp(-1i*omega*t),t,-0.5,0.5);
figure
fplot(FX_1, [-50, 50])
grid
Change the fplot limits to be whatever you want them to be.
4 Comments
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!