plotting FFT in matlab find error please

Status
Not open for further replies.

mayavi

Junior Member level 3
Joined
Sep 6, 2009
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
ind
Activity points
1,419
The following program is not showin the frequency properly that is supposed to be got by fft. please help.
clear all;clc;close all;
fs=1e3;
t=(0:fs)'/fs*10;
f=30;
x=sin(2*pi*f*t);
xf=fft(x);
plot(t,x);
hold on
plot(t,xf,'r');
grid on; axis tight; zoom on;
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…