Problem Plotting Fourier Transforms of Sine waves

조회 수: 3 (최근 30일)
Matt
Matt 2012년 12월 11일
답변: KASTHURI 2024년 7월 29일
Hello!
So let me start off by saying that I barely use MatLab. However, my professor assigned us a homework in which we have to find the fourier transform of a multiplication of sine waves and plot it. This is what I am trying..
>> syms x y
>> f=sin(2*x)*sin(5*x)
f =
sin(2*x)*sin(5*x)
>> g=fourier(f)
g =
2*transform::fourier(cos(x)*sin(x)^6, x, -w) - 20*transform::fourier(cos(x)^3*sin(x)^4, x, -w) + 10*transform::fourier(cos(x)^5*sin(x)^2, x, -w)
>> ezplot(fourier(g))
??? Error using ==> char
Cell elements must be character arrays.
Error in ==> ezplot at 160
fmsg = char(f);
Error in ==> sym.ezplot at 45
h = ezplot(char(f));
Why am I getting this error? How can I plot the Fourier transforms of these sine waves?
Any help would be appreciated!!
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 12월 11일
Note that fourier(g) would be trying to take the fourier transform of something that is already a fourier transform, since g is fourier(f)

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

답변 (3개)

Jonathan Epperl
Jonathan Epperl 2012년 12월 11일
What version of Matlab and the Symbolic Toolbox are you using? I am using Matlab 2012b with the Symbolic Toolbox Version 5.9 and I get nothing like that. Your output looks like mupad syntax of the same command.
But is your prof asking you to use Matlab for that? This is very easily done by hand, the FT of your product is going to be a convolution of Dirac delta impulses; you'll have trouble plotting that anyway.

Walter Roberson
Walter Roberson 2012년 12월 11일
If you are working symbolically then you are calculating the theoretical continuous fourier transform. In order to plot a continuous fourier transform properly, you need an infinite number of points. It is not possible to plot an infinite number of points.
I suggest you consider using the discrete fourier transform, fft().

KASTHURI
KASTHURI 2024년 7월 29일
Find the fourier transform of where a is a positive real number hence deduce that

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by