# how to use FFT?

This topic is 5073 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
Did you look at the links page for FFTW? The numerical recipes code might be easier to use.

##### Share on other sites
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.

##### Share on other sites
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

1. 1
Rutin
19
2. 2
3. 3
4. 4
5. 5
frob
12

• 15
• 13
• 9
• 12
• 10
• ### Forum Statistics

• Total Topics
631442
• Total Posts
3000102
×