Problem Plotting Fourier Transforms of Sine waves
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Walter Roberson
el 11 de Dic. de 2012
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)
Respuestas (3)
Jonathan Epperl
el 11 de Dic. de 2012
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 comentarios
Walter Roberson
el 11 de Dic. de 2012
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 comentarios
KASTHURI
el 29 de Jul. de 2024
Find the fourier transform of where a is a positive real number hence deduce that
0 comentarios
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!