DSPRelated.com
Forums

FFT question!

Started by phunkyman March 29, 2004
Hi,

When realising a FFT, can we get the frequency corresponding to each
point calculated? Apparently, the results given by a FFT is only the
[Re,Im] of each point?
If we can't know the frequency by a FFT, how can we do it?

The thing i'd like to do is detecting 2 different frequencies from the
same input signal. Can it be possible?

Thanks.
On 29 Mar 2004 02:21:38 -0800, phunky.data@caramail.com (phunkyman)
wrote:

>Hi, > >When realising a FFT, can we get the frequency corresponding to each >point calculated? Apparently, the results given by a FFT is only the >[Re,Im] of each point? >If we can't know the frequency by a FFT, how can we do it? > >The thing i'd like to do is detecting 2 different frequencies from the >same input signal. Can it be possible?
Every point in an FFT corresponds to a specific frequency - namely the multiples of the inverse of the sample period. In order to "find" a frequency in a signal, you can search through the FFT looking for amplitude peaks. If you want more resolution than the raw FFT provides, then you can employ one of the many interpolation techniques which rely on the peak amplitude and the amplitudes of the nearby FFT entries. If your signal has two different frequencies, then the FFT with have two separate peaks. -Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)
phunkyman wrote:
> Hi, > > When realising a FFT, can we get the frequency corresponding to each > point calculated? Apparently, the results given by a FFT is only the > [Re,Im] of each point? > If we can't know the frequency by a FFT, how can we do it? > > The thing i'd like to do is detecting 2 different frequencies from the > same input signal. Can it be possible? > > Thanks.
If the only thing you need is detection of two specific frequencies, you might want to use goertzel filters instead of fft. It will be more efficient and you can specify the frequencies of interest more precisely. A goertzel filter is analogous to one bin of a DFT. A google search should turn up some links. -- Mark Borgerding
In article <e435cb3e.0403290221.2050e197@posting.google.com>,
phunkyman <phunky.data@caramail.com> wrote:
>When realising a FFT, can we get the frequency corresponding to each >point calculated?
Only if you know the sample rate of the input data and the length of the FFT.
>The thing i'd like to do is detecting 2 different frequencies from the >same input signal. Can it be possible?
Depends on the separation of the 2 frequencies, how they relate to the sample rate, and the signal-to-noise ratio. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Try http://www.dspdimension.com look for "The DFT Explained" (The DFT a Pied).

--frank
Thanks evryone.

Robert: 
> Every point in an FFT corresponds to a specific frequency - namely the > multiples of the inverse of the sample period. In order to "find" a > frequency in a signal, you can search through the FFT looking for > amplitude peaks. If you want more resolution than the raw FFT > provides, then you can employ one of the many interpolation techniques > which rely on the peak amplitude and the amplitudes of the nearby FFT > entries. If your signal has two different frequencies, then the FFT > with have two separate peaks.
I think i can do this, searching for two peaks. But i also need to know the arrival time between these 2 frequencies! The signals i want to study are sferic signals. What do you mean by interpolation techniques rely on the peak amplitude? Can you give me examples, please? Thansk again.
On 30 Mar 2004 00:16:52 -0800, phunky.data@caramail.com (phunkyman)
wrote:

>I think i can do this, searching for two peaks. But i also need to >know the arrival time between these 2 frequencies!
The resolution of arrival times depends on the length of each set of sample points that go into the FFT. A frequency that appears at the beginning of a sample set will appear the same in the FFT as on that appears late in that sample. The only way to improve the resolution is to take shorter sample sets, which will also reduce the frequency resolution of the FFT. So try to find a sample set period that is long enough to give you adequate frequency resolution in the FFT and yet short enough to define arrival times adequately. Regarding bin interpolation, I don't have references at hand, but I think you can find then in the FAQs for this group, or by googling "finding frequency" and "interpolation". There is a page I saw somewhere that had several methods listed. The one that I use is called quadratic interpolation, and it relies on the peak amplitude and the amplitudes of the immediately adjacent bins. -Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)
In article <e435cb3e.0403300016.51c8f1ee@posting.google.com>,
phunkyman <phunky.data@caramail.com> wrote:
>I think i can do this, searching for two peaks. But i also need to >know the arrival time between these 2 frequencies!
If the differences in arrival time are a multiple of your FFT length, then you merely need to count FFT's from when you detect one frequency until you detect the second and multiply by the offset in time between FFT's. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Thanks everyone for your answers.

In fact i won't need to detect 2 different frequencies as i won't have
to detect this kind of signal.

Even though i thank you for the time you spent on my question.

Maybe I'll have other questions in the future!