Problem Plotting Fourier Transforms of Sine waves
6 次查看(过去 30 天)
显示 更早的评论
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
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
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.
0 个评论
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().
0 个评论
KASTHURI
2024-7-29
Find the fourier transform of where a is a positive real number hence deduce that
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!