i want to write matlab code that calculates fourier transform of following sequence and also plots its magnitude x(k)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
x(n) = 3cos(4*pi*n/N) + sin(6*pi*n/N) where 0 <= n=< N-1 0 <= k =< N-1
0 comentarios
Respuesta aceptada
Birdman
el 6 de Nov. de 2017
N=100;%%you can change it
n=0:N-1;
x=3*cos(4*pi*n/N)+sin(6*pi*n/N);
FFT=fft(x);
plot(abs(FFT))
Also please check
help fft
4 comentarios
Birdman
el 6 de Nov. de 2017
Editada: Birdman
el 6 de Nov. de 2017
You can not plot imaginary parts. The purpose of fft is to see the signals behaviour in frequency domain and by taking abs command, you make the signal appropriate for fft. The magnitude as you say in your question is relevant and we need to find the magnitude of the signal.
Más respuestas (0)
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering 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!