how to use FFT?

Started by
2 comments, last by Timkin 19 years, 8 months ago
Hi, I never used a FFT algorithm before, and I don't know the theory at all... what I need is just get the main frequency from a sound (ie. from a single note of a guitar)... I found FFTW but still I don't know how to use it. Is this a hard task? Someone could give me a very basic tutorial? Thank you.
Advertisement
Did you look at the links page for FFTW? The numerical recipes code might be easier to use.

FFTW links page
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Thank you for the link: this book is very useful and I already downloaded it, but I think it is still too hard for me to figure it out how to do what I need. I wonder if I really need to know how the FFT works to use it (in that case I will try to learn the theory...) or if there is a simpler way to do that. Don't get me wrong, I don't want to have everything without a bit of work, but I need this just for a very small project, and I hope not to spend 2 weeks just to learn all that math ;-)

project: I would like to make a simple instrument tuner: I play the note, and the program says if the note is correct or not. In order to to this, it should be able to recognize the note I'm currently playing, that is (if I'm right) it should find the main harmonic of the sound... How to get this?

mmm...I think I will do my best to understand this FFT.
Some brief background to the FFT...

A signal may be described in a time domain by it's time varying amplitude, x=f(t), or in a frequency domain by its variation with frequency of the complex function y=F(s). y, the amplitude in the frequency domain, is a complex function of the time domain amplitude and phase of the signal.

Given a signal x=f(t), we can find the freqency domain function y=F(s) using the following integral transform:

F(s) = ∫-∞∞f(t)e2(pi)istdt


and you can get back to the original time domain form using the
inverse transform

f(t) = ∫-∞∞F(s)e-2(pi)istds



You don't need to understand this to implement a FFT algorithm. However, it helps to understand a little of this if you hope to use the results of a FFT to analyse a signal, since presumably you want to identify certain properties of the frequency domain signal.

There are a lot of nice properties of this transform pair that might come in handy... but then, maybe you could just get away with performing the FFT on your signal and eyeballing it to see if your note is 'in tune'.

Cheers,

Timkin

This topic is closed to new replies.

Advertisement