Fourier Transform of 4 cycles of cosine

2 visualizaciones (últimos 30 días)
Carlota Trigo
Carlota Trigo el 8 de Nov. de 2018
Editada: John D'Errico el 8 de Nov. de 2018
I was given an exercise in class about plotting the Fourier transform of the cos(4*pi*t) for 4 cycles. I have tried the exercise, but I don't quite get the result expected. This is what I have attepted so far, can anybody help me? I am given an increment of t that is 0.01.
delta_t=0.01; T=2*pi; w=-0:delta_w:T; X=zeros(size(w)); for k=1:length(w) X(k)=sum(x.*exp(-1i*w(k)*cos(4*pi*t))); end
plot(w,abs(X));
THANK YOU
  1 comentario
John D'Errico
John D'Errico el 8 de Nov. de 2018
Editada: John D'Errico el 8 de Nov. de 2018
Is this what you expected?
Undefined function or variable 'delta_w'.
If not, then you need to define delta_w.
Ok, maybe you meant delta_w is 0.01. But then you should recognize that 2*pi does not divide evenly into increments of 0.01. So the last point will not be 2*pi, but some small amount off.
And, oh, what is the difference between -0 and 0? That new math stuff. I'll never understand it.
Hmm. What else. Do you think that cos(4*pi*T) covers 4 cycles? Since T=2*pi, then 4*pi*T=8*pi^2.
Since the cos function is periodic on the interval 2*pi, then 4 cycles would be 8*pi.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by