discrete fourier transform by matlab

1 view (last 30 days)
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 .

Accepted Answer

Wayne King
Wayne King on 27 May 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 Comments
bae hye jeong
bae hye jeong on 27 May 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 on 27 May 2012
and
xlabel('ω')is more proper for me

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!