Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Simple FFT problem
Replies: 6   Last Post: Feb 21, 2012 1:52 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Graham

Posts: 20
Registered: 9/29/09
Simple FFT problem
Posted: Feb 20, 2012 12:10 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

Could you please help me with a simple FFT problem? I just want to plot the FFT of a 1kHz sine wave...


% continous sine wave
fs = 64000;
t=0:1/fs:0.004;
a = 0.5;
f = 1000;
y=a*sin(2*pi*f*t);
figure(1);
plot(t,y);

figure(2);
plot(abs(fft(y)));


Why do I not get a spike at 1kHz? Surely fs is large enough!

Thanks :)



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.