Plot result of fourier

1 view (last 30 days)
Newbie
Newbie on 9 May 2018
Commented: boris leung on 25 Sep 2020
Can someone help im trying to plot the fourier spectrum of signal u:
syms t w
u=10*sin(t);
%fourier transform
four=fourier(u)
fplot(four)

Answers (2)

Newbie
Newbie on 10 May 2018
thank you but why cant i have the analytical solution of the function plotted? Its literally right there in the variable four....

Star Strider
Star Strider on 9 May 2018
See the documentation for the fft (link) function.
  1 Comment
Star Strider
Star Strider on 10 May 2018
@Newbie —
It gives the result as:
four =
-pi*(dirac(w - 1) - dirac(w + 1))*10i
and plots it as a straight line.
You can also try:
syms t w
u=10*sin(t);
%fourier transform
four = int(u*exp(1j*w*t), t, -1, 1)
four = simplify(four,'Steps',20)
% four = fourier(u)
fplot(real(four), [-15 15])
hold on
fplot(imag(four), [-15 15])
hold off

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!