discrete fourier transform by matlab

I would like to program
x(n)={10, 9,1,5,0,8,4} this function to X(ω)
I wanna know magnitude ofㅣX(ω)ㅣrepresented in ω-domain plot
please answer me the code of this program and I will appreciate so much
if you show me the capture or figure of plot .

 Respuesta aceptada

Wayne King
Wayne King el 27 de Mayo de 2012
x = [10 9 1 5 0 8 4];
xdft = fft(x);
plot(abs(xdft))
A better example would be something like:
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
freq = 0:Fs/length(x):Fs/2;
xdft = xdft(1:length(x)/2+1);
plot(freq,abs(xdft)), xlabel('Hz');
ylabel('Magnitude');

2 comentarios

bae hye jeong
bae hye jeong el 27 de Mayo de 2012
Thank you very very much
can I get the figure of plot from you?
have some trouble with my matlab
bae hye jeong
bae hye jeong el 27 de Mayo de 2012
and
xlabel('ω')is more proper for me

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by